:root {
    --primary: #FFD700;
    --primary-dark: #d67900;
    --bg-dark: #0a0a0a;
    --bg-card: #111111;
    --border: #2a2a2a;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --primary-glow: rgba(255, 215, 0, 0.25);
    --bg-input: rgba(15, 15, 25, 0.8);
    --success: #00c853;
    --error: #ff3d00;
    --gradient-1: rgba(255, 215, 0, 0.08);
    --gradient-2: rgba(218, 165, 32, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a0a 50%, #0a0a0a 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, var(--gradient-1) 0%, transparent 40%),
                radial-gradient(circle at 70% 60%, var(--gradient-2) 0%, transparent 40%),
                radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
    animation: bgPulse 15s ease-in-out infinite;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255, 215, 0, 0.01) 2px,
        rgba(255, 215, 0, 0.01) 4px
    );
    pointer-events: none;
    z-index: -1;
}

@keyframes bgPulse {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    33% { 
        transform: translate(-2%, -1%) scale(1.02);
        opacity: 1;
    }
    66% { 
        transform: translate(1%, 2%) scale(0.98);
        opacity: 0.7;
    }
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.logo {
    position: static;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0f;
    font-size: 22px;
    box-shadow: 0 8px 20px var(--primary-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover .logo-icon {
    transform: scale(1.05) rotate(-5deg);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.logo-text {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-text span {
    background: linear-gradient(135deg, var(--primary) 0%, #FFA500 50%, var(--primary) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.made-by {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid var(--border);
    border-radius: 40px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-decoration: none;
}

.made-by:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.made-by i {
    color: var(--primary);
}

/* Main Card */
.main-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 36px;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(255, 215, 0, 0.05) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-card:hover {
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 215, 0, 0.1) inset;
}

/* URL Input */
.url-input-group {
    display: flex;
    gap: 14px;
    margin-bottom: 32px;
}

.url-input {
    flex: 1;
    padding: 18px 22px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    transform: translateY(-1px);
}

.url-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.btn {
    padding: 18px 32px;
    border: none;
    border-radius: 18px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #0a0a0f;
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Preview */
.preview-card {
    display: none;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-card.show {
    display: flex;
    gap: 24px;
    align-items: center;
}

.preview-thumbnail {
    width: 170px;
    height: 100px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.preview-info h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.preview-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.option-group {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease;
}

.option-group:hover {
    border-color: rgba(255, 215, 0, 0.3);
}

.option-label {
    display: block;
    margin-bottom: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary) 0%, #FFC000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 15px;
    letter-spacing: 0.3px;
}

.option-label i {
    margin-right: 8px;
    background: linear-gradient(135deg, var(--primary), #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(10, 10, 15, 0.8);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

select:hover {
    border-color: var(--primary);
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select option {
    background: var(--bg-dark);
    color: var(--text);
}

/* Codec Options */
.codec-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.codec-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px 8px;
    background: rgba(10, 10, 15, 0.8);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.codec-btn i {
    margin-right: 6px;
}

.codec-btn.active {
    border-color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.codec-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Progress */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.progress-bar.show {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #FFA500, var(--primary));
    background-size: 200% 100%;
    width: 0%;
    animation: shimmer 2s infinite, gradientShift 3s ease infinite;
}

@keyframes shimmer {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Error */
.error-gif {
    display: block;
    margin: 20px auto 0 auto;
    width: 120px;
}

.error-message {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
}

.error-message.show {
    display: block;
}

.error-container {
    text-align: center;
    padding: 40px;
    max-width: 600px;
}

.error-code {
    font-size: 120px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 20px;
}

.error-icon {
    font-size: 60px;
    color: var(--primary);
    margin-bottom: 30px;
}

.error-title {
    font-size: 32px;
    margin-bottom: 20px;
}

.error-message {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
}

.home-button {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), #FFA500);
    color: #000;
    text-decoration: none;
    border-radius: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

/* Download Button */
.download-btn {
    width: 100%;
    justify-content: center;
    padding: 22px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #0a0a0f;
    box-shadow: 0 8px 25px var(--primary-glow);
}

.download-btn:not(:disabled):hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px var(--primary-glow);
}

/* Features */
.features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.feature-badge {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-badge:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.feature-badge i {
    color: var(--primary);
    font-size: 18px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #FFA500;
}

.footer i {
    color: var(--primary);
    margin: 0 4px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1.5px solid var(--primary);
    border-radius: 16px;
    padding: 16px 26px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.toast.success {
    border-color: var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.error i {
    color: var(--error);
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 700px) {
    .container {
        padding: 20px 16px;
    }
    
    .main-card {
        padding: 24px;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .preview-card.show {
        flex-direction: column;
    }
    
    .preview-thumbnail {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .header {
        flex-direction: column;
        gap: 18px;
    }
    
    .logo-text {
        font-size: 22px;
    }
    
    .codec-btn {
        min-width: 80px;
        font-size: 12px;
    }

}