/* ============================================
   Shared Multiplayer Styles
   Toast Notifications, Confirm Dialogs, Animations
   ============================================ */

/* --- Keyframe Animations --- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0); }
    50% { box-shadow: 0 0 20px 4px rgba(102, 126, 234, 0.3); }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.5);
    }
}

/* --- Toast Notifications --- */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 48px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(30, 30, 50, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    line-height: 1.4;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: none;
}

.toast-visible {
    animation: slideInRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast-dismissing {
    animation: slideOutRight 0.25s ease-in forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-message {
    flex: 1;
    min-width: 0;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: white;
}

/* Toast type accents */
.toast-success {
    border-left: 4px solid #48bb78;
}
.toast-success .toast-icon { color: #48bb78; }

.toast-error {
    border-left: 4px solid #f56565;
}
.toast-error .toast-icon { color: #f56565; }

.toast-warning {
    border-left: 4px solid #ecc94b;
}
.toast-warning .toast-icon { color: #ecc94b; }

.toast-info {
    border-left: 4px solid #667eea;
}
.toast-info .toast-icon { color: #667eea; }

/* --- Confirm Dialog --- */

.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s;
}

.confirm-visible {
    background: rgba(0, 0, 0, 0.6);
}

.confirm-visible .confirm-modal {
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.confirm-dismissing {
    animation: fadeOut 0.2s ease-out forwards;
}

.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    background: linear-gradient(145deg, #1e1e3a, #2a2a4a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    max-width: 400px;
    width: calc(100% - 40px);
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-icon svg {
    width: 28px;
    height: 28px;
}

.confirm-icon-danger {
    background: rgba(245, 101, 101, 0.15);
    color: #f56565;
}

.confirm-icon-warning {
    background: rgba(236, 201, 75, 0.15);
    color: #ecc94b;
}

.confirm-icon-info {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.confirm-message {
    color: #e2e8f0;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-buttons button {
    padding: 10px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #a0aec0;
}

.confirm-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.3);
}

.confirm-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 101, 101, 0.5);
}

.confirm-btn-warning {
    background: linear-gradient(135deg, #ecc94b, #d69e2e);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(236, 201, 75, 0.3);
}

.confirm-btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(236, 201, 75, 0.5);
}

.confirm-btn-info {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.confirm-btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

/* --- Mobile adjustments --- */

@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
    }

    .confirm-modal {
        padding: 24px;
    }

    .confirm-buttons {
        flex-direction: column-reverse;
    }

    .confirm-buttons button {
        width: 100%;
    }
}
