/* Override global mirror settings for scrolling content */
body {
    overflow-y: auto !important;
    height: auto !important;
}
.mirror-container {
    height: auto !important;
    max-width: 1350px;
    margin: 0 auto;
    width: 100%;
}

/* Overview Cards */
.metrics-overview-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.metric-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-blue);
}
.metric-card.players::before {
    background: #a855f7; /* Purple */
}
.metric-card.sets::before {
    background: var(--winner-green);
}
.metric-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 5px;
}
.metric-value {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.5px;
}
.metric-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 5px;
}

/* Dashboard Grid Layout */
.metrics-dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
    align-items: start;
}
@media (max-width: 1024px) {
    .metrics-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Panels */
.metrics-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: fit-content;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: white;
}
.panel-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Table Style for Trends */
.trends-table-wrapper {
    overflow-x: auto;
}
.trends-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.trends-table th {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 16px;
    border-bottom: 1.5px solid var(--border-color);
}
.trends-table td {
    padding: 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}
.trends-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}
.game-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: white;
}
.game-icon-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border: 1px solid rgba(255,255,255,0.1);
}
.year-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}
.trend-stat {
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

/* Seasonality Bars */
.seasonality-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.season-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.season-label {
    width: 45px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
}
.season-bar-container {
    flex-grow: 1;
    height: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.01);
}
.season-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 7px;
    width: 0%;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.season-value {
    width: 50px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: white;
}

/* Countries List */
.countries-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.country-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.02);
}
.country-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.85rem;
}
.flag-badge {
    padding: 2px 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    font-size: 0.65rem;
    color: white;
    font-weight: 900;
}
.country-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
}

/* Awards Grid */
.awards-section-title {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 10px;
    max-width: 1350px;
    margin: 40px auto 20px auto;
}
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    max-width: 1350px;
    margin: 0 auto 50px auto;
    width: 100%;
}
.award-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    backdrop-filter: blur(10px);
}
.award-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.award-icon {
    font-size: 1.5rem;
}
.award-title-group {
    display: flex;
    flex-direction: column;
}
.award-title {
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: white;
}
.award-desc {
    font-size: 0.7rem;
    color: var(--text-dim);
}
.award-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.award-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
}
.award-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}
.award-rank-num {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--text-dim);
    width: 20px;
}
.award-player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    overflow: hidden;
    min-width: 0;
}
.award-player-char {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    object-fit: cover;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
}
.award-player-text-group {
    min-width: 0;
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.award-player-tag {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.award-player-tag:hover {
    color: var(--accent-blue);
}

/* Premium styled selector dropdown */
.metrics-country-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 10px 36px 10px 14px;
    background: rgba(20, 20, 22, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.metrics-country-select:hover, .metrics-country-select:focus {
    border-color: rgba(197, 168, 128, 0.5);
    box-shadow: 0 0 8px rgba(197, 168, 128, 0.1);
}
.award-value-badge {
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--accent-blue);
    font-family: 'Outfit', sans-serif;
    padding: 2px 8px;
    background: rgba(197, 168, 128, 0.08);
    border: 1px solid rgba(197, 168, 128, 0.15);
    border-radius: 6px;
}
.award-value-badge.green {
    color: var(--winner-green);
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
}
.award-value-badge.purple {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.15);
}
.globe-trotter-details {
    display: flex;
    flex-direction: column;
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 2px;
}

/* Loading overlay */
.metrics-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin: 40px auto;
    max-width: 1350px;
    width: 100%;
}

/* Custom Leaflet DivIcon Markers */
.metrics-map-marker {
    background: transparent;
    border: none;
}
.marker-circle {
    background: rgba(59, 130, 246, 0.12);
    border: 1.5px solid var(--accent-blue);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 0.65rem;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.marker-circle:hover {
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    transform: scale(1.05);
}

/* ==========================================================================
   MODE SWITCHER BAR (Global Overview vs Head-to-Head ⚔️)
   ========================================================================== */
.metrics-mode-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
}
.metrics-mode-switch {
    display: inline-flex;
    background: rgba(20, 20, 24, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 4px;
    gap: 6px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.mode-switch-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-dim);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mode-switch-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}
.mode-switch-btn.active {
    background: var(--accent-blue);
    color: #0b0c10;
    font-weight: 900;
    box-shadow: 0 2px 12px rgba(197, 168, 128, 0.35);
}
.mode-switch-btn.h2h-btn.active {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    box-shadow: 0 2px 14px rgba(239, 68, 68, 0.4);
}

/* ==========================================================================
   MARKET SHARE DOUGHNUT PANEL
   ========================================================================== */
.market-share-controls {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 3px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.metric-pill-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.metric-pill-btn:hover {
    color: white;
}
.metric-pill-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
}

/* ==========================================================================
   HEAD-TO-HEAD (H2H) DUAL SELECTOR BAR & TALE OF THE TAPE
   ========================================================================== */
.h2h-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto 30px auto;
    padding: 20px;
    background: rgba(20, 20, 25, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    flex-wrap: wrap;
}
.h2h-game-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.h2h-game-box label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.vs-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
    margin-top: 15px;
}
.h2h-year-box {
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Tale of the Tape Cards Grid */
.tale-of-tape-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}
.duel-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}
.duel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.duel-title {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.duel-leader-badge {
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.duel-values-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.duel-val {
    font-size: 1.6rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
}
.duel-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    display: flex;
    overflow: hidden;
    margin-top: 5px;
}
.duel-bar-a {
    height: 100%;
    transition: width 0.4s ease;
}
.duel-bar-b {
    height: 100%;
    transition: width 0.4s ease;
}

