/* ========== CSS Variables ========== */
:root {
    --primary-green: #8FBC8F;
    --primary-green-dark: #6B9B6B;
    --primary-green-light: #A8D5A8;
    --secondary-silver: #C0C0C0;
    --secondary-silver-dark: #A8A8A8;
    --accent-orange: #FF9F43;
    --accent-red: #E74C3C;
    --bg-dark: #1A1A1A;
    --bg-card: #2A2A2A;
    --text-primary: #FAFAFA;
    --text-secondary: #CCCCCC;
    --sidebar-width: 280px;
}

/* ========== Reset & Base ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ========== Hamburger Menu (CSS-only) ========== */
#menu-toggle {
    display: none;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

/* Hide hamburger when sidebar is open */
#menu-toggle:checked + .hamburger {
    opacity: 0;
    pointer-events: none;
}

/* ========== Sidebar ========== */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-card);
    border-right: 3px solid var(--primary-green);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#menu-toggle:checked ~ .sidebar-nav {
    transform: translateX(0);
}

/* Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

#menu-toggle:checked ~ .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

/* Sidebar content */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--secondary-silver-dark);
    margin-bottom: 1rem;
}

.sidebar-header h2 {
    color: var(--primary-green);
    font-size: 1.2rem;
    margin: 0;
}

/* Sidebar close button */
.sidebar-close {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    cursor: pointer;
}

.sidebar-close span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Always show as X since sidebar is open when visible */
.sidebar-close span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.sidebar-close span:nth-child(2) {
    opacity: 0;
}

.sidebar-close span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.sidebar-section {
    padding: 0.5rem 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-section h3 {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 0.25rem;
}

.sidebar-links a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.sidebar-links a .feather {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-links a:hover {
    background-color: var(--primary-green);
    color: var(--bg-dark);
}

.sidebar-links a.active {
    background-color: var(--primary-green-dark);
    color: var(--bg-dark);
}

/* Collapsible submenu in sidebar */
.sidebar-submenu {
    display: none;
    list-style: none;
    padding-left: 1.5rem;
    margin-top: 0.25rem;
}

.sidebar-submenu a {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
}

.submenu-toggle {
    display: none;
}

.submenu-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.submenu-trigger:hover {
    background-color: var(--primary-green);
    color: var(--bg-dark);
}

.submenu-trigger span {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.submenu-trigger .feather {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.submenu-arrow {
    transition: transform 0.2s ease;
}

.submenu-toggle:checked ~ .sidebar-submenu {
    display: block;
}

.submenu-toggle:checked + .submenu-trigger .submenu-arrow {
    transform: rotate(180deg);
}

/* Scrollable submenu lists */
.sidebar-submenu.sidebar-matchup-list,
.sidebar-submenu.team-list {
    max-height: 300px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.team-list a {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* ========== Navigation Bar ========== */
nav {
    background-color: var(--bg-card);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border-bottom: 3px solid var(--primary-green);
    position: sticky;
    top: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

nav.nav-hidden {
    transform: translateY(-100%);
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.nav-logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.nav-logo h1 {
    font-size: 1.5rem;
    color: var(--primary-green);
    margin: 0;
}

/* Smaller logo text on mobile */
@media (max-width: 600px) {
    .nav-logo h1 {
        font-size: 1.5rem;
    }
}

/* ========== Main content ========== */
.main-content {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

h1 {
    color: var(--primary-green);
    font-size: 2rem;
}

h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
}

h3 {
    color: var(--text-primary);
    font-size: 1.2rem;
}

.info-box {
    background-color: rgba(143, 188, 143, 0.2);
    border-left: 4px solid var(--primary-green);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

/* Icon styling */
.icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* ========== Footer ========== */
.site-footer {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--secondary-silver-dark);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.site-footer p {
    margin: 0;
}

.site-footer .last-update {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--secondary-silver-dark);
}

/* ========== Shared Components ========== */
/* Page navigation arrows (used in team and matchup pages) */
.page-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--bg-dark);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    border: 2px solid var(--secondary-silver-dark);
    flex-shrink: 0;
}

.page-nav-arrow:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.page-nav-arrow svg {
    width: 20px;
    height: 20px;
}

/* Info banner */
.info-banner {
    background-color: rgba(143, 188, 143, 0.2);
    border-left: 4px solid var(--primary-green);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Table styling - shared across pages (for ranking tables) */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.table-container table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    background-color: var(--bg-dark);
}

.table-container thead {
    position: sticky;
    top: 0;
    background-color: var(--bg-card);
    z-index: 10;
}

.table-container th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-green);
    font-size: 0.85rem;
    white-space: nowrap;
}

.table-container td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
}

.table-container tr:hover {
    background-color: var(--bg-card);
}

/* Team name column - left aligned and wider */
.table-container td:first-child,
.table-container th:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background-color: var(--bg-dark);
    font-weight: 600;
    min-width: 120px;
    padding-left: 1rem;
}

.table-container th:first-child {
    background-color: var(--bg-card);
    z-index: 11;
}

.table-container tr:hover td:first-child {
    background-color: var(--bg-card);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 1rem;
    }
}
