/* Component Styles - Dark Mode */

/* Dashboard */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dashboard-header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
}

/* Header Buttons - Consistent Styling */
.dashboard-header button {
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--surface-elevated);
    color: var(--text-secondary);
}

.dashboard-header button:not(:disabled) {
    cursor: pointer;
}

.dashboard-header button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-header button:not(:disabled):hover {
    background: var(--border);
    color: var(--text);
    border-color: var(--border-hover);
}

/* Primary variant in header */
.dashboard-header button.btn-primary:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.dashboard-header button.btn-primary:not(:disabled):hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Legacy btn-logout class for compatibility */
.btn-logout {
    background: var(--surface-elevated);
    color: var(--text-secondary);
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: var(--border);
    color: var(--text);
    border-color: var(--border-hover);
}

/* Download Form */
.download-form {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
}

.download-form h2 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.download-form-inputs {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.download-form input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: var(--text);
    transition: all 0.2s ease;
}

.download-form input::placeholder {
    color: var(--text-muted);
}

.download-form input:hover {
    border-color: var(--border-hover);
}

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

/* Download List */
.download-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.download-list > p {
    grid-column: 1 / -1;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.download-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
    animation: cardFadeIn 0.3s ease;
}

.download-item:hover {
    border-color: var(--border-hover);
}

.download-clickable {
    cursor: pointer;
}

.download-clickable:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.download-clickable:hover .download-card-cover::after {
    content: '⬇';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.15);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.download-clickable:active {
    transform: translateY(-2px);
}

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

.download-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--background);
    overflow: hidden;
    isolation: isolate;
}

.download-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--background);
}

.download-card-cover img.loading {
    opacity: 0.5;
}

.download-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--text-muted);
    background: linear-gradient(135deg, var(--surface), var(--background));
}

/* Progress Overlay - Bottom to Top */
.progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3));
    backdrop-filter: blur(4px);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: height;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1rem;
}

.progress-percentage {
    color: white;
    font-weight: 600;
    font-size: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.download-info {
    padding: 1rem 1rem 1.25rem 1rem;
}

.download-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: 2.6em;
}

.download-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-info small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.5rem;
}

.download-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.status-pending {
    background: rgba(250, 204, 21, 0.9);
    color: #000;
}

.status-authenticating,
.status-parsing,
.status-downloading,
.status-converting {
    background: rgba(99, 102, 241, 0.9);
    color: white;
}

.status-completed {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.status-failed {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}


/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4),
                0 4px 6px -2px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--error);
}

.toast-info {
    border-left: 3px solid var(--primary-color);
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.toast-close:hover {
    color: var(--text);
}

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

@media (max-width: 640px) {
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .toast {
        min-width: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dashboard {
        padding: 1.5rem 1rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .download-form-inputs {
        flex-direction: column;
    }
    
    .download-list {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .download-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

