/* ========================================
   Toasts & Progress
   ======================================== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

/* Processing indicator (right-bottom, stacked with toasts) */
.toast.processing {
    border-left: 4px solid var(--border);
    animation: none;
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.toast.processing .processing-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.processing .processing-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.toast.processing .processing-message {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.toast.processing .processing-details {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    opacity: 0.95;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    font-size: 20px;
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-width: 320px;
    max-width: 400px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.upload-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.upload-progress-count {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 10px;
}

.upload-overall-progress {
    margin-bottom: 12px;
    padding: 8px 0;
}

.upload-overall-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.upload-overall-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.upload-item {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: background 0.2s ease;
}

.upload-item:last-child {
    margin-bottom: 0;
}

.upload-item.uploading {
    background: var(--bg-tertiary);
}

.upload-item.pending {
    opacity: 0.7;
}

.upload-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.upload-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.upload-cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.upload-cancel-btn:hover {
    background: var(--danger-bg, rgba(239, 68, 68, 0.1));
    border-color: var(--danger, #ef4444);
    color: var(--danger, #ef4444);
}

.upload-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.upload-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Shared Progress Container for Delete/Move/Download */
.delete-progress,
.move-progress,
.download-progress,
.upload-progress-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: auto;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
}

/* Individual Progress Items styles */
.progress-item {
    background: var(--bg-primary);
    margin: 0;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: var(--shadow-md);
    width: calc(100vw - 48px);
    max-width: 360px;
    margin-bottom: 12px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-name {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
}

.progress-count {
    color: var(--text-secondary);
    font-size: 12px;
}

.progress-bar-bg {
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

/* Response Layout for Toast */
@media (max-width: 768px) {
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .toast {
        min-width: auto;
    }
}
