* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: #e0e0e0;
    position: relative;
    overflow-x: hidden;
}

/* Particles.js container */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

#particles-js canvas {
    pointer-events: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    color: #ffffff;
    margin-bottom: 50px;
    position: relative;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.back-link {
    color: #ffd700;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(10px);
}

.back-link:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateX(-5px);
}

main {
    flex: 1;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 24px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 
                0 0 0 1px rgba(255, 215, 0, 0.1);
    position: relative;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.url-input-section {
    text-align: center;
    margin-bottom: 40px;
}

.url-input-section h2 {
    margin-bottom: 30px;
    color: #e0e0e0;
    font-size: 1.5rem;
    font-weight: 600;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    color: #e0e0e0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.input-group input::placeholder {
    color: #888;
    font-weight: 400;
}

.input-group input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2), 
                0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.input-group button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.input-group button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.input-group button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.input-group button:hover::before {
    left: 100%;
}

.input-group button:active {
    transform: translateY(-1px);
}

.video-info {
    margin-top: 30px;
    background: rgba(30, 30, 30, 0.6);
    border-radius: 20px;
    padding: 30px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.video-details {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.video-details img {
    width: 200px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.video-meta {
    flex: 1;
}

.video-meta h3 {
    color: #ffd700;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.3;
}

.video-meta p {
    color: #ccc;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.download-options {
    margin-top: 30px;
}

.download-options h3 {
    color: #ffd700;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.format-group {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.format-group h4 {
    color: #ffd700;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.format-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.format-item {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.format-item:hover {
    border-color: #ffd700;
    background: rgba(30, 30, 30, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.format-item .format-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.format-quality {
    color: #ffd700;
    font-weight: 600;
    font-size: 1rem;
}

.format-size {
    color: #ccc;
    font-size: 0.9rem;
}

.format-type {
    color: #aaa;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.download-format-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-format-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #ffd700;
}

.spinner {
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.error h3 {
    color: #dc3545;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.error p {
    color: #ccc;
    font-size: 1rem;
}

.age-restricted {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}

.age-restricted h2 {
    color: #ffc107;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.age-restricted p {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.retry-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    main {
        padding: 30px 20px;
    }

    .input-group {
        flex-direction: column;
        max-width: 100%;
    }

    .video-details {
        flex-direction: column;
        text-align: center;
    }

    .video-details img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .format-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px 15px;
    }

    .url-input-section h2 {
        font-size: 1.3rem;
    }

    .input-group input,
    .input-group button {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* Progress Modal */
.progress-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.progress-content {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.progress-content h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 600;
}

.progress-bar-container {
    margin: 30px 0;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #333;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    border-radius: 6px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.progress-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffd700;
    margin-bottom: 10px;
}

.progress-details {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin-bottom: 30px;
    min-height: 20px;
}

.cancel-btn {
    background: #ff4444;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #ff6666;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

