:root {
    --primary: #f97316;
    --primary-dark: #ea580c;
    --secondary: #3b82f6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --gray-dark: #1e293b;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

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

body {
    background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--light);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.header .badge {
    display: inline-block;
    background: rgba(249, 115, 22, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary);
    margin-top: 0.5rem;
}

.subtitle {
    color: var(--gray-light);
    font-size: 1rem;
}

/* Layout Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Card Styles */
.card {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(249, 115, 22, 0.2);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--light);
}

.card-header-icon {
    font-size: 1.5rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-light);
    margin-bottom: 0.5rem;
}

input, textarea, select {
    width: 100%;
    background: var(--dark);
    border: 1px solid var(--gray-dark);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--light);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: var(--gray-dark);
    color: var(--light);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gray-dark);
    color: var(--light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-dark);
    color: var(--gray-light);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--dark);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--gray-dark);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Progress Section */
.progress-section {
    background: var(--dark);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-light);
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 0.5rem;
    background: var(--gray-dark);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 9999px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Log Area */
.log-area {
    background: var(--darker);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    margin-top: 1rem;
}

.log-entry {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--gray-dark);
    color: var(--gray-light);
}

.log-entry.success {
    color: var(--success);
}

.log-entry.error {
    color: var(--danger);
}

.log-entry.processing {
    color: var(--warning);
}

/* Cookie Status */
.cookie-status {
    background: var(--dark);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cookie-status.success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
}

.cookie-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

.cookie-status.info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--secondary);
}

.cookie-status-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* Info Boxes */
.info-box {
    background: var(--dark);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 1rem 0;
    border-left: 3px solid var(--secondary);
}

.info-box.warning {
    border-left-color: var(--warning);
}

.info-box.success {
    border-left-color: var(--success);
}

.info-box.danger {
    border-left-color: var(--danger);
}

.info-box h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.info-box p {
    font-size: 0.75rem;
    color: var(--gray-light);
}

/* Downloads Grid */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.25rem;
}

.download-item {
    background: var(--dark);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
    border: 1px solid var(--gray-dark);
}

.download-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.download-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.download-info {
    flex: 1;
    min-width: 0;
}

.download-name {
    font-weight: 500;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-meta {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.download-size {
    font-size: 0.6875rem;
    color: var(--gray-light);
    background: var(--gray-dark);
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
}

.download-actions {
    display: flex;
    gap: 0.375rem;
    flex-shrink: 0;
}

/* Audio Player Modal */
.audio-player-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--dark);
    border-top: 1px solid var(--gray-dark);
    padding: 0.75rem 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.audio-player-modal.show {
    transform: translateY(0);
}

.audio-player-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.audio-player-info {
    flex: 1;
    min-width: 150px;
}

.audio-player-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-player-controls {
    flex-shrink: 0;
}

.audio-player-controls audio {
    height: 40px;
    max-width: 300px;
}

.audio-player-close {
    background: none;
    border: none;
    color: var(--gray-light);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-light);
}

.empty-state-icon {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 0.875rem;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-dark);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0.75rem;
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .downloads-grid {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .cookie-status {
        flex-direction: column;
        text-align: center;
    }
    
    .audio-player-content {
        flex-direction: column;
        text-align: center;
    }
    
    .audio-player-controls audio {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .download-item {
        flex-wrap: wrap;
    }
    
    .download-actions {
        margin-left: auto;
    }
}

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

.card, .download-item, .stat-card {
    animation: fadeIn 0.3s ease;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-gray { color: var(--gray-light); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }



/* Download All button loading state */
.btn-loading {
    opacity: 0.7;
    cursor: wait;
}

.btn-loading .spinner {
    display: inline-block;
}

/* Progress indicator for download all */
.download-progress {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--dark);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--success);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}