/* Download Drawer */
.download-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    z-index: 998;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 200px;
}

.download-drawer.active {
    transform: translateY(0);
}

.download-drawer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.download-drawer-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.download-drawer-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.download-drawer-icon.generating {
    background: var(--accent-light);
    animation: pulse 2s ease-in-out infinite;
}

.download-drawer-icon.completed {
    background: #d1fae5;
}

.download-drawer-text {
    flex: 1;
}

.download-drawer-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.download-drawer-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.download-drawer-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.drawer-close-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.drawer-close-btn:hover {
    background: var(--border);
    color: var(--text-primary);
}

.drawer-download-btn {
    padding: 0.875rem 2rem;
    background: var(--accent-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.drawer-download-btn:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.drawer-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Progress Bar */
.download-progress {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.download-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--accent-light);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile responsiveness for drawer */
@media (max-width: 768px) {
    .download-drawer-content {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
    }
    
    .download-drawer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .download-drawer-actions {
        width: 100%;
        flex-direction: column-reverse;
    }
    
    .drawer-download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .drawer-close-btn {
        align-self: flex-end;
    }
}