/**
 * Member Pages - Toast Notification Styles
 * Modern toast notifications with success, error, warning, info variants
 * Requirements: 3.5
 */

/* ========================================
   Toast Container
   ======================================== */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
    pointer-events: none;
}

/* Mobile positioning */
@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
    }
}

/* ========================================
   Toast Base Styles
   ======================================== */

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    background: white;
    border: 1px solid #e5e7eb;
    min-width: 300px;
    max-width: 420px;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile toast width */
@media (max-width: 640px) {
    .toast {
        min-width: auto;
        max-width: 100%;
        transform: translateY(100%);
    }
    
    .toast.toast-visible {
        transform: translateY(0);
    }
}

.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-hiding {
    transform: translateX(100%);
    opacity: 0;
}

@media (max-width: 640px) {
    .toast.toast-hiding {
        transform: translateY(100%);
    }
}

/* ========================================
   Toast Icon
   ======================================== */

.toast-icon {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.875rem;
}

/* ========================================
   Toast Content
   ======================================== */

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #111827;
    margin-bottom: 0.125rem;
    line-height: 1.4;
}

.toast-message {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    word-wrap: break-word;
}

/* ========================================
   Toast Close Button
   ======================================== */

.toast-close {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: 0;
    margin: -0.25rem -0.25rem -0.25rem 0;
}

.toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.toast-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========================================
   Toast Progress Bar
   ======================================== */

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0.5rem 0.5rem;
    transition: width linear;
}

.toast {
    position: relative;
    overflow: hidden;
}

/* ========================================
   Toast Variants - Success
   ======================================== */

.toast-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(to right, #ecfdf5, white);
}

.toast-success .toast-icon {
    background: #d1fae5;
    color: #059669;
}

.toast-success .toast-title {
    color: #065f46;
}

.toast-success .toast-progress {
    background: #10b981;
}

/* ========================================
   Toast Variants - Error
   ======================================== */

.toast-error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(to right, #fef2f2, white);
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #dc2626;
}

.toast-error .toast-title {
    color: #991b1b;
}

.toast-error .toast-progress {
    background: #ef4444;
}

/* ========================================
   Toast Variants - Warning
   ======================================== */

.toast-warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(to right, #fffbeb, white);
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #d97706;
}

.toast-warning .toast-title {
    color: #92400e;
}

.toast-warning .toast-progress {
    background: #f59e0b;
}

/* ========================================
   Toast Variants - Info
   ======================================== */

.toast-info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(to right, #eff6ff, white);
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #2563eb;
}

.toast-info .toast-title {
    color: #1e40af;
}

.toast-info .toast-progress {
    background: #3b82f6;
}

/* ========================================
   Accessibility - Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.15s ease;
        transform: none !important;
    }
    
    .toast.toast-visible {
        transform: none !important;
    }
    
    .toast.toast-hiding {
        transform: none !important;
    }
}

/* ========================================
   High Contrast Mode
   ======================================== */

@media (prefers-contrast: high) {
    .toast {
        border-width: 2px;
    }
    
    .toast-success {
        border-color: #047857;
    }
    
    .toast-error {
        border-color: #b91c1c;
    }
    
    .toast-warning {
        border-color: #b45309;
    }
    
    .toast-info {
        border-color: #1d4ed8;
    }
}
