/**
 * D-SERV DIGITAL CLUB - Toast Notifications System
 * Modern, responsive toast notifications for client-side messages
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
}

/* Toast Notification */
.toast {
    pointer-events: all;
    background: var(--bg-card, rgba(10, 25, 41, 0.98));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: start;
    gap: 1rem;
    position: relative;
    animation: toastSlideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: top right;
    overflow: hidden;
}

/* Toast Icon */
.toast-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary, #fff);
    line-height: 1.4;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 0.375rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary, #94a3b8);
    font-size: 1.25rem;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    transform: rotate(90deg);
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    border-radius: 0 0 0 0.75rem;
    animation: toastProgress linear;
    transform-origin: left;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-success .toast-icon::before {
    content: '✓';
}

.toast-success .toast-progress {
    color: #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-error .toast-icon::before {
    content: '✕';
}

.toast-error .toast-progress {
    color: #ef4444;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-warning .toast-icon::before {
    content: '⚠';
}

.toast-warning .toast-progress {
    color: #f59e0b;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-info .toast-icon::before {
    content: 'ℹ';
}

.toast-info .toast-progress {
    color: #3b82f6;
}

/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

@keyframes toastProgress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

.toast-out {
    animation: toastSlideOut 0.3s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        padding: 1rem;
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .toast-icon {
        font-size: 1.5rem;
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .toast-title {
        font-size: 0.95rem;
    }
    
    .toast-message {
        font-size: 0.875rem;
    }
    
    .toast-close {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 1.1rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .toast {
        animation: none;
    }
    
    .toast-close:hover {
        transform: none;
    }
    
    .toast-out {
        animation: none;
        opacity: 0;
    }
}

/* Dark theme support (already styled for dark, but can be customized) */
@media (prefers-color-scheme: light) {
    .toast {
        background: rgba(255, 255, 255, 0.98);
        border-color: rgba(0, 0, 0, 0.1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    }
    
    .toast-title {
        color: #1e293b;
    }
    
    .toast-message {
        color: #64748b;
    }
    
    .toast-close {
        background: rgba(0, 0, 0, 0.05);
        color: #64748b;
    }
    
    .toast-close:hover {
        background: rgba(0, 0, 0, 0.1);
        color: #1e293b;
    }
}
