/*
 * Bet Tracker — hand-written stylesheet.
 * No build step (no Node/Vite). Colors and fonts pulled from the live
 * gamblingsociety.com (WP/Blocksy) theme so the app matches the main site:
 *   --gs-blue        #2872fa  (primary / buttons)
 *   --gs-blue-dark    #1559ed  (button hover)
 *   --gs-navy         #192a3d  (dark background)
 *   --gs-slate        #3A4F66  (secondary panels)
 *   --gs-orange       #ec995c  (headings accent)
 *   --gs-link         #3aa3de  (links)
 *   --gs-link-hover   #FFD700  (link hover / gold)
 *   --gs-text-light   #F5F5F5  (body text on dark bg)
 *   --gs-off-white    #FAFBFC  (card background)
 */

:root {
    --gs-blue: #2872fa;
    --gs-blue-dark: #1559ed;
    --gs-navy: #192a3d;
    --gs-slate: #3A4F66;
    --gs-light-gray: #e1e8ed;
    --gs-lighter-gray: #f2f5f7;
    --gs-off-white: #FAFBFC;
    --gs-white: #ffffff;
    --gs-text-light: #F5F5F5;
    --gs-text-dark: #1f2933;
    --gs-link: #3aa3de;
    --gs-link-hover: #FFD700;
    --gs-heading: #ec995c;
    --gs-danger: #d64545;
    --gs-success: #2e9e5b;
    --gs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--gs-font);
    background: var(--gs-navy);
    color: var(--gs-text-light);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--gs-link); text-decoration: none; }
a:hover { color: var(--gs-link-hover); }

h1, h2, h3, h4 { color: var(--gs-heading); font-weight: 600; margin: 0 0 .5em; }

/* ---------- Guest (auth) layout ---------- */

.guest-wrap {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    position: relative;
}

.guest-lang-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.guest-logo { margin-bottom: 1.25rem; }
.guest-logo-img { width: 64px; height: 64px; fill: var(--gs-blue); color: var(--gs-blue); }

.guest-card {
    width: 100%;
    max-width: 420px;
    background: var(--gs-off-white);
    color: var(--gs-text-dark);
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
    padding: 1.75rem 1.75rem 1.5rem;
}

/* ---------- Forms ---------- */

.input-label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gs-slate);
    margin-bottom: .3rem;
}

.field { margin-top: 1rem; }
.field:first-child { margin-top: 0; }

.text-input,
select.text-input,
textarea.text-input {
    display: block;
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--gs-light-gray) !important;
    border-radius: 6px;
    background: var(--gs-white) !important;
    color: var(--gs-text-dark) !important;
    font-size: .95rem;
    font-family: var(--gs-font);
    -webkit-text-fill-color: var(--gs-text-dark);
}

.text-input:focus {
    outline: none;
    border-color: var(--gs-blue);
    box-shadow: 0 0 0 3px rgba(40, 114, 250, .2);
}

.input-error {
    color: var(--gs-danger);
    font-size: .82rem;
    margin-top: .3rem;
}

.auth-status {
    background: rgba(46, 158, 91, .12);
    color: var(--gs-success);
    border: 1px solid rgba(46, 158, 91, .3);
    border-radius: 6px;
    padding: .6rem .8rem;
    font-size: .88rem;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    font-size: .88rem;
    color: var(--gs-slate);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions.align-end { justify-content: flex-end; }

.text-link {
    font-size: .85rem;
    color: var(--gs-slate);
    text-decoration: underline;
}
.text-link:hover { color: var(--gs-blue); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.1rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--gs-font);
    text-decoration: none;
}

.btn-primary { background: var(--gs-blue); color: #fff; }
.btn-primary:hover { background: var(--gs-blue-dark); color: #fff; }

.btn-secondary { background: var(--gs-white); color: var(--gs-slate); border-color: var(--gs-light-gray); }
.btn-secondary:hover { background: var(--gs-lighter-gray); color: var(--gs-slate); }

.btn-danger { background: var(--gs-danger); color: #fff; }
.btn-danger:hover { background: #b93a3a; color: #fff; }

.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-xs { padding: .4rem .8rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Page shell ---------- */

.page-content { padding: 2.5rem 0; }
.content-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.content-wrap-narrow { max-width: 768px; margin: 0 auto; padding: 0 1.5rem; }

.page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.card {
    background: var(--gs-off-white) !important;
    color: var(--gs-text-dark) !important;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
    overflow: hidden;
    display: block;
}
.card-pad { padding: 1.5rem; }

.card .input-label { color: var(--gs-slate); }
.card h2, .card h3 { color: var(--gs-navy); }

.alert-success {
    margin-bottom: 1rem;
    padding: .75rem 1rem;
    border-radius: 6px;
    background: rgba(46, 158, 91, .12);
    color: var(--gs-success);
    border: 1px solid rgba(46, 158, 91, .3);
    font-size: .9rem;
}

.empty-state { padding: 1.5rem; color: var(--gs-slate); }

/* ---------- App sub-nav (dark bar under the WP header) ---------- */

.subnav { background: var(--gs-navy); border-bottom: 1px solid var(--gs-slate); }
.subnav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
}
.subnav-links { display: flex; align-items: center; gap: 1.5rem; }
.subnav-link { font-size: .88rem; font-weight: 500; color: #b9c4d1; }
.subnav-link:hover { color: #fff; }
.subnav-link.active { color: #fff; }
.subnav-actions { display: flex; align-items: center; gap: 1rem; }
.subnav-toggle {
    display: none;
    background: none;
    border: none;
    color: #b9c4d1;
    cursor: pointer;
    padding: .3rem;
}
.subnav-mobile { display: none; border-top: 1px solid var(--gs-slate); padding: .5rem 1.5rem 1rem; }
.subnav-mobile a { display: block; padding: .4rem 0; font-size: .88rem; color: #b9c4d1; }
.subnav-mobile a:hover { color: #fff; }

@media (max-width: 640px) {
    .subnav-links { display: none; }
    .subnav-toggle { display: inline-flex; }
}

/* ---------- Language toggle ---------- */

.lang-toggle { display: flex; align-items: center; gap: .35rem; font-size: .78rem; }
.lang-toggle a { color: #8b98a8; }
.lang-toggle a.active { color: #fff; font-weight: 600; }
.lang-toggle a:hover { color: var(--gs-link-hover); }
.lang-toggle span { color: #4a5a6d; }

.lang-toggle-light a { color: #94a3b8; }
.lang-toggle-light a.active { color: var(--gs-navy); font-weight: 600; }

/* ---------- Dropdown ---------- */

.dropdown { position: relative; }
.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: none;
    border: none;
    color: #b9c4d1;
    font-size: .88rem;
    cursor: pointer;
}
.dropdown-trigger:hover { color: #fff; }
.dropdown-menu {
    position: absolute;
    right: 0;
    margin-top: .5rem;
    min-width: 12rem;
    background: var(--gs-white);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    overflow: hidden;
    z-index: 50;
}
.dropdown-link {
    display: block;
    width: 100%;
    padding: .55rem 1rem;
    font-size: .88rem;
    color: var(--gs-text-dark);
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
}
.dropdown-link:hover { background: var(--gs-lighter-gray); color: var(--gs-text-dark); }

/* ---------- Modal ---------- */

.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 16, 26, .7); z-index: 40; }
.modal-panel {
    position: relative;
    z-index: 50;
    max-width: 32rem;
    margin: 4rem auto;
    background: var(--gs-off-white);
    color: var(--gs-text-dark);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
}
.modal-body { padding: 1.5rem; }

/* ---------- Stat tiles / dashboard ---------- */

.stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats-grid { grid-template-columns: 1fr; } }

.stat-tile { background: var(--gs-off-white) !important; color: var(--gs-text-dark) !important; border-radius: 8px; padding: 1.1rem 1.25rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); display: block; }
.stat-tile-label { font-size: .82rem; color: var(--gs-slate); }
.stat-tile-value { margin-top: .25rem; font-size: 1.5rem; font-weight: 700; color: var(--gs-text-dark); }
.stat-tile-sub { margin-top: .25rem; font-size: .75rem; color: #94a3b8; }

.value-positive { color: var(--gs-success); }
.value-negative { color: var(--gs-danger); }

.filter-row { display: flex !important; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-pill {
    display: inline-block;
    padding: .4rem .9rem;
    font-size: .85rem;
    border-radius: 999px;
    border: 1px solid var(--gs-light-gray);
    background: var(--gs-off-white) !important;
    color: var(--gs-slate) !important;
}
.filter-pill.active { background: var(--gs-navy) !important; color: #fff !important; border-color: var(--gs-navy); }
.filter-pill:hover:not(.active) { background: var(--gs-lighter-gray) !important; }

.tab-row { display: flex !important; gap: .5rem; border-bottom: 1px solid var(--gs-light-gray); margin-bottom: 1rem; }
.tab-pill { display: inline-block; padding: .5rem .75rem; font-size: .85rem; color: var(--gs-slate) !important; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-pill.active { color: var(--gs-blue) !important; border-bottom-color: var(--gs-blue); font-weight: 600; }

/* ---------- Tables ---------- */

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--gs-lighter-gray); }
.data-table th {
    padding: .6rem .9rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--gs-slate);
    border-bottom: 1px solid var(--gs-light-gray);
}
.data-table td {
    padding: .6rem .9rem;
    font-size: .88rem;
    color: var(--gs-text-dark);
    border-bottom: 1px solid #eef1f4;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td.align-right { text-align: right; }

/* ---------- Bet detail / definition list ---------- */

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-item.span-2 { grid-column: span 2; }
@media (max-width: 560px) { .detail-item.span-2 { grid-column: span 1; } }
.detail-item dt { font-size: .8rem; color: var(--gs-slate); margin: 0; }
.detail-item dd { margin: .15rem 0 0; color: var(--gs-text-dark); }

.action-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }

/* ---------- Profile sections ---------- */

.section { margin-bottom: 0; }
.section + .section { margin-top: 1.5rem; }
.section-heading { font-size: 1.05rem; font-weight: 600; color: var(--gs-navy); margin: 0; }
.section-desc { margin-top: .3rem; font-size: .85rem; color: var(--gs-slate); }
.field-stack { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.save-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }
.saved-note { font-size: .85rem; color: var(--gs-slate); }

/* ---------- Form grids (bet form) ---------- */

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.form-row-2:first-child, .form-row-3:first-child { margin-top: 0; }
@media (max-width: 640px) {
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}
textarea.text-input { resize: vertical; }

/* ---------- Landing page ---------- */

.hero {
    max-width: 860px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 2.5rem;
    text-align: center;
}
.hero h1 { font-size: 2.1rem; margin-bottom: .75rem; }
.hero p.lead { font-size: 1.1rem; color: var(--gs-text-light); opacity: .9; max-width: 620px; margin: 0 auto 1.75rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.feature-grid {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1.5rem 4rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 720px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
    background: var(--gs-off-white) !important;
    color: var(--gs-text-dark) !important;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.feature-card h3 { color: var(--gs-navy) !important; font-size: 1.05rem; margin-bottom: .5rem; }
.feature-card p { margin: 0; font-size: .9rem; color: var(--gs-slate); line-height: 1.5; }

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    flex-wrap: wrap;
}
.pagination-links { display: flex; align-items: center; gap: .25rem; }
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .5rem;
    border-radius: 6px;
    font-size: .85rem;
    color: var(--gs-slate) !important;
    border: 1px solid transparent;
}
.pagination-link:hover:not(.disabled):not(.current) { background: var(--gs-lighter-gray) !important; color: var(--gs-text-dark) !important; }
.pagination-link.current { background: var(--gs-blue) !important; color: #fff !important; font-weight: 600; }
.pagination-link.disabled { color: #c3ccd4 !important; cursor: default; }
.pagination-dots { padding: 0 .35rem; color: var(--gs-slate); font-size: .85rem; }
