/* ========================================
   🔔 Cosplay Orbit Toast System
   Design: Neon Glassmorphism
   A11y: High Contrast + Animations
   ======================================== */

.toast-container {
    position: fixed;
    z-index: 9999; /* Highest layer, above modals (1050) and tooltips (1070) */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Allow clicking through container area */
    /* Padding to avoid edge clamping */
    padding: 20px;
    /* Respect reduced motion preference handled in animation definition */
}

/* 🖥️ Desktop Positioning (Default) */
.toast-container {
    top: 20px;
    right: 20px;
    align-items: flex-end; /* Stack to the right */
}

/* 📱 Mobile Positioning */
@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 20px; /* Thumb-friendly zone */
        right: 50%;
        transform: translateX(50%); /* Center horizontally */
        align-items: center;
        width: 100%;
        max-width: 400px; /* Prevent full width stretch on larger mobiles */
    }
}

/* 🍞 Toast Item */
.cosplay-toast {
    position: relative;
    pointer-events: auto; /* Re-enable clicks on the toast itself */
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    padding: 16px;
    border-radius: var(--radius-md, 12px);
    
    /* Glassmorphism Base */
    background: rgba(17, 16, 24, 0.85); /* Fallback / Darker for contrast */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    color: var(--text-primary, #ffffff);
    font-family: var(--font-sans, sans-serif);
    font-size: 0.95rem;
    line-height: 1.5;
    
    /* Animation Initial State */
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
    .cosplay-toast {
        transform: translateY(20px); /* Slide up on mobile */
        width: 90%; /* Better fit on small screens */
        min-width: auto;
    }
}

/* ✨ Animation Active State */
.cosplay-toast.show {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.cosplay-toast.hide {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* 🎨 Variations (Neon Accents) */
.cosplay-toast[data-type="success"] {
    border-left: 4px solid #10b981; /* Emerald 500 */
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(17, 16, 24, 0.9) 100%);
}

.cosplay-toast[data-type="error"] {
    border-left: 4px solid #ef4444; /* Red 500 */
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, rgba(17, 16, 24, 0.9) 100%);
}

.cosplay-toast[data-type="warning"] {
    border-left: 4px solid #f59e0b; /* Amber 500 */
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, rgba(17, 16, 24, 0.9) 100%);
}

.cosplay-toast[data-type="info"] {
    border-left: 4px solid #3b82f6; /* Blue 500 */
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(17, 16, 24, 0.9) 100%);
}

/* 🖼️ Toast Content */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon Colors matched to borders */
.cosplay-toast[data-type="success"] .toast-icon { color: #10b981; }
.cosplay-toast[data-type="error"] .toast-icon { color: #ef4444; }
.cosplay-toast[data-type="warning"] .toast-icon { color: #f59e0b; }
.cosplay-toast[data-type="info"] .toast-icon { color: #3b82f6; }

.toast-message {
    flex-grow: 1;
    word-break: break-word; /* Prevent overflow on long errors */
}

/* ❌ Close Button */
.toast-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 🎢 Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cosplay-toast {
        transition: opacity 0.3s;
        transform: none !important;
    }
}
