/* ==========================================================================
   DESIGN TOKENS & SYSTEM VARIABLES
   ========================================================================== */
:root {
    --bg-primary: #070a13;
    --bg-secondary: #0f1524;
    --bg-sidebar: #0a0d18;
    --card-bg: rgba(15, 21, 36, 0.6);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-focus: rgba(16, 185, 129, 0.4);
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #475569;
    
    /* Accent Colors */
    --color-football: #10b981;       /* Emerald/Green */
    --color-football-glow: rgba(16, 185, 129, 0.2);
    --color-baseball: #3b82f6;       /* Blue */
    --color-baseball-glow: rgba(59, 130, 246, 0.2);
    --color-danger: #ef4444;         /* Red/Crimson */
    --color-danger-glow: rgba(239, 68, 68, 0.2);
    --color-warning: #f59e0b;        /* Amber */
    
    /* Layout Variables */
    --sidebar-width: 260px;
    --header-height: 80px;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   GLOBAL RESET & FONTS
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

/* Scrollbar customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    padding: 24px 16px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 32px 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-football), var(--color-baseball));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.logo-text h1 {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    line-height: 1.1;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 700;
}

/* Navigation items */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--border-radius-md);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-normal);
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(to right, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.02));
    border-left: 3px solid var(--color-football);
    padding-left: 13px; /* Compensate border width */
}

/* If baseball theme selected, we can style dynamically */
.baseball-theme .nav-item.active {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.02));
    border-left-color: var(--color-baseball);
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition-normal);
    width: 100%;
}

.btn-nas {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-nas:hover {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-football), #0ea5e9);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.copyright {
    font-size: 0.7rem;
    color: var(--text-dark);
    text-align: center;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   TOPBAR & STATUS INDICATORS
   ========================================================================== */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.topbar-title-section h2 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.topbar-title-section p {
    font-size: 0.9rem;
    margin-top: 4px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-bar {
    position: relative;
    width: 280px;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-bar input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 10px 16px 10px 42px;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    transition: var(--transition-normal);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--color-football);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 8px 14px;
    border-radius: 30px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-football);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.8s infinite;
}

.status-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--color-football);
}

/* ==========================================================================
   MATCH TICKER (TOP HORIZONTAL RIBBON)
   ========================================================================== */
.match-ticker {
    background-color: rgba(15, 21, 36, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px;
    overflow: hidden;
}

.ticker-wrapper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.ticker-wrapper::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.ticker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    min-width: 220px;
    flex-shrink: 0;
    cursor: pointer;
    transition: var(--transition-normal);
}

.ticker-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.ticker-item.active {
    border-color: var(--color-football);
    background-color: rgba(16, 185, 129, 0.04);
}

.ticker-sport {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.ticker-sport.fb {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-football);
}

.ticker-sport.bb {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--color-baseball);
}

.ticker-teams {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    font-size: 0.8rem;
    font-weight: 600;
}

.ticker-team-row {
    display: flex;
    justify-content: space-between;
}

.ticker-score {
    color: white;
}

.ticker-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.65rem;
}

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

.ticker-status {
    font-weight: 700;
}

.ticker-status.live {
    color: var(--color-danger);
    animation: text-pulse 1.5s infinite;
}

/* ==========================================================================
   CARDS & GLASSMORPHISM
   ========================================================================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-normal);
}

.glass-card {
    backdrop-filter: blur(12px) saturate(180%);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.card-title-bar h4 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   VIEW 1: DASHBOARD CONTENT
   ========================================================================== */
.dashboard-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(59, 130, 246, 0.05) 50%, rgba(7, 10, 19, 0.5) 100%);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.05);
}

.banner-content {
    max-width: 65%;
    z-index: 2;
}

.banner-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-top: 12px;
    margin-bottom: 16px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.banner-content p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.banner-decor {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.1;
    z-index: 1;
}

.bg-icon {
    width: 220px;
    height: 220px;
    color: white;
}

.badge {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-football);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 4px;
}

/* Match Cards */
.match-card {
    cursor: pointer;
}

.match-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.match-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sport-tag {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
}

.tag-football {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-football);
}

.tag-baseball {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-baseball);
}

.match-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 30px;
}

.match-status.live {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
    animation: bg-pulse 2s infinite;
}

.match-status.finished {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 30%;
}

.team-logo-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.football-home { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.football-away { background: linear-gradient(135deg, #0ea5e9, #0369a1); }
.baseball-home { background: linear-gradient(135deg, #1d4ed8, #1e3a8a); }
.baseball-away { background: linear-gradient(135deg, #1e293b, #0f172a); }

.team-name {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
}

.match-score-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 40%;
}

.score {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.xg-score, .win-prob {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.04);
    padding: 4px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 16px;
    font-size: 0.8rem;
}

.insight-text {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-link {
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.match-card:hover .action-link {
    color: white;
    transform: translateX(3px);
}

/* Stat Info Card */
.stat-info-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon i {
    width: 24px;
    height: 24px;
}

.football-accent {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-football);
}

.baseball-accent {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--color-baseball);
}

.defense-accent {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

.stat-info-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
}

.stat-info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   VIEW 2 & 3: MATCH DETAILS & GENERAL PITCH STYLING
   ========================================================================== */
.view-panel {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn var(--transition-normal);
}

.view-panel.active {
    display: flex;
}

.match-detail-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(7, 10, 19, 0.5) 100%);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.baseball-theme-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(7, 10, 19, 0.5) 100%);
    border-color: rgba(59, 130, 246, 0.12);
}

.league-tag {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.match-info h3 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 6px 0;
}

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

.scoreboard-large {
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 16px 32px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.team-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.team-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}

.score-num {
    font-size: 2.8rem;
    font-weight: 800;
    color: white;
}

.xg-num {
    font-size: 0.8rem;
    color: var(--color-football);
    font-weight: 700;
}

.baseball-theme-header .xg-num {
    color: var(--color-baseball);
}

.vs-divider {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0 24px;
}

/* Visualization Canvas Containers */
.visualization-card {
    display: flex;
    flex-direction: column;
}

.legend {
    display: flex;
    gap: 12px;
}

.legend-item {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.football-home-dot { background-color: var(--color-football); }
.football-away-dot { background-color: #3b82f6; }
.star-icon { color: #eab308; font-weight: bold; }

.pitch-container {
    position: relative;
    background-color: #0b111e;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.football-pitch-canvas, .baseball-field-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Interactive Popover */
.shot-popover {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1.5px solid var(--color-football);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(16, 185, 129, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-md);
    padding: 16px;
    width: 220px;
    z-index: 10;
    pointer-events: none;
    transform: translate(-50%, -100%);
    margin-top: -15px; /* offset slightly above node */
    transition: opacity var(--transition-fast) ease, transform var(--transition-fast) ease;
}

#baseball-view .shot-popover {
    border-color: var(--color-baseball);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(59, 130, 246, 0.15);
}

.shot-popover::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
    display: block;
    width: 0;
}

.shot-popover.hide {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -95%) scale(0.9);
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.popover-header .player-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: white;
}

.popover-body {
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.card-footer-tip {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
}

.card-footer-tip i {
    width: 14px;
    height: 14px;
    color: var(--color-football);
}

#baseball-view .card-footer-tip i {
    color: var(--color-baseball);
}

/* Momentum Flow chart wrapper */
.chart-wrapper {
    height: 220px;
    width: 100%;
}

.momentum-desc {
    font-size: 0.75rem;
    margin-top: 12px;
}

/* ==========================================================================
   PROGRESS BAR COMPARISONS (RIGHT COLUMN METRICS)
   ========================================================================== */
.stats-comparison-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stat-progress-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.stat-name {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.home-val {
    color: white;
}

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

.progress-bar-wrapper {
    height: 8px;
    background-color: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.progress-bar {
    height: 100%;
}

.progress-bar.home-fill {
    background-color: var(--color-football);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.progress-bar.home-fill.baseball-fill {
    background-color: var(--color-baseball);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.progress-bar.away-fill {
    background-color: rgba(255, 255, 255, 0.2);
}

.success-glow {
    filter: brightness(1.2);
}

.stat-note {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Tactical Insight boxes */
.insight-analysis-card {
    border-left: 4px solid var(--color-football);
}

.insight-analysis-card.baseball-border {
    border-left-color: var(--color-baseball);
}

.insight-p {
    font-size: 0.85rem;
    line-height: 1.6;
}

.tactical-badge {
    margin-top: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==========================================================================
   BASEBALL SPECIFIC: STRIKE ZONE & SPITCH LIST
   ========================================================================== */
.hit-1b { background-color: #10b981; }
.hit-2b { background-color: #3b82f6; }
.hit-hr { background-color: #eab308; }
.hit-out { background-color: #475569; }

.pitch-fastball { background-color: #ef4444; }
.pitch-slider { background-color: #3b82f6; }

.strike-zone-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    aspect-ratio: 1;
}

.strike-zone-grid {
    position: relative;
    width: 80%;
    height: 80%;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background-color: rgba(255, 255, 255, 0.01);
}

.sz-box {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 60%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 700;
    text-transform: uppercase;
}

.pitch-node {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    cursor: help;
}

.pitch-list-container {
    overflow-x: auto;
}

.pitch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.pitch-table th, .pitch-table td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.pitch-table th {
    font-weight: 700;
    color: var(--text-muted);
}

.pitch-table td {
    font-weight: 500;
}

.high-spin {
    color: #38bdf8;
    font-weight: 700;
}

/* ==========================================================================
   VIEW 4: PLAYER ANALYZER
   ========================================================================== */
.player-select-bar {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 18px 24px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.custom-select {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.custom-select:focus {
    border-color: var(--color-football);
}

.radar-chart-wrapper {
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-summary-box {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.p1-box { border-left: 3px solid #10b981; }
.p2-box { border-left: 3px solid #f43f5e; }

.avatar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.p1-avatar { background-color: rgba(16, 185, 129, 0.2); color: var(--color-football); }
.p2-avatar { background-color: rgba(244, 63, 94, 0.2); color: #f43f5e; }

.avatar-meta h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.main-stat {
    display: flex;
    flex-direction: column;
}

.main-stat .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-stat .val {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 4px;
}

.p1-box .main-stat .val { color: var(--color-football); }
.p2-box .main-stat .val { color: #f43f5e; }

.deep-metrics-container {
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.comparison-table th, .comparison-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.comparison-table td {
    font-weight: 600;
}

.comparison-table .metric-name {
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
}

.comparison-table .p1-val {
    text-align: left;
    color: var(--color-football);
}

.comparison-table .p2-val {
    text-align: right;
    color: #f43f5e;
}

.comparison-table tr:last-child th, .comparison-table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   MODAL DIALOG (SYNOLOGY NAS GUIDE)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(7, 10, 19, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    transition: opacity var(--transition-normal) ease;
}

.modal-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: #0d1321;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 600px;
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.close-btn:hover {
    color: white;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 16px;
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-football);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.step-text strong {
    font-size: 0.95rem;
    color: white;
    display: block;
    margin-bottom: 4px;
}

.step-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* ==========================================================================
   ANIMATIONS & RESPONSIVE LAYOUT
   ========================================================================== */
@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes bg-pulse {
    0% { background-color: rgba(239, 68, 68, 0.08); }
    50% { background-color: rgba(239, 68, 68, 0.16); }
    100% { background-color: rgba(239, 68, 68, 0.08); }
}

@keyframes text-pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Rules */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2-1 { grid-template-columns: 2fr 1.1fr; }

.flex-column-gap {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 1200px) {
    .grid-2-1 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 70px;
        padding: 24px 8px;
    }
    .logo-text, .nav-item span, .btn-nas span, .copyright {
        display: none;
    }
    .logo-area {
        justify-content: center;
        padding-bottom: 20px;
    }
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    .sidebar-footer {
        align-items: center;
    }
    .btn-nas {
        padding: 12px;
        width: auto;
        border-radius: 50%;
    }
    .main-content {
        margin-left: 70px;
        padding: 20px;
    }
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .search-bar {
        width: 100%;
    }
    .match-teams {
        flex-direction: column;
        gap: 16px;
    }
    .team {
        width: 100%;
    }
    .match-score-area {
        width: 100%;
        order: -1;
    }
    .scoreboard-large {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    .dashboard-banner {
        padding: 24px;
    }
    .banner-content {
        max-width: 100%;
    }
}
