/*
 * SOUTHLAND CASINO
 * Pure Modern CSS - Zero Bootstrap
 * Built with CSS Grid, Flexbox, Custom Properties
 */

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #fff;
    background: #0a0a0a;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; }
input, select, textarea { font: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Backgrounds (warm-neutral near-black) */
    --bg-base: #0b0a0a;
    --bg-surface: #141112;
    --bg-elevated: #1c1718;
    --bg-hover: #261f20;

    /* Borders */
    --border-subtle: #241d1e;
    --border-default: #322829;
    --border-strong: #443637;

    /* Wind Creek Red — primary brand */
    --red-brand: #a42a29;      /* exact logo red */
    --red: #c8322f;            /* brightened for interactive elements on dark */
    --red-light: #e0453f;
    --red-dark: #7d1f1e;
    --red-soft: rgba(200,50,47,0.15);
    --red-glow: rgba(200,50,47,0.28);

    /* Accent highlight — Wind Creek is red/black/white, NO gold.
       These legacy --gold* names are kept for compatibility but map to red/white. */
    --gold: var(--red-light);
    --gold-light: #ffffff;
    --gold-dark: var(--red-dark);
    --gold-soft: var(--red-soft);

    /* Text */
    --text-primary: #fff;
    --text-secondary: #b3a9aa;
    --text-muted: #7d7273;
    --text-inverse: #140f10;

    /* Status */
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px var(--red-glow);
    --shadow-glow-gold: 0 0 30px rgba(212,175,55,0.22);
    
    /* Layout */
    --container-width: 1280px;
    --header-height: 64px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
/* Fonts are loaded via <link> in top_scripts.php (@import here would be ignored,
   since it follows other rules). Inter = body, Outfit = display/headings. */

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { color: var(--text-secondary); }

.text-gold {
    color: var(--gold);
}

.text-muted {
    color: var(--text-muted);
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
    padding: var(--space-xl) 0;
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ========================================
   HEADER
   ======================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #F4EFE7;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--red-light);
}

/* Mobile Menu */
.menu-btn {
    display: none;
    padding: var(--space-sm);
    background: none;
    border: none;
    color: var(--text-primary);
}

.menu-btn svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .nav {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-default);
        padding: var(--space-md);
    }
    
    .nav.open {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        padding: var(--space-md);
    }
    
    .menu-btn {
        display: block;
    }
}

/* ========================================
   HERO
   ======================================== */
.hero {
    padding: var(--space-3xl) 0;
    text-align: center;
    background:
        radial-gradient(ellipse at 50% -20%, rgba(164,42,41,0.35) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
    border-bottom: 1px solid var(--border-subtle);
}

.hero h1 {
    margin-bottom: var(--space-md);
    background: linear-gradient(100deg, #fff 25%, var(--red-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
}

.card:hover {
    border-color: var(--red);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

/* Contest Card */
.contest-card .card-body {
    text-align: center;
}

.league-tag {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    background: var(--red-soft);
    border: 1px solid var(--red);
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--red-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.matchup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin: var(--space-md) 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.matchup .team { display: block; }

.matchup .vs {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.game-time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin: var(--space-lg) 0;
}

.countdown-box {
    min-width: 50px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-hover);
    border: 1px solid rgba(200,50,47,0.3);
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: 0 0 14px rgba(200,50,47,0.12);
}

.countdown-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.countdown-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--red-light) 0%, var(--red) 100%);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

.btn-success {
    background: var(--success);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8125rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TABLES
   ======================================== */
.table-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table {
    width: 100%;
}

.table th {
    padding: var(--space-md);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cfc7c7;
    background: var(--bg-surface);
    text-align: left;
    border-bottom: 1px solid var(--border-default);
}

.table td {
    padding: var(--space-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table a {
    color: var(--red-light);
    font-weight: 500;
}

.table a:hover {
    color: var(--gold);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: var(--radius-sm);
}

.badge-gold {
    background: var(--gold-soft);
    color: var(--gold);
}

.badge-success {
    background: rgba(34,197,94,0.15);
    color: var(--success);
}

.badge-error {
    background: rgba(239,68,68,0.15);
    color: var(--error);
}

.badge-info {
    background: rgba(59,130,246,0.15);
    color: var(--info);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: var(--space-lg);
}

.alert-success {
    background: rgba(34,197,94,0.1);
    border: 1px solid rgba(34,197,94,0.2);
    color: var(--success);
}

.alert-error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--error);
}

.alert-warning {
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.2);
    color: var(--warning);
}

.alert-info {
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    color: var(--info);
}

/* ========================================
   SECTION
   ======================================== */
.section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.25rem;
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: radial-gradient(ellipse at 50% 0%, rgba(164,42,41,0.18) 0%, transparent 55%),
                var(--bg-base);
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.auth-header {
    padding: var(--space-xl);
    text-align: center;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.auth-header p {
    font-size: 0.9375rem;
    margin: 0;
}

.auth-body {
    padding: var(--space-xl);
}

.auth-footer {
    padding: var(--space-md) var(--space-xl);
    text-align: center;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--red-light);
    font-weight: 500;
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    margin-top: auto;
    padding: var(--space-xl) 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--red-light);
}

.footer-copy {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ========================================
   ADMIN DASHBOARD
   ======================================== */
.dash-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.dash-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.dash-subtitle {
    color: var(--text-secondary);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.gold {
    color: #fff;
}

/* ========================================
   MODALS
   ======================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 2rem);
    max-width: 500px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    z-index: 201;
    overflow: hidden;
}

.modal-header {
    padding: var(--space-lg);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    padding: var(--space-xs);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ========================================
   DROPDOWN
   ======================================== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    padding: var(--space-sm) 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: var(--transition-fast);
    z-index: 50;
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--red-light);
}

.dropdown-divider {
    height: 1px;
    margin: var(--space-sm) 0;
    background: var(--border-subtle);
}

/* ========================================
   SQUARES GRID
   ======================================== */
.squares-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    overflow-x: auto;
}

.squares-grid {
    display: grid;
    grid-template-columns: repeat(11, minmax(36px, 1fr));
    gap: 2px;
}

.square {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.square:hover:not(.square-header):not(.square-taken) {
    background: var(--red);
    color: #fff;
    transform: scale(1.1);
    z-index: 1;
}

.square-header {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    cursor: default;
}

.square-taken {
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: not-allowed;
}

.square-mine {
    background: var(--success);
    color: var(--text-inverse);
}

.square-winner {
    background: #fff;
    color: var(--red-dark);
    font-weight: 800;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
    50% { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}

/* ========================================
   BETSLIP
   ======================================== */
.betslip {
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg-elevated);
    border: 2px solid var(--red);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-glow);
}

.betslip-header {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    text-align: center;
}

.betslip-body {
    padding: var(--space-lg);
    text-align: center;
}

.betslip-qr {
    display: inline-block;
    padding: var(--space-md);
    background: #fff;
    border-radius: var(--radius-md);
    margin: var(--space-md) 0;
}

.betslip-qr img {
    width: 150px;
    height: 150px;
}

.betslip-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-md);
}

/* ========================================
   PICK'EM
   ======================================== */
.pickem-game {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.pickem-info {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
}

.pickem-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.pickem-team {
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.pickem-team:hover {
    background: var(--bg-hover);
}

.pickem-team.selected {
    background: var(--red-soft);
    border-color: var(--red);
}

.pickem-team-name {
    font-weight: 600;
    margin-top: var(--space-sm);
}

.pickem-vs {
    padding: var(--space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ========================================
   UTILITIES
   ======================================== */
.hidden { display: none !important; }
.block { display: block; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--red);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    padding: var(--space-3xl);
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.empty-state h3 {
    margin-bottom: var(--space-sm);
}

/* ========================================
   PANEL (for legacy compatibility)
   ======================================== */
.panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-heading {
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
}

.panel-body {
    padding: var(--space-lg);
}

/* ========================================
   RESPONSIVE TABLE
   ======================================== */
@media (max-width: 768px) {
    .table-wrap {
        overflow-x: auto;
    }
    
    .table {
        min-width: 600px;
    }
}

/* ========================================
   BOOTSTRAP GRID COMPATIBILITY LAYER
   (For admin pages that still use col-* classes)
   ======================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

[class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    width: 100%;
}

/* XS (mobile-first default) */
.col-xs-1 { width: 8.333%; }
.col-xs-2 { width: 16.667%; }
.col-xs-3 { width: 25%; }
.col-xs-4 { width: 33.333%; }
.col-xs-5 { width: 41.667%; }
.col-xs-6 { width: 50%; }
.col-xs-7 { width: 58.333%; }
.col-xs-8 { width: 66.667%; }
.col-xs-9 { width: 75%; }
.col-xs-10 { width: 83.333%; }
.col-xs-11 { width: 91.667%; }
.col-xs-12 { width: 100%; }

/* SM (≥576px) */
@media (min-width: 576px) {
    .col-sm-1 { width: 8.333%; }
    .col-sm-2 { width: 16.667%; }
    .col-sm-3 { width: 25%; }
    .col-sm-4 { width: 33.333%; }
    .col-sm-5 { width: 41.667%; }
    .col-sm-6 { width: 50%; }
    .col-sm-7 { width: 58.333%; }
    .col-sm-8 { width: 66.667%; }
    .col-sm-9 { width: 75%; }
    .col-sm-10 { width: 83.333%; }
    .col-sm-11 { width: 91.667%; }
    .col-sm-12 { width: 100%; }
}

/* MD (≥768px) */
@media (min-width: 768px) {
    .col-md-1 { width: 8.333%; }
    .col-md-2 { width: 16.667%; }
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333%; }
    .col-md-5 { width: 41.667%; }
    .col-md-6 { width: 50%; }
    .col-md-7 { width: 58.333%; }
    .col-md-8 { width: 66.667%; }
    .col-md-9 { width: 75%; }
    .col-md-10 { width: 83.333%; }
    .col-md-11 { width: 91.667%; }
    .col-md-12 { width: 100%; }
}

/* LG (≥992px) */
@media (min-width: 992px) {
    .col-lg-1 { width: 8.333%; }
    .col-lg-2 { width: 16.667%; }
    .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.333%; }
    .col-lg-5 { width: 41.667%; }
    .col-lg-6 { width: 50%; }
    .col-lg-7 { width: 58.333%; }
    .col-lg-8 { width: 66.667%; }
    .col-lg-9 { width: 75%; }
    .col-lg-10 { width: 83.333%; }
    .col-lg-11 { width: 91.667%; }
    .col-lg-12 { width: 100%; }
    .col-lg-offset-1 { margin-left: 8.333%; }
    .col-lg-offset-2 { margin-left: 16.667%; }
}

/* XL (≥1200px) */
@media (min-width: 1200px) {
    .col-xl-1 { width: 8.333%; }
    .col-xl-2 { width: 16.667%; }
    .col-xl-3 { width: 25%; }
    .col-xl-4 { width: 33.333%; }
    .col-xl-5 { width: 41.667%; }
    .col-xl-6 { width: 50%; }
    .col-xl-7 { width: 58.333%; }
    .col-xl-8 { width: 66.667%; }
    .col-xl-9 { width: 75%; }
    .col-xl-10 { width: 83.333%; }
    .col-xl-11 { width: 91.667%; }
    .col-xl-12 { width: 100%; }
}

/* Bootstrap utility classes used in admin */
.container-fluid {
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 2px var(--red-soft);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--text-secondary);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Panel styles for admin */
.panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.panel-heading {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-default);
    font-weight: 600;
}

.panel-body {
    padding: 1.25rem;
}

.panel-title {
    margin: 0;
    font-size: 1rem;
}

/* Well (box) */
.well {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* Hidden utility */
.hidden { display: none !important; }
.show { display: block !important; }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Pull left/right (legacy) */
.pull-left { float: left; }
.pull-right { float: right; }
.clearfix::after { content: ""; display: table; clear: both; }

/* ============================================================
   WIND CREEK — MODERN LAYER  (Stake-inspired · red/black/white)
   Matte surfaces, bold type, vibrant red, soft depth,
   neon-edge hover. No glass. No gold.
   ============================================================ */
:root{
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --ease: cubic-bezier(.2,.7,.2,1);
    --ring-red: 0 0 0 1px rgba(224,69,63,.55), 0 8px 30px rgba(200,50,47,.22);
}

body{
    background:
        radial-gradient(60rem 30rem at 50% -8rem, rgba(164,42,41,.16), transparent 70%),
        var(--bg-base);
    background-attachment: fixed;
    letter-spacing: .01em;
}

/* Header */
.header{ border-bottom: 1px solid var(--border-default); }
.logo img, .logo-img{ height: 40px; transition: transform .3s var(--ease); }
.logo:hover img, .logo:hover .logo-img{ transform: scale(1.03); }
.nav-link{ position: relative; font-weight: 600; }
.nav-link::after{ content:""; position:absolute; left:12px; right:12px; bottom:8px; height:2px; border-radius:2px; background:var(--red); transform:scaleX(0); transform-origin:left; transition:transform .28s var(--ease); }
.nav-link:hover::after, .nav-link.active::after{ transform:scaleX(1); }
.nav-link.active{ color:#fff; }

/* Hero */
.hero{ padding: 5.5rem 0 4.5rem; }
.hero h1{ font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -.02em; }
.hero p{ font-size: 1.15rem; }

/* Section titles */
.section-title{ font-weight: 800; letter-spacing: -.01em; }

/* Cards — borderless-feel, soft depth, neon-edge lift */
.card{
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: var(--bg-elevated);
    box-shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px rgba(0,0,0,.35);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover{
    transform: translateY(-6px);
    border-color: rgba(224,69,63,.6);
    box-shadow: var(--ring-red), 0 18px 44px rgba(0,0,0,.5);
}
.card-header{ font-weight: 700; letter-spacing: .06em; }

/* Buttons — bold, rounded, vibrant, hover lift + glow */
.btn{ border-radius: 12px; font-weight: 700; letter-spacing:.01em; transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease); }
.btn-lg{ padding: 1rem 2rem; font-size: 1.02rem; }
.btn-primary{ background: var(--red); color:#fff; box-shadow: 0 6px 18px rgba(164,42,41,.4); }
.btn-primary:hover{ background: var(--red-light); box-shadow: 0 10px 28px rgba(224,69,63,.5); transform: translateY(-2px); }
.btn-primary:active{ transform: translateY(0) scale(.98); }
.btn-secondary:hover{ border-color: var(--red); color:#fff; }

/* Tags / badges — pills */
.league-tag{ border-radius: 100px; font-weight: 700; background: var(--red-soft); border: 1px solid rgba(224,69,63,.5); color:#fff; }
.badge{ border-radius: 100px; font-weight: 700; }

/* Inputs */
.form-input, .form-select, .form-textarea, .form-control{ border-radius: 12px; }

/* Stat cards */
.stat-card{ border-radius: 14px; position: relative; overflow: hidden; transition: transform .25s var(--ease), border-color .25s; }
.stat-card::before{ content:""; position:absolute; top:0; left:0; right:0; height:3px; background: var(--red); }
.stat-card:hover{ transform: translateY(-3px); border-color: var(--border-strong); }

/* Table rows */
.table tbody tr{ transition: background .18s var(--ease); }
.table tbody tr:hover{ background: linear-gradient(90deg, rgba(200,50,47,.10), transparent); }

/* Squares */
.square{ border-radius: 6px; }
.square:hover:not(.square-header):not(.square-taken){ box-shadow: 0 0 14px rgba(224,69,63,.55); }

/* Betslip */
.betslip{ box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 0 1px rgba(224,69,63,.35); }

/* Legacy Mobirise sections — breathing room + consistent typography
   (admin add/edit pages, scan, odds, schedule, static pages) */
.mbr-section.first { padding-top: 2.75rem; }
.mbr-section { padding-bottom: 2.5rem; }

.section_title_wrapper h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -.01em;
    margin: 0 0 1.75rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--border-default);
}

.section_content_wrapper { margin-top: .25rem; }

/* Legacy forms: space the rows, soften the labels */
.mbr-section .form-group { margin-bottom: 1.4rem; }
.mbr-section .form-group label {
    display: inline-block;
    margin-bottom: .45rem;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Bare <select> elements on legacy pages (no .form-control class) */
.mbr-section select:not(.form-control) {
    display: block;
    min-width: 220px;
    padding: .625rem .875rem;
    font-size: .9375rem;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    cursor: pointer;
}
.mbr-section select:not(.form-control):focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}

/* Entrance motion */
@media (prefers-reduced-motion: no-preference){
    @keyframes rise{ from{ opacity:0; transform: translateY(14px);} to{ opacity:1; transform:none; } }
    .card, .stat-card{ animation: rise .45s var(--ease) both; }
    .grid .card:nth-child(2){ animation-delay:.05s; }
    .grid .card:nth-child(3){ animation-delay:.1s; }
    .grid .card:nth-child(4){ animation-delay:.15s; }
    .grid .card:nth-child(5){ animation-delay:.2s; }
    .grid .card:nth-child(6){ animation-delay:.25s; }
}
