/**
 * Toast Notifications
 * - Mobile-first design
 * - Responsive positioning
 * - Auto-dismiss or click to dismiss
 * - Smooth animations
 */

.game-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 14px 20px;
    background: rgba(20, 20, 30, 0.95);
    color: #fff;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 10000;
    max-width: calc(100vw - 32px);
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    
    /* Animation */
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Mobile: bottom positioning */
    bottom: 80px; /* Above bottom nav */
}

.game-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Click hint (optional visual) */
.game-toast::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(124, 92, 219, 0.3), rgba(99, 102, 241, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-toast:hover::after {
    opacity: 1;
}

/* Success toast */
.game-toast--success {
    background: rgba(16, 185, 129, 0.95);
    color: #fff;
}

/* Error toast */
.game-toast--error {
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
}

/* Warning toast */
.game-toast--warning {
    background: rgba(245, 158, 11, 0.95);
    color: #fff;
}

/* Info toast */
.game-toast--info {
    background: rgba(59, 130, 246, 0.95);
    color: #fff;
}

/* Desktop adjustments */
@media (min-width: 768px) {
    .game-toast {
        bottom: 24px;
        font-size: 14px;
        padding: 12px 18px;
        max-width: 400px;
    }
}

/* Desktop with sidebar */
@media (min-width: 1024px) {
    .game-toast {
        /* Center in viewport (accounting for sidebar) */
        left: calc(50% + 140px); /* Half of sidebar width offset */
        bottom: 24px;
    }
    
    /* If sidebar is collapsed, center normally */
    body.sidebar-collapsed .game-toast {
        left: 50%;
    }
}

/* Multiple toasts stacking */
.game-toast:nth-child(n+2) {
    margin-bottom: 8px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .game-toast {
        transition: opacity 0.1s linear;
    }
    
    .game-toast--visible {
        transform: translateX(-50%) translateY(0);
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .game-toast {
        background: rgba(30, 30, 40, 0.95);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.3);
    }
}

/* Accessibility */
.game-toast[role="alert"] {
    /* Already handled by role="alert" for screen readers */
}

/* Touch feedback */
.game-toast:active {
    transform: translateX(-50%) translateY(0) scale(0.98);
}

