/* Layout V2 - shell chrome for the Pickleball Compete UI.
   Theme tokens (--color-*, and the legacy aliases --dark-bg / --card-bg / …)
   are defined centrally in Content/css/v2/theme-v2.css. Do not re-declare
   :root tokens here. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.pickleball-dark-theme {
    font-family: 'Inter', 'Segoe UI', 'Noto Sans', Tahoma, Arial, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.45;
    overflow-x: hidden;
}

/* Light-theme token values now live in theme-v2.css (:root[data-theme="light"]).
   The body.pickleball-* classes are mirrored by theme.js for the legacy
   `body.pickleball-light-theme .foo` selectors further down this file. */

.app-wrapper {
    display: block;
    min-height: 100vh;
}


/* ============================================
   SIDEBAR NAVIGATION
   ============================================ */

.sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--primary-green);
    width: fit-content;
}

.lang-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    padding: 4px 10px;
    border-radius: 999px;
    min-width: 56px;
    justify-content: center;
}

.lang-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.lang-item.active {
    color: var(--color-text-primary);
    background: var(--nav-accent-tint-bg);
    box-shadow: inset 0 0 0 1px var(--nav-accent-tint-border);
}

:root[data-theme="light"] .lang-item.active {
    color: var(--color-primary);
}

.lang-flag {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.lang-flag.vn {
    background: #da251d;
}

.lang-flag.vn::after {
    content: '\2605';
    position: absolute;
    color: #ffde00;
    font-size: 6px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    line-height: 1;
}

.lang-flag.en {
    background:
        linear-gradient(180deg, #b22234 0 14.28%, #fff 14.28% 28.56%, #b22234 28.56% 42.84%, #fff 42.84% 57.12%, #b22234 57.12% 71.4%, #fff 71.4% 85.68%, #b22234 85.68% 100%);
}

.lang-flag.en::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 40%;
    height: 52%;
    background: #3c3b6e;
}

.brand-main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;   
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
    .brand-icon img {
        width: 50px;
    }
.brand-icon i {
    font-size: 20px;
    color: var(--dark-bg);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-family: var(--font-family-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-tagline {
    font-family: var(--font-family-heading);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ============================================
   SIDEBAR SPORT SELECTOR
   ============================================ */

.sidebar-sport-selector {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.sport-selector-dropdown {
    position: relative;
}

.sidebar-sport-selector .sport-selector-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.sidebar-sport-selector .sport-selector-btn:hover {
    border-color: var(--primary-green);
    background: var(--hover-bg);
}

.sidebar-sport-selector .sport-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sport-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sport-label {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 1px;
}

.sidebar-sport-selector .sport-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-icon {
    font-size: 10px;
    color: var(--text-secondary);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.sport-selector-dropdown.open .dropdown-icon {
    transform: rotate(180deg);
}

.sport-dropdown-menu {
    position: fixed;
    top: auto;
    left: 250px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-width: 260px;
    max-width: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 2000;
    overflow: visible;
    margin-left: 8px;
    padding: 0;
}

.sport-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.sport-option:last-child {
    border-bottom: none;
}

.sport-option:hover {
    background: var(--hover-bg);
}

.sport-option.active {
    background: var(--nav-accent-tint-bg);
    border-left: 3px solid var(--primary-green);
}

.sport-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sport-option .sport-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sport-description {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Sport Icon Colors (identity — mid-tone so they read on both dark and the
   light-blue Energy ground) */
.pickleball-icon {
    background: rgba(52, 168, 83, 0.14);
    color: #34a853;
}

.tennis-icon {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.badminton-icon,
.cầu\ lông-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.volleyball-icon,
.bóng\ chuyền-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.bóng\ bàn-icon {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.bóng\ đá-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.nav-link i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.nav-item.active .nav-link {
    background: var(--nav-active-fill);
    color: var(--nav-active-text);
    font-weight: 600;
    border-radius: var(--radius-sm);
    margin: 0 12px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.theme-toggle-section {
    margin-bottom: 16px;
}

.theme-toggle-label {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.theme-toggle-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
}

.theme-toggle-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.theme-toggle-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.28);
}

.theme-toggle-btn i {
    font-size: 12px;
}

.compete-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #0d1219 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

.compete-card h4 {
    font-size: 13px;
    color: var(--primary-green);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 1px;
}

.compete-card p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.btn-compete {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary-green);
    color: var(--dark-bg);
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-compete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(158, 255, 0, 0.3);
}

.pickleball-image {
    position: absolute;
    bottom: -20px;
    right: -20px;
    opacity: 0.1;
    width: 100px;
}

.pickleball-image img {
    width: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: var(--hover-bg);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.user-menu-toggle {
    background: none;
    border: none;
    color: var(--color-link);
    cursor: pointer;
    padding: 4px;
}

.user-notification-btn {
    font-size: 16px;
    color: var(--text-secondary);
    padding: 4px;
}

.user-notification-btn .notification-badge {
    top: 0;
    right: -2px;
}

.user-profile {
    position: relative;
}

.user-menu-dropdown {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 160px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 1100;
    padding: 6px;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 10px;
    transition: background 0.2s, color 0.2s;
}

.user-menu-item:hover {
    background: var(--hover-bg);
}

.user-menu-item.logout {
    color: #f87171;
}

.user-menu-item.logout:hover {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

/* ============================================
   MAIN WRAPPER
   ============================================ */

.main-wrapper {
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mobile-menu-toggle {
    display: none;
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--dark-bg);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 400px;
}

.search-bar i {
    color: var(--text-secondary);
    font-size: 14px;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.notification-btn:hover {
    color: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--primary-green);
    color: var(--color-link);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Main Content */
.main-content {
    padding: 8px;
    flex: 1;
    background: var(--dark-bg);
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--sidebar-bg);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--hover-bg);
}

/* Responsive Design */
@media (max-width: 1024px) {
/* ---- Mobile Navigation Header ---- */
.mobile-nav-header {
/*    display: none;*/
    position: sticky;
    top: 0;
    z-index: 1001;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.mobile-brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.mobile-brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.mobile-brand-name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.mobile-nav-spacer {
    width: 40px;
    flex-shrink: 0;
}

/* Responsive Design */
    .sidebar {
        width: 200px;
    }

    .main-wrapper {
        margin-left: 200px;
    }

    .brand-text {
        display: none;
    }

    .language-toggle {
        padding: 3px;
        gap: 6px;
    }

    .lang-item {
        font-size: 10px;
        min-width: 50px;
        padding: 4px 8px;
    }

    .nav-link span {
        display: none;
    }

    .compete-card {
        display: none;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 250px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .search-bar {
        width: 100%;
        max-width: 300px;
    }

    .top-header {
        padding: 12px 16px;
    }

    /* Overlay when sidebar is open */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Show brand text on mobile when sidebar is open */
    .sidebar.open .brand-text {
        display: flex;
    }

    .language-toggle {
        padding: 3px;
    }

    .sidebar.open .nav-link span {
        display: inline;
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .search-bar {
        max-width: 200px;
    }

    .search-bar input {
        width: 100%;
    }

    .header-content {
        gap: 8px;
    }
}

/* Mobile content additions at 768px */
@media (max-width: 768px) {
    .mobile-nav-header {
        display: flex;
    }

    body.sidebar-open .mobile-nav-header {
        display: none;
    }

    .main-content {
        padding: 2px;
    }

    .sport-dropdown-menu {
        min-width: unset;
    }
}

/* ============================================
   LARGE SCREEN SCALING (Full HD / 2K / 4K)
   ============================================ */

@media (min-width: 1920px) {
    .sidebar {
        width: 280px;
    }
    .main-wrapper {
        margin-left: 280px;
    }
    .top-header {
        padding: 20px 48px;
    }
    .main-content {
         padding: 8px;
    }
    .search-bar {
        width: 520px;
    }
    .brand-name {
        font-size: 17px;
    }
    .nav-link {
        font-size: 13px;
        padding: 10px 16px;
    }
    .sidebar-section-title {
        font-size: 10px;
    }
}

@media (min-width: 2560px) {
    .sidebar {
        width: 320px;
    }
    .main-wrapper {
        margin-left: 320px;
    }
    .top-header {
        padding: 24px 64px;
    }
    .main-content {
         padding: 32px;
    }
    .search-bar {
        width: 640px;
    }
    .brand-name {
        font-size: 19px;
    }
    .brand-tagline {
        font-size: 12px;
    }
    .nav-link {
        font-size: 14px;
        padding: 12px 20px;
    }
    .nav-link i {
        font-size: 17px;
    }
    .sidebar-header {
        padding: 28px 24px;
    }
    .sidebar-section-title {
        font-size: 11px;
    }
    .brand-icon {
        width: 48px;
        height: 48px;
    }
}

@media (min-width: 3840px) {
    .sidebar {
        width: 420px;
    }
    .main-wrapper {
        margin-left: 420px;
    }
    .top-header {
        padding: 32px 96px;
    }
    .main-content {
         padding: 32px;
    }
    .search-bar {
        width: 900px;
    }
    .brand-name {
        font-size: 24px;
    }
    .brand-tagline {
        font-size: 14px;
    }
    .nav-link {
        font-size: 17px;
        padding: 16px 24px;
    }
    .nav-link i {
        font-size: 20px;
    }
    .sidebar-header {
        padding: 36px 32px;
    }
    .sidebar-section-title {
        font-size: 13px;
        padding: 12px 24px 6px;
    }
    .brand-icon {
        width: 60px;
        height: 60px;
    }
    .brand-icon img {
        width: 64px;
    }
    .notification-btn {
        font-size: 26px;
    }
}



body.pickleball-light-theme .sport-selector-btn:hover,
body.pickleball-light-theme .lang-item.active {
    border-color: var(--color-primary);
}

/* Light theme accent: headline / link texts follow the forest-green primary */

/* ============================================
   DASHBOARD HORIZONTAL LAYOUT
   ============================================ */

body.dashboard-horizontal-layout .sidebar {
    display: none;
}

body.dashboard-horizontal-layout .main-wrapper {
    margin-left: 0;
}

body.dashboard-horizontal-layout .mobile-nav-header {
    display: none !important;
}

body.dashboard-horizontal-layout .main-content {
    /* No side padding here - the 16px gutter is on .main-content > * instead, so
       .dashboard-v3-shell (max-width 1800 + border-box) lines its edges up with
       .layout-v2-topnav-inner (same 1800px cap + 16px). */
        
    padding: 12px 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 18%) minmax(0, 64%) minmax(0, 18%);
    gap: 16px;
    align-items: start;
}

/* Energy light: swap the dark hero PNG for the light-blue ground with soft
   blue / sunny-yellow / sky washes — energetic, no image asset. */
:root[data-theme="light"] body.dashboard-horizontal-layout .main-content {
    background-color: var(--color-page-bg);
    background-image:
        radial-gradient(1100px 340px at 6% -8%, rgba(29, 78, 216, 0.07), transparent 60%),
        radial-gradient(900px 300px at 100% 2%, rgba(248, 197, 23, 0.12), transparent 55%),
        radial-gradient(1200px 420px at 50% 112%, rgba(14, 165, 233, 0.07), transparent 60%);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.dashboard-horizontal-layout .main-content > * {
    grid-column: 2;
    min-width: 0;
    /* side padding moved off .main-content (see above) - keep a gutter on the
       centre-track children so they don't hit the viewport edge when the grid
       collapses to a single block on mobile. */
    padding-left: 16px;
    padding-right: 16px;
}

body.dashboard-horizontal-layout .main-content > .dashboard-v3-shell,
body.dashboard-horizontal-layout .main-content > .tournaments-section,
body.dashboard-horizontal-layout .main-content > .full-width-layout {
    grid-column: 1 / -1;
}

/* Pages that opt into the "Full width layout" (RegistrationV2 / DrawlotsV2 /
   PairingDrawV2 hero pages, plus tournament Management + EventDetails) put
   `full-width-layout` on their root div to break out of the centre track and
   take the same 1800px centred envelope as .dashboard-v3-shell, so their left/
   right edges line up with .layout-v2-topnav-inner. Side gutter (16px) is
   inherited from the `.main-content > *` rule above.
   `width: 100%` is required: without an explicit width these grid items have an
   `auto` size, and combined with `margin-inline: auto` an auto-sized grid item
   does NOT stretch — it shrinks to content width. That made DrawlotsV2 /
   PairingDrawV2 render narrower than RegistrationV2 (which only filled because an
   unrelated `.registration-v2-page { width: 100% }` rule happened to apply). */
body.dashboard-horizontal-layout .main-content > .full-width-layout {
    width: 100%;
    max-width: 1800px;
    margin-inline: auto;
}

.layout-v2-topnav {
    position: sticky;
    top: 0;
    z-index: var(--z-topnav);
    border-bottom: 1px solid var(--nav-topnav-border);
    background: var(--nav-topnav-bg);
    backdrop-filter: blur(10px);
}

.layout-v2-topnav-inner {
    max-width: 1800px;
    margin: 0 auto;
    min-height: 56px;
    padding: 6px 16px;
    display: grid;
    /* brand | language-toggle | menu (1fr) | user (fixed 280px, right edge).
       The theme toggle is hidden for now; when it returns, add an `auto`
       column for it between language-toggle and menu (and in the media queries). */
    grid-template-columns: auto auto 1fr 280px;
    align-items: center;
    gap: 12px;
}

.layout-v2-topnav-inner > .topnav-user,
.layout-v2-topnav-inner > .topnav-guest {
    justify-self: end;
}

/* Logged-out: the Login button sizes itself; the fixed user column is for the logged-in control only. */
.layout-v2-topnav-inner:has(> .topnav-guest) {
    grid-template-columns: auto auto 1fr auto;
}

@media (max-width: 1024px) {
    .layout-v2-topnav-inner:has(> .topnav-guest) {
        grid-template-columns: auto 1fr auto;
    }
}

.topnav-brand {
    margin-right: 4px;
}

.layout-v2-topnav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
}

.topnav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--color-link);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--primary-green);
}

.topnav-link:hover,
.topnav-link.active {
    color: var(--text-primary);
    background: var(--nav-accent-tint-bg);
    border-color: var(--nav-accent-tint-border);
}

.topnav-link i {
    font-size: 14px;
}

.topnav-user.user-profile {
    padding: 8px 10px;
    min-width: 0;
}

.topnav-user-menu-toggle {
    font-size: 12px;
}

.topnav-user .topnav-user-menu-dropdown {
    top: calc(100% + 8px);
    bottom: auto;
}

@media (max-width: 1024px) {
    .layout-v2-topnav-inner {
        /* brand | menu (1fr) | user  (language-toggle hidden) */
        grid-template-columns: auto 1fr 280px;
        gap: 8px;
    }

    .layout-v2-topnav .language-toggle {
        display: none;
    }

    .topnav-link span {
        display: none;
    }

    .topnav-link {
        padding: 9px 10px;
    }
}

@media (max-width: 768px) {
    .layout-v2-topnav-inner {
        /* brand | menu (1fr) | user (80px: avatar + dropdown toggle) */
        grid-template-columns: auto 1fr 80px;
    }

    /* Full name/role/notification-bell don't fit in the mobile topnav, so
       collapse the logged-in control to just the avatar + dropdown toggle.
       The dropdown still exposes Profile/Settings/Logout. The guest Login
       button is left untouched — it's the only way a logged-out visitor on
       mobile can reach the login modal, so it must stay visible. */
    .topnav-user .user-info,
    .topnav-user .user-notification-btn {
        display: none;
    }

    .topnav-user.user-profile {
        padding: 6px 8px;
        gap: 6px;
    }

    body.dashboard-horizontal-layout .main-content {
        padding: 8px 0 12px;
        display: block;
    }
}

/* ============================================
   LAYOUT V2 FOOTER
   ============================================ */

.layout-v2-footer {
    margin-top: 18px;
    border-top: 1px solid var(--border-color);
    background: var(--nav-footer-bg);
    font-family: 'Segoe UI', 'Noto Sans', Tahoma, Arial, sans-serif;
}

.layout-v2-footer-inner {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1fr 1.5fr;
    gap: 18px;
    padding: 18px 20px;
}

.layout-v2-footer-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layout-v2-footer-col h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #f8fafc;
    margin: 0 0 4px;
}

/* The footer is a fixed deep-navy block in both themes, so its text is fixed
   light — never the theme's --text-secondary. */
.layout-v2-footer-col a {
    font-size: 12px;
    color: #a9b6cc;
    text-decoration: none;
    transition: color 0.2s;
}

.layout-v2-footer-col a:hover {
    color: #ffffff;
}

.footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.footer-brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.footer-brand-name {
    font-size: 19px;
    font-weight: 800;
    line-height: 1;
    color: #f8fafc;
}

.footer-brand-tag {
    font-size: 11px;
    color: #a3afc5;
    letter-spacing: 0.12em;
}

.footer-desc {
    font-size: 12px;
    color: #8a98b0;
    line-height: 1.5;
    margin-top: 6px;
}

.footer-socials {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.footer-socials a {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    border: 1px solid #334155;
    background: rgba(255, 255, 255, 0.04);
}

.footer-socials a:hover {
    color: #0b1220;
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.footer-contact-line {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.download-title {
    margin-top: 8px !important;
}

.footer-download-desc {
    font-size: 11px;
    color: #8a98b0;
    margin-bottom: 6px;
}

.footer-apps {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-apps img {
    width: 120px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #1f2937;
    background: rgba(255, 255, 255, 0.03);
}

.layout-v2-footer-bottom {
    border-top: 1px solid #182235;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #7f8ea7;
}

@media (max-width: 1300px) {
    .layout-v2-footer-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .layout-v2-footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .layout-v2-footer-bottom {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
}

@media (max-width: 620px) {
    .layout-v2-footer-inner {
        grid-template-columns: 1fr;
    }
}
body.pickleball-light-theme .section-title,
body.pickleball-light-theme .view-all-link,
body.pickleball-light-theme .view-rankings-link,
body.pickleball-light-theme .sport-name,
body.pickleball-light-theme .tour-title,
body.pickleball-light-theme .btn-view-tournament,
body.pickleball-light-theme [class*="text-blue"],
body.pickleball-light-theme [style*="#3b82f6"],
body.pickleball-light-theme [style*="#2563eb"],
body.pickleball-light-theme [style*="#1d4ed8"] {
    color: var(--color-primary) !important;
}

/* ============================================
   LIGHT THEME — shell chrome overrides
   Topnav / footer backgrounds + accent tints come from --nav-* tokens in
   theme-v2.css. The Energy footer is a deep-navy block in both themes, so the
   footer's dark text colours apply in light too — no per-theme footer overrides.
   ============================================ */
:root[data-theme="light"] .compete-card,
:root[data-theme="light"] .custom-alert-modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

:root[data-theme="light"] .nav-link:hover,
:root[data-theme="light"] .sport-selector-btn:hover {
    background: var(--color-surface-hover);
}

/* Need Support menu entry: unread dot + [hidden] must beat display:flex */
.user-menu-item[hidden] { display: none; }
.user-menu-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary, #9eff00); margin-left: auto; }
.user-menu-dot[hidden] { display: none; }

.notification-badge[hidden] { display: none; }
