/* Simulator Specific Styles overriding/augmenting style.css */
.simulator-body {
    background-color: transparent;
    color: var(--text-black);
}

/* Header */
.sim-header {
    margin-bottom: 2rem;
    border-bottom: 4px solid var(--brutalist-dark);
    padding-bottom: 1rem;
    text-align: center;
}

.sim-header h1 {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1;
    text-transform: uppercase;
    color: var(--pitch-green);
    text-shadow: 4px 4px 0 var(--brutalist-dark);
    margin-top: 1rem;
    letter-spacing: -1px;
    word-wrap: break-word;
}

.sim-header p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-black);
    margin-bottom: 1.5rem;
}

.text-center {
    text-align: center;
}

.team-selector-container {
    margin-top: 2rem;
}

.team-selector-container select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 3px solid var(--pitch-green);
    background-color: var(--brutalist-dark);
    color: var(--text-black);
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--pitch-green);
    transition: all 0.2s;
}

.team-selector-container select:focus {
    outline: none;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--pitch-green);
}

/* Base Top Layout */
.top-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (min-width: 1000px) {
    .top-section {
        grid-template-columns: 2fr 1fr;
    }
}

/* Brutalist Panels */
.panel {
    background: var(--line-white);
    border: 3px solid var(--brutalist-dark);
    box-shadow: 6px 6px 0 var(--brutalist-dark);
    border-radius: 0;
}

.panel-header {
    background-color: var(--brutalist-dark);
    padding: 1rem 1.5rem;
    border-bottom: 3px solid var(--brutalist-dark);
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--pitch-green);
    text-transform: uppercase;
    margin: 0;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    background: #000000;
    /* Pitch black for maximum contrast */
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-family: var(--font-body);
}

th,
td {
    padding: 0.15rem 0.25rem;
    /* Drastic reduction for spreadsheet density */
    border-bottom: 1px solid #1a1a1c;
    /* Very subtle divider, barely visible */
    font-size: 0.85rem;
    /* Tiny data terminal font */
}

th {
    background-color: #0a1f10;
    /* Dark forest green header like competitor */
    color: var(--pitch-light);
    /* Bright green text */
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    /* Micro header font */
    letter-spacing: 0.5px;
    padding: 0.4rem 0.25rem;
}

.text-left {
    text-align: left;
}

.team-cell {
    font-weight: 600;
    /* Less shouty team names */
    text-align: left;
}

.pts-cell {
    font-weight: 900;
    font-size: 1.25rem;
    color: var(--accent-gold);
}

tr.selected-team-row {
    background-color: rgba(34, 197, 94, 0.15);
    /* light pitch green bg */
}

tr.selected-team-row td {
    color: var(--pitch-green);
}

/* Outlook */
.outlook-cards {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.outlook-cards .card {
    background: transparent;
    border: 3px solid var(--brutalist-dark);
    box-shadow: 4px 4px 0 var(--brutalist-dark);
    padding: 1.5rem;
    text-align: center;
    border-radius: 0;
}

.outlook-cards .card h3 {
    font-family: var(--font-heading);
    color: #ccc;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.outlook-value {
    font-family: var(--font-heading);
    font-size: 3rem;
    line-height: 1;
}

.best-card .outlook-value {
    color: var(--pitch-green);
    text-shadow: 2px 2px 0 var(--brutalist-dark);
}

.worst-card .outlook-value {
    color: var(--danger-red);
    text-shadow: 2px 2px 0 var(--brutalist-dark);
}

.probable-card {
    border-color: var(--accent-gold) !important;
    box-shadow: 4px 4px 0 var(--accent-gold) !important;
}

.probable-card .outlook-value {
    color: var(--accent-gold);
    text-shadow: 2px 2px 0 var(--brutalist-dark);
}

/* Matchweeks */
.matchweek-container {
    margin-bottom: 0;
    /* Remove massive gaps between weeks */
    background: transparent;
}

.matchweek-header {
    background: #0a1f10;
    /* Dark forest green strip */
    color: var(--pitch-light);
    /* Bright green text */
    padding: 0.25rem 1rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 1px solid #1a1a1c;
    border-top: 1px solid #1a1a1c;
    letter-spacing: 1px;
}

.matches-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.match-row {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.match-row.is-selected-match {
    background-color: rgba(34, 197, 94, 0.1);
    border-bottom: 2px solid var(--pitch-green);
}

.match-time-tv {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--pitch-green);
    opacity: 0.8;
    margin-bottom: 0.25rem;
    letter-spacing: 1px;
}

/* TV-Style Matches Layout */
.match-teams-tv {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-black);
}

.match-home-tv,
.match-away-tv {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-home-tv {
    text-align: right;
}

.match-away-tv {
    text-align: left;
}

.score-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1rem;
    background: transparent;
    padding: 0;
    border: none;
}

.score-input {
    width: 2rem;
    height: 2rem;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    border: 1px solid #1a1a1c;
    /* Very subtle thin border */
    background: transparent;
    color: var(--pitch-light);
    /* Bright green text for visibility */
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.score-input::-webkit-outer-spin-button,
.score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-input:focus {
    border-color: var(--pitch-green);
    background: rgba(34, 197, 94, 0.1);
}

.score-divider {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--brutalist-dark);
}

/* ═══════════════════════════════════════════════════
   Phase 9: UX Pro Max Refinements
   ═══════════════════════════════════════════════════ */

/* 1. Touch Target Sizing — 44px minimum per Apple/Android HIG */
.score-input {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.2rem;
}

/* 2. Enhanced Focus Ring — visible keyboard navigation */
.score-input:focus {
    border-color: var(--pitch-green);
    background: rgba(34, 197, 94, 0.15);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35);
    outline: none;
}

/* 3. Cursor pointer on all interactive elements */
button,
select,
.score-input,
.cta-button,
[role="button"] {
    cursor: pointer;
}

/* 4. Smooth transitions on interactive table rows */
.match-row {
    transition: background-color 0.2s ease;
}

.match-row:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* 5. Extracted inline styles → semantic classes */

/* Carousel navigation bar */
.carousel-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    background: var(--brutalist-dark);
    padding: 1rem;
    border: 3px solid var(--brutalist-dark);
}

.carousel-bar h3 {
    color: var(--text-black);
    margin: 0;
    font-size: 1.25rem;
    text-transform: uppercase;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

/* Small nav buttons inside carousel */
.btn-nav {
    padding: 0.5rem 1rem;
}

/* Outlined action buttons */
.btn-outline-gold {
    width: 100%;
    max-width: 400px;
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.btn-outline-gold:hover {
    background-color: rgba(229, 193, 0, 0.1);
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--accent-gold);
}

.btn-outline-green {
    width: 100%;
    max-width: 400px;
    border-color: var(--pitch-green);
    color: var(--pitch-green);
}

.btn-outline-green:hover {
    background-color: rgba(110, 231, 183, 0.1);
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--pitch-green);
}

/* Fixtures section heading */
.fixtures-heading {
    font-size: 2rem;
    color: var(--pitch-green);
    text-transform: uppercase;
    margin: 0;
}

/* Action buttons container */
.action-buttons {
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Top section layout override */
.top-section-centered {
    display: flex;
    justify-content: center;
    width: 100%;
}

.table-panel-full {
    width: 100%;
    max-width: 800px;
}

/* Reset button full width */
.btn-reset {
    width: 100%;
    margin-top: 1rem;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .match-row,
    .cta-button,
    .btn-outline-gold,
    .btn-outline-green,
    .score-input {
        transition: none !important;
    }
}

/* Standard appearance property for compatibility */
.team-selector-container select {
    appearance: none;
}

/* ═══════════════════════════════════════════════════
   Position Zone Indicators
   ═══════════════════════════════════════════════════ */

/* Champion — Gold */
tr.zone-champion {
    border-left: 3px solid var(--accent-gold);
    background-color: rgba(229, 193, 0, 0.08);
}
tr.zone-champion td:first-child {
    color: var(--accent-gold);
    font-weight: 900;
}

/* Champions League — Blue */
tr.zone-ucl {
    border-left: 3px solid #3b82f6;
    background-color: rgba(59, 130, 246, 0.06);
}

/* Europa League — Orange */
tr.zone-europa {
    border-left: 3px solid #f97316;
    background-color: rgba(249, 115, 22, 0.06);
}

/* Conference League — Teal */
tr.zone-conference {
    border-left: 3px solid #14b8a6;
    background-color: rgba(20, 184, 166, 0.06);
}

/* Relegation — Red */
tr.zone-relegation {
    border-left: 3px solid var(--danger-red);
    background-color: rgba(211, 47, 47, 0.08);
}

/* Zone cutoff dividers — thicker top border on first row of each new zone */
tr.zone-ucl:first-of-type,
tr.zone-europa,
tr.zone-conference:not(.zone-conference + .zone-conference),
tr.zone-relegation:not(.zone-relegation + .zone-relegation) {
    border-top: 2px solid #333;
}

/* ═══════════════════════════════════════════════════
   Insight Panel — "What Does Your Team Need?"
   ═══════════════════════════════════════════════════ */

.insight-panel {
    margin-top: 2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border-left: 4px solid var(--pitch-green);
}

.insight-body {
    padding: 1.25rem 1.5rem;
    background: #0a0a0c;
}

.insight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .insight-grid {
        grid-template-columns: 1fr;
    }
}

.insight-card {
    background: #151515;
    border: 1px solid #333;
    padding: 1.25rem;
    border-radius: 4px;
}

.insight-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--accent-gold);
    font-size: 1.2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.5rem;
}

.insight-card p {
    margin: 0.5rem 0;
    color: #ccc;
    font-size: 0.95rem;
}

.outlook-card p strong {
    color: var(--text-black);
    background: var(--accent-gold);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 700;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #1a1a1c;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ccc;
}

.insight-item:last-child {
    border-bottom: none;
}

.insight-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.insight-item strong {
    color: var(--text-black);
}

.insight-item .pts-highlight {
    color: var(--accent-gold);
    font-weight: 900;
    font-family: var(--font-heading);
}

.insight-item .pos-highlight {
    font-weight: 700;
}

.pos-champion { color: var(--accent-gold); }
.pos-ucl { color: #3b82f6; }
.pos-europa { color: #f97316; }
.pos-safe { color: var(--pitch-green); }
.pos-danger { color: var(--danger-red); }

.insight-summary {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--text-black);
    padding: 0.75rem 0;
    border-bottom: 2px solid #222;
    margin-bottom: 0.25rem;
}

/* ═══════════════════════════════════════════════════
   Share Button & Toast
   ═══════════════════════════════════════════════════ */

.btn-share {
    width: 100%;
    max-width: 400px;
    border-color: #fff;
    color: #fff;
    letter-spacing: 0.05em;
}

.btn-share:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px #fff;
}

/* Copied toast notification */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--pitch-green);
    color: #000;
    font-family: var(--font-heading);
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border: 3px solid #000;
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Form & AFI Columns ── */
.form-cell {
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
}

.form-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin: 0 1px;
    vertical-align: middle;
}

.form-dot.form-w {
    background-color: #22c55e;
}

.form-dot.form-d {
    background-color: #eab308;
}

.form-dot.form-l {
    background-color: #ef4444;
}

.form-empty {
    color: #555;
    font-size: 0.85rem;
}

.afi-cell {
    white-space: nowrap;
    min-width: 90px;
    text-align: left;
    font-family: var(--font-heading);
}

.afi-score {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ddd;
    min-width: 24px;
    display: inline-block;
    text-align: right;
}

.afi-bar {
    font-size: 0.65rem;
    letter-spacing: -1px;
    vertical-align: middle;
}

.afi-bar.afi-high {
    color: #22c55e;
}

.afi-bar.afi-mid {
    color: #eab308;
}

.afi-bar.afi-low {
    color: #ef4444;
}

/* Hide form columns on very narrow screens */
@media (max-width: 680px) {
    .form-cell,
    .afi-cell,
    #league-table thead th:nth-child(11),
    #league-table thead th:nth-child(12) {
        display: none;
    }
}

/* --- SITE FOOTER --- */
.sim-footer {
    background: var(--brutalist-dark);
    border-top: 4px solid var(--accent-gold);
    margin-top: 4rem;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    padding: 3rem 5%;
    border-bottom: 2px solid rgba(229, 193, 0, 0.2);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    text-transform: uppercase;
    color: var(--text-black);
    text-shadow: 2px 2px 0 var(--accent-gold);
    display: block;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    text-decoration: none;
}

.footer-logo span {
    color: var(--pitch-green);
    text-shadow: none;
}

.footer-tagline {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-copy {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--accent-gold);
    letter-spacing: 2px;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-gold);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    padding: 0;
}

.footer-col ul li a {
    font-size: 0.9rem;
    color: #aaa;
    text-decoration: none;
    transition: color 0.15s, padding-left 0.15s;
    display: block;
}

.footer-col ul li a:hover {
    color: var(--pitch-green);
    padding-left: 4px;
}

.footer-bottom {
    padding: 1.2rem 5%;
    text-align: center;
    font-size: 0.8rem;
    color: #444;
    font-style: italic;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }
}