:root {
    --bs-body-bg: #0f0f0f;
    --bs-body-color: #e0e0e0;
    --bs-primary: #6366f1;
    --bs-secondary: #64748b;
    --bs-dark: #1a1a1a;
    --bs-border-color: #2a2a2a;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #6366f1 #1a1a1a;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: #1a1a1a;
}

*::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 4px;
}

body {
    background-color: #0f0f0f;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header */
header {
    background-color: #0a0a0a;
    border-bottom: 1px solid #2a2a2a;
    padding: 1.5rem;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.header-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: #6366f1;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s;
    padding: 0;
}

.header-back:hover {
    color: #4f46e5;
    transform: translateX(-2px);
}

.header-back:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Container */
.download-container {
    max-width: 500px;
    width: 90%;
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

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

.download-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.download-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.download-subtitle {
    font-size: 1.125rem;
    color: #a5b4fc;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Progress Steps */
.progress-steps {
    margin-bottom: 2.5rem;
    text-align: left;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background-color: #2a2a2a;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.progress-step.active {
    background-color: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.progress-step.completed {
    opacity: 0.6;
}

.progress-step-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background-color: #3a3a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #a5b4fc;
}

.progress-step.active .progress-step-number {
    background-color: #6366f1;
    color: white;
}

.progress-step.completed .progress-step-number {
    background-color: #22c55e;
    color: white;
}

.progress-step.completed .progress-step-number::after {
    content: '✓';
    position: absolute;
    font-size: 1.1rem;
}

.progress-step-label {
    flex: 1;
    font-size: 0.95rem;
    color: #e0e0e0;
}

.progress-step.completed .progress-step-label {
    color: #22c55e;
}

.progress-step.active .progress-step-label {
    color: #6366f1;
}

.progress-indicator {
    width: 100%;
    height: 3px;
    background-color: #2a2a2a;
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #4f46e5 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease-out;
}

/* Info Section */
.info-section {
    background-color: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #a0a0a0;
    line-height: 1.6;
}

.info-section strong {
    color: #6366f1;
}

/* Action Buttons */
.download-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary-action {
    flex: 1;
    min-width: 150px;
    background-color: #6366f1;
    border: none;
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary-action:hover {
    background-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
    text-decoration: none;
    color: white;
}

.btn-primary-action:disabled {
    background-color: #3a3a3a;
    color: #888;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

.btn-primary-action:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

.btn-secondary-action {
    flex: 1;
    min-width: 150px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #e0e0e0;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondary-action:hover {
    background-color: #3a3a3a;
    border-color: #6366f1;
    color: #6366f1;
    text-decoration: none;
}

.btn-secondary-action:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Footer */
footer {
    background-color: #0a0a0a;
    border-top: 1px solid #2a2a2a;
    padding: 1.5rem;
    margin-top: auto;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    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);
    }
}

/* Hidden state */
.hidden {
    display: none !important;
}

/* Success state */
.success-icon {
    font-size: 4rem;
    color: #22c55e;
    margin-bottom: 1rem;
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    color: #22c55e;
    font-size: 1.5rem;
}

/* Mobile */
@media (max-width: 576px) {
    .download-container {
        padding: 2rem 1.5rem;
    }

    .download-title {
        font-size: 1.5rem;
    }

    .download-actions {
        flex-direction: column;
    }

    .btn-primary-action,
    .btn-secondary-action {
        min-width: unset;
    }
}

/* Redirect Message */
.redirect-message {
    text-align: center;
    color: #e0e0e0;
}

.redirect-message p {
    font-size: 1.1rem;
    margin: 0;
}

#countdown {
    color: #6366f1;
    font-weight: bold;
}
