/**
 * MODAL SHARED STYLES - Game pages modal overrides
 * Scoped CSS variables, z-index, btn-gradient, modal-divider
 * Used by all game pages (Septica, Tabinet, Video Poker, Table)
 * Now theme-adaptive: uses --color-accent / --color-accent-rgb from game themes
 */

/* ── Global: Disable text selection on UI (mobile long-press fix) ── */
/* Applied site-wide: prevents "Copy/Send/Select all" popup on touch */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}
/* Allow selection on content where users may want to copy text */
p, h1, h2, h3, h4, h5, h6, span, li, td, th,
blockquote, pre, code, article,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
.form-control,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* Modal z-index overrides for game UI */
#unifiedModal, #profileModal { z-index: 10500; }
#profileModal .modal-dialog { max-width: 800px; }

/* === Scoped CSS variables for auth/profile modals === */
/* Uses game theme variables when available, falls back to defaults */
#unifiedModal, #profileModal {
    --primary-color: var(--color-accent, #3b82f6);
    --primary-hover: var(--color-accent, #2563eb);
    --bg-primary: var(--color-bg-primary, #0a0e1a);
    --bg-secondary: var(--color-bg-secondary, #0f172a);
    --bg-tertiary: #1e293b;
    --border-color: #334155;
    --text-primary: var(--color-text-primary, #f8fafc);
    --text-secondary: var(--color-text-secondary, #94a3b8);
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
    /* Accent RGB for rgba() usage */
    --_accent-rgb: var(--color-accent-rgb, 102, 126, 234);
}

/* Light theme modal overrides */
[data-theme="light"] #unifiedModal,
[data-theme="light"] #profileModal {
    --primary-color: var(--color-accent, #3b82f6);
    --primary-hover: var(--color-accent, #2563eb);
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
}

/* .btn-gradient — used by modal login/register/submit buttons */
#unifiedModal .btn-gradient,
#profileModal .btn-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, color-mix(in srgb, var(--primary-color) 70%, #000) 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(var(--_accent-rgb), 0.3), inset 0 1px 0 rgba(255,255,255,0.15);
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
#unifiedModal .btn-gradient::before,
#profileModal .btn-gradient::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}
#unifiedModal .btn-gradient:hover::before,
#profileModal .btn-gradient:hover::before { left: 100%; }
#unifiedModal .btn-gradient:hover,
#profileModal .btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--_accent-rgb), 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.15);
}
#unifiedModal .btn-gradient:active,
#profileModal .btn-gradient:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 6px 20px rgba(var(--_accent-rgb), 0.5), 0 3px 10px rgba(var(--_accent-rgb), 0.4);
}
#unifiedModal .btn-gradient:hover i,
#profileModal .btn-gradient:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* .modal-divider — used between form sections */
#unifiedModal .modal-divider,
#profileModal .modal-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
#unifiedModal .modal-divider::before,
#unifiedModal .modal-divider::after,
#profileModal .modal-divider::before,
#profileModal .modal-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: rgba(var(--_accent-rgb), 0.12);
}
#unifiedModal .modal-divider::before,
#profileModal .modal-divider::before { left: 0; }
#unifiedModal .modal-divider::after,
#profileModal .modal-divider::after { right: 0; }
