/* Exit Modal Styles */
.exit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.exit-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.exit-modal.closing {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.exit-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

.exit-modal.active .exit-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

[data-theme="dark"] .exit-modal.active .exit-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.exit-modal-card {
    max-width: 320px;
    width: 90%;
    border-width: 1px;
    border-color: rgba(219, 234, 254, 1);
    border-radius: 1rem;
    background-color: rgba(255, 255, 255, 1);
    padding: 1.5rem;
    position: relative;
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.95);
    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), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    /* Ensure modal card is not affected by backdrop-filter */
    filter: none;
    backdrop-filter: none;
}

[data-theme="dark"] .exit-modal-card {
    background-color: #1f2937;
    border-color: rgba(75, 85, 99, 0.5);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

.exit-modal.active .exit-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.exit-modal.closing .exit-modal-card {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}

.exit-modal-header {
    display: flex;
    align-items: center;
    grid-gap: 1rem;
    gap: 1rem;
    margin-bottom: 1rem;
}

.exit-modal-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: rgba(239, 68, 68, 1);
    padding: 0.5rem;
    color: rgba(255, 255, 255, 1);
}

.exit-modal-icon svg {
    height: 1.25rem;
    width: 1.25rem;
}

/* Game icon style - oval square like key-stat-icon */
.exit-modal-icon-game {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius, 0.5rem);
    padding: 0.5rem;
}

.exit-modal-icon-game svg {
    width: 20px;
    height: 20px;
}

.exit-modal-alert {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    margin: 0;
    transition: color 0.3s ease;
}

[data-theme="dark"] .exit-modal-alert {
    color: #f9fafb;
}

.exit-modal-message {
    margin-top: 1rem;
    color: var(--text-gray);
    line-height: 1.6;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

[data-theme="dark"] .exit-modal-message {
    color: #d1d5db;
}

[data-theme="dark"] .exit-modal-message span {
    color: #34d399;
}

.exit-modal-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.exit-modal-actions a {
    text-decoration: none;
    display: inline-block;
    border-radius: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 600;
    transition: all 0.15s ease;
    font-family: 'Inter', sans-serif;
}

.exit-modal-confirm {
    background-color: rgba(239, 68, 68, 1);
    color: rgba(255, 255, 255, 1);
}

.exit-modal-confirm:hover {
    background-color: rgba(220, 38, 38, 1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Key Success Modal - Green variant */
#key-success-modal .exit-modal-confirm {
    background-color: rgba(16, 185, 129, 1);
}

#key-success-modal .exit-modal-confirm:hover {
    background-color: rgba(5, 150, 105, 1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.exit-modal-cancel {
    background-color: rgba(249, 250, 251, 1);
    color: var(--text-gray);
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] .exit-modal-cancel {
    background-color: #374151;
    color: #d1d5db;
}

.exit-modal-cancel:hover {
    background-color: rgb(230, 231, 233);
}

[data-theme="dark"] .exit-modal-cancel:hover {
    background-color: #4b5563;
    color: #f9fafb;
}