/* ==========================================================================
   Match Tracker — Design Tokens
   Theme: "Pitch & Scoreboard" — deep turf green, stadium-gold accent,
   cobalt Team A / coral Team B, set on a soft mint-cream background.
   ========================================================================== */
:root {
    --pitch: #0f1724;
    --pitch-dark: #0a0f1a;
    --pitch-light: #153047;
    --gold: #F2B705;
    --team-a: #2667FF; /* blue */
    --team-b: #FF3B30; /* red */
    --winner: #22C55E; /* green */
    --draw: #FF9F1C; /* orange */
    --bg: #f5f7fb;
    --card: #FFFFFF;
    --ink: #17241F;
    --muted: #6B7A72;
    --radius-lg: 1.25rem;
    --radius-md: 0.9rem;
    --shadow-soft: 0 10px 30px -12px rgba(16, 36, 26, 0.18);
    --shadow-tap: 0 4px 14px -6px rgba(16, 36, 26, 0.25);
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', system-ui, sans-serif;
    padding-bottom: 76px; /* room for mobile tab bar */
}

.display-font {
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ===================== NAVBAR ===================== */
.app-navbar {
    background: var(--pitch);
    padding: 0.85rem 0;
    box-shadow: var(--shadow-soft);
}
.app-navbar .navbar-brand {
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
}
.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    padding: 0.5rem 1rem !important;
    border-radius: 0.6rem;
    transition: 0.15s ease;
}
.app-navbar .nav-link i { margin-right: 0.35rem; }
.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: var(--pitch-dark);
    background: var(--gold);
}
.navbar-toggler { border: none; box-shadow: none !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.9)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===================== MOBILE TAB BAR ===================== */
.mobile-tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    display: flex;
    background: #fff;
    border-top: 1px solid rgba(16, 36, 26, 0.08);
    box-shadow: 0 -6px 20px -10px rgba(16,36,26,0.2);
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom);
}
.mobile-tabbar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.55rem 0 0.5rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
}
.mobile-tabbar .tab-item i { font-size: 1.15rem; }
.mobile-tabbar .tab-item.active { color: var(--pitch); }

/* ===================== STAT CARDS ===================== */
.stat-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem 1.1rem;
    height: 100%;
    border: 1px solid rgba(16, 36, 26, 0.05);
}
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
}
.stat-card .stat-value {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    line-height: 1;
}
.stat-card .stat-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.icon-bg-a { background: rgba(38, 103, 255, 0.12); color: var(--team-a); }
.icon-bg-b { background: rgba(255, 93, 93, 0.12); color: var(--team-b); }
.icon-bg-gold { background: rgba(242, 183, 5, 0.16); color: #B58600; }
.icon-bg-pitch { background: rgba(27, 67, 50, 0.1); color: var(--pitch); }

/* ===================== SCOREBOARD (signature element) ===================== */
.scoreboard {
    background: linear-gradient(160deg, var(--pitch) 0%, var(--pitch-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    color: #fff;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

/* ===================== HERO SCOREBOARD ===================== */
.hero-scoreboard { background: transparent; }
.hero-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.hero-team { flex:1; }
.team-logo { width:96px; height:96px; border-radius:999px; object-fit:cover; display:block; margin:0 auto 0.5rem; box-shadow: var(--shadow-tap); border: 4px solid rgba(255,255,255,0.06); }
.team-name { font-weight:700; font-family: 'Rajdhani', sans-serif; font-size:1rem; color:var(--pitch); }
.team-total { font-size:2.8rem; color:var(--ink); margin-top:0.25rem; }
.hero-vs { width:86px; text-align:center; }
.hero-vs .vs-label { font-family: 'Rajdhani', sans-serif; font-size:1.2rem; color:var(--muted); }
.hero-vs .vs-sub { font-size:0.8rem; color:var(--muted); }

/* Latest match card */
.latest-card .mini-logo { width:42px; height:42px; border-radius:999px; }
.latest-card .match-score { font-size:1.6rem; }

/* Match history cards */
.match-card { border-radius: 1rem; box-shadow: var(--shadow-soft); display:block; }
.match-card .mini-logo { width:44px; height:44px; border-radius:999px; }

/* Team logo preview in settings */
.team-logo-preview { width:72px; height:72px; border-radius:999px; margin-top:0.5rem; }

/* animated fade-in for cards */
.app-card, .match-card, .latest-card { animation: fadeInUp 420ms ease both; }
@keyframes fadeInUp { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0);} }

/* small tweaks for mobile first */
@media (max-width: 575.98px) {
    .hero-row { flex-direction: column; text-align:center; }
    .hero-vs { margin: 0.5rem 0; }
    .team-logo { width:84px; height:84px; }
}
.scoreboard::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 2px, transparent 2px 24px);
    pointer-events: none;
}
.scoreboard .sb-label {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--gold);
    font-weight: 700;
}
.scoreboard .sb-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}
.scoreboard .sb-team {
    flex: 1;
    text-align: center;
}
.scoreboard .sb-team-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}
.scoreboard .sb-score {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 3.2rem;
    line-height: 1;
    background: rgba(255,255,255,0.08);
    border-radius: 0.7rem;
    padding: 0.3rem 0;
}
.scoreboard .sb-vs {
    font-family: 'Rajdhani', sans-serif;
    color: var(--gold);
    font-weight: 700;
    font-size: 1rem;
    opacity: 0.85;
}
.scoreboard .sb-date {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
}

/* ===================== BADGES ===================== */
.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.8rem;
    white-space: nowrap;
}
.badge-team-a { background: rgba(38, 103, 255, 0.12); color: var(--team-a); }
.badge-team-b { background: rgba(255, 93, 93, 0.12); color: var(--team-b); }
.badge-draw { background: rgba(242, 183, 5, 0.18); color: #8a6800; }

/* ===================== CARDS / FORMS (Add & Edit Match) ===================== */
.app-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: none;
}
.section-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--pitch);
}
.form-label { font-weight: 600; color: var(--ink); }
.form-control, .form-select {
    border-radius: var(--radius-md);
    padding: 0.8rem 1rem;
    font-size: 1.05rem;
    border: 1.5px solid rgba(16, 36, 26, 0.12);
}
.form-control:focus, .form-select:focus {
    border-color: var(--pitch-light);
    box-shadow: 0 0 0 0.2rem rgba(45, 106, 79, 0.18);
}
.score-input {
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
}

/* Big touch-friendly buttons */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.75rem 1.4rem;
}
.btn-lg-touch { padding: 0.95rem 1.4rem; font-size: 1.05rem; }
.btn-pitch { background: var(--pitch); border-color: var(--pitch); color: #fff; box-shadow: var(--shadow-tap); }
.btn-pitch:hover { background: var(--pitch-light); border-color: var(--pitch-light); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--pitch-dark); box-shadow: var(--shadow-tap); }
.btn-gold:hover { background: #d9a300; border-color: #d9a300; color: var(--pitch-dark); }
.btn-outline-pitch { border: 1.5px solid var(--pitch); color: var(--pitch); background: transparent; }
.btn-outline-pitch:hover { background: var(--pitch); color: #fff; }

/* ===================== HISTORY TABLE ===================== */
.history-table-wrap {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.history-table { margin-bottom: 0; }
.history-table thead th {
    background: var(--pitch);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: none;
    padding: 0.9rem 1rem;
}
.history-table tbody td {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    font-weight: 500;
}
.history-table tbody tr:hover { background: rgba(27, 67, 50, 0.035); }
.score-pill {
    display: inline-block;
    min-width: 2.1rem;
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
}

.filter-pill {
    border-radius: 999px;
    border: 1.5px solid rgba(16, 36, 26, 0.15);
    background: #fff;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}
.filter-pill.active {
    background: var(--pitch);
    border-color: var(--pitch);
    color: #fff;
}

/* ===================== TOASTS ===================== */
.toast { border-radius: var(--radius-md); color: #fff; min-width: 260px; }
.toast-success { background: var(--pitch); }
.toast-error { background: var(--team-b); }

/* ===================== MISC ===================== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: var(--pitch-light); margin-bottom: 0.75rem; }

@media (max-width: 575.98px) {
    .scoreboard .sb-score { font-size: 2.4rem; }
    .stat-card .stat-value { font-size: 1.6rem; }
}

/* Ensure stats doughnuts stay a reasonable fixed size */
.stats-donuts canvas { max-width: 220px; max-height: 220px; width: 140px !important; height: 140px !important; }

/* Constrain pagination SVG icons (Laravel's Tailwind pagination uses svg icons) */
nav[role="navigation"] svg { width: 1.25rem !important; height: 1.25rem !important; }
