/**
 * MTG Collection Manager - Notification Styles
 * Toast notifications and tasks panel
 */

/* ============================================================
   TOAST CONTAINER
   ============================================================ */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    max-width: 400px;
    pointer-events: none;
}

/* ============================================================
   INDIVIDUAL TOAST
   ============================================================ */

.toast {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.toast.toast-success {
    border-color: var(--color-success);
}

.toast.toast-error {
    border-color: var(--color-danger);
}

.toast.toast-running {
    border-color: var(--color-gold);
}

.toast.toast-hide {
    animation: slideOut 0.3s ease forwards;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toast-title {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-title-icon {
    font-size: 1.1rem;
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.2rem;
}

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

.toast-message {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Progress bar in toast */
.toast-progress {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}

.toast-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

/* ============================================================
   TASKS PANEL (SLIDE-IN)
   ============================================================ */

.tasks-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--color-bg-card);
    border-left: 1px solid var(--color-border);
    z-index: var(--z-modal);
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.tasks-panel.open {
    right: 0;
}

.tasks-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.tasks-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.tasks-panel-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tasks-panel-header h3 {
    font-family: var(--font-display);
    color: var(--color-gold);
}

.tasks-panel-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.5rem;
}

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

.tasks-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.tasks-panel-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

/* ============================================================
   TASK ITEM IN PANEL
   ============================================================ */

.task-item {
    background: var(--color-bg-dark);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.task-item.task-running {
    border-color: var(--color-gold);
}

.task-item.task-completed {
    border-color: var(--color-success);
    opacity: 0.8;
}

.task-item.task-failed {
    border-color: var(--color-danger);
}

.task-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.task-item-type {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-item-status {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    margin-left: auto;
}

.task-item-status.running {
    background: rgba(212, 175, 55, 0.2);
    color: var(--color-gold);
}

.task-item-status.completed {
    background: rgba(46, 204, 113, 0.2);
    color: var(--color-success);
}

.task-item-status.failed {
    background: rgba(231, 76, 60, 0.2);
    color: var(--color-danger);
}

.task-item-message {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.task-item-progress {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.task-item-progress-bar {
    height: 100%;
    background: var(--color-gold);
    transition: width var(--transition-normal);
}

/* ============================================================
   IMPORT RESULT TOAST (EXTENDED)
   ============================================================ */

.toast-import-result {
    max-width: 450px;
}

.toast-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast-success .toast-icon {
    stroke: var(--color-success);
}

.toast-error .toast-icon {
    stroke: var(--color-danger);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

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

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

.toast-details {
    margin-top: 0.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
}

.toast-details summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-gold);
    padding: 0.25rem 0;
    user-select: none;
}

.toast-details summary:hover {
    text-decoration: underline;
}

.toast-details-content {
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.notif-detail-section {
    margin-bottom: 0.75rem;
}

.notif-detail-section:last-child {
    margin-bottom: 0;
}

.notif-detail-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notif-detail-title.success {
    color: var(--color-success);
}

.notif-detail-title.info {
    color: var(--color-info);
}

.notif-detail-title.warning {
    color: #f39c12;
}

.notif-detail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
}

.notif-detail-list li {
    padding: 0.15rem 0;
    color: var(--color-text);
}

.toast-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
}

.toast-actions .btn-sm {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

.toast-hiding {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
    .toast-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .toast-import-result {
        max-width: none;
    }
    
    .tasks-panel {
        width: 100%;
        right: -100%;
    }
}
