/* ── Sidebar Navigation Layout — SportPlayers360 ── */

/* Reset body padding to prevent margins on the outer layout */
body {
    margin: 0 !important;
    padding: 0 !important;
    background: #F1F5F9 !important; /* Slate slate light grey */
    /* overflow managed per breakpoint — see media queries below */
    min-height: 100vh !important;
}

/* Container is now a full-width viewport wrapper instead of centered 1400px card */
body > .container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    display: flex;
    flex-direction: column;
}

/* Prevent inner container elements from inheriting the viewport wrapper styles */
.content-container .container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
    display: block !important;
}

@media (min-width: 1100px) {
    /* Desktop: body scrolls naturally — sidebar is sticky so it stays on screen */
    body {
        overflow-y: auto !important; /* Native window scroll — most reliable */
        overflow-x: hidden !important;
    }

    /* Full Viewport Split Layout Grid: sidebar is fixed so wrapper just needs offset margin */
    .main-layout-wrapper {
        display: block !important; /* No flex needed — fixed sidebar is out of normal flow */
        min-height: 100vh !important;
        margin-left: 260px !important; /* Push content right to make room for fixed sidebar */
        overflow: visible !important;
        margin-top: 0 !important;
    }

    /* Left Sidebar: FIXED — stays on screen at all times, out of document flow */
    .sidebar-navigation {
        width: 260px !important;
        height: 100vh !important;
        background: #ffffff !important;
        border-right: 1px solid #E2E8F0 !important;
        display: flex !important;
        flex-direction: column !important;
        flex-shrink: 0 !important;
        z-index: 200 !important; /* Above everything */
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.04) !important;
        padding: 1.5rem 1rem !important;
        box-sizing: border-box !important;
        position: fixed !important; /* Truly fixed — never moves regardless of scroll */
        left: 0 !important;
        top: 0 !important;
        overflow-y: auto !important; /* In case sidebar content exceeds viewport */
    }

    /* Sidebar Brand / App Logo Section */
    .sidebar-brand {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding-bottom: 1.25rem !important;
        border-bottom: 1px solid #F1F5F9 !important;
        margin-bottom: 1.5rem !important;
    }

    .sidebar-logo {
        animation: rotateLogo 20s linear infinite;
    }

    @keyframes rotateLogo {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }

    /* Vertical Navigation Capsule List */
    .nav-tabs {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.4rem !important;
        background: transparent !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        width: 100% !important;
        margin-bottom: 1.5rem !important;
        flex-wrap: nowrap !important;
        flex-grow: 1 !important;
        overflow-y: auto !important;
    }

    .nav-tab {
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        background: transparent !important;
        border: 1px solid transparent !important;
        border-radius: 10px !important;
        color: #64748B !important; /* Premium Slate Gray */
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        font-weight: 600 !important;
        font-size: 0.92rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        justify-content: flex-start !important;
        white-space: nowrap !important;
        position: relative !important;
    }

    .nav-tab:hover {
        background: #F8FAFC !important;
        color: #1E3A5F !important;
        transform: translateX(4px) !important;
    }

    .nav-tab.active {
        background: #1E3A5F !important; /* Corporate Active state */
        color: #ffffff !important;
        border-color: transparent !important;
        box-shadow: 0 4px 12px rgba(30, 58, 95, 0.15) !important;
        transform: none !important;
    }

    .nav-tab.active::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 25% !important;
        height: 50% !important;
        width: 3px !important;
        background: #2563EB !important;
        border-radius: 0 4px 4px 0 !important;
    }

    /* Bottom User Profile Section (Sidebar bottom) */
    .sidebar-user-profile {
        border-top: 1px solid #F1F5F9 !important;
        padding-top: 1.25rem !important;
        margin-top: auto !important; /* Pushes it directly to the bottom */
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .sidebar-user-profile .user-info {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        background: #F8FAFC !important;
        padding: 0.6rem 0.85rem !important;
        border-radius: 12px !important;
        border: 1px solid #E2E8F0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .sidebar-user-profile .user-avatar {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        background: #1E3A5F !important;
        color: white !important;
        font-weight: 700 !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .sidebar-user-profile .user-details {
        display: flex !important;
        flex-direction: column !important;
        line-height: 1.2 !important;
        flex-grow: 1 !important;
        min-width: 0 !important;
    }

    .sidebar-user-profile .user-name {
        font-size: 0.88rem !important;
        font-weight: 700 !important;
        color: #1E3A5F !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .sidebar-user-profile .user-role {
        font-size: 0.68rem !important;
        font-weight: 600 !important;
        color: #64748B !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        margin-top: 0.15rem !important;
    }

    .sidebar-user-profile .btn-logout {
        width: 100% !important;
        padding: 0.6rem !important;
        font-size: 0.85rem !important;
        font-weight: 700 !important;
        color: #DC2626 !important;
        background: #FEF2F2 !important;
        border: 1px solid #FEE2E2 !important;
        border-radius: 10px !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }

    .sidebar-user-profile .btn-logout:hover {
        background: #FEE2E2 !important;
        color: #B91C1C !important;
        transform: translateY(-1px) !important;
    }

    /* Right Main Content Area: Fills remaining width, grows with content */
    .main-content-area {
        flex-grow: 1 !important;
        min-height: 100vh !important; /* Grows naturally — no fixed height constraint */
        height: auto !important;
        overflow: visible !important; /* No clip — body handles the scroll */
        display: flex !important;
        flex-direction: column !important;
        background: #F8FAFC !important; /* Slate slate ultra light grey background */
    }

    /* Top Navbar: sticky so it stays visible when scrolling */
    .top-navbar {
        height: 72px !important;
        background: linear-gradient(135deg, #152B47 0%, #1E3A5F 100%) !important; /* Deep Premium Navy Blue */
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 16px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 2rem !important;
        flex-shrink: 0 !important;
        box-shadow: 0 10px 25px -5px rgba(21, 43, 71, 0.15), 0 8px 10px -6px rgba(21, 43, 71, 0.1) !important;
        box-sizing: border-box !important;
        margin: 1.25rem 2rem 0.25rem 2rem !important; /* Elegant floating effect */
        position: sticky !important; /* Sticks at top when scrolling */
        top: 0.75rem !important; /* Small gap from viewport top */
        z-index: 50 !important; /* Above content, below modals */
    }

    .top-navbar-left {
        display: flex !important;
        align-items: center !important;
    }

    .top-navbar-right {
        display: flex !important;
        align-items: center !important;
    }

    /* Content Container: Natural flow — body scroll handles everything */
    .content-container {
        padding: 2rem !important;
        flex: 1 !important;
        overflow: visible !important; /* No clipping — let content flow naturally */
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 0 !important;
    }
}

@media (max-width: 1099px) {
    /* Tablet/Mobile view - fallback to the classical top header banner */
    body {
        overflow: auto !important;
    }

    .main-layout-wrapper {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
    }

    .sidebar-navigation {
        width: 100% !important;
        background: #ffffff !important;
        border-radius: 12px !important; /* Compact rounded corners */
        border: 1px solid #E2E8F0 !important;
        padding: 0.5rem 0.75rem !important; /* Ultra compact padding */
        box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important;
        margin-bottom: 0.75rem !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.4rem !important; /* Tight gaps */
    }

    .sidebar-brand {
        order: 1 !important; /* Forces brand to be first */
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }

    .sidebar-brand img {
        width: 24px !important; /* Smaller logo for compact design */
        height: 24px !important;
    }

    .sidebar-brand span {
        font-size: 1rem !important; /* Smaller text size */
    }

    .sidebar-user-profile {
        order: 2 !important; /* Forces user profile / logout button to be second, sitting next to brand */
        width: auto !important;
        margin-top: 0 !important;
        border-top: none !important;
        padding-top: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        box-sizing: border-box !important;
    }

    .sidebar-user-profile .user-info {
        display: flex !important; /* Show compactly on mobile */
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
        box-shadow: none !important;
    }

    .sidebar-user-profile .user-avatar,
    .sidebar-user-profile .user-details {
        display: none !important; /* Hide bulky details */
    }

    .sidebar-user-profile #config-header-btn {
        margin-right: 0.65rem !important;
        margin-left: 0 !important;
        padding: 0.35rem 0.45rem !important;
        font-size: 0.85rem !important;
        border-radius: 50% !important;
        width: 28px !important;
        height: 28px !important;
        align-items: center !important;
        justify-content: center !important;
        background: #F1F5F9 !important;
        border: 1px solid #E2E8F0 !important;
        color: #475569 !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
    }

    .sidebar-user-profile #config-header-btn:hover {
        background: #E2E8F0 !important;
        color: #1E293B !important;
    }

    .sidebar-user-profile .btn-logout {
        margin: 0 !important;
        padding: 0.28rem 0.65rem !important; /* Ultra compact logout pill */
        font-size: 0.7rem !important;
        font-weight: 700 !important;
        color: #DC2626 !important;
        background: #FEF2F2 !important;
        border: 1px solid #FEE2E2 !important;
        border-radius: 20px !important;
        cursor: pointer !important;
        transition: all 0.2s !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        box-shadow: none !important;
    }

    .sidebar-user-profile .btn-logout:hover {
        background: #FEE2E2 !important;
        color: #B91C1C !important;
    }

    /* Force the tabs to render underneath the brand row by assigning order 3 */
    .nav-tabs {
        order: 3 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        gap: 0.35rem !important;
        margin-bottom: 0 !important;
        padding: 0.25rem 0 0 0 !important;
        border-top: 1px solid #F1F5F9 !important; /* Clean separator line */
        padding-top: 0.4rem !important;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .nav-tab {
        padding: 0.35rem 0.75rem !important; /* Extremely compact tabs */
        font-size: 0.78rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }

    .top-navbar {
        background: linear-gradient(135deg, #152B47 0%, #1E3A5F 100%) !important; /* Deep Premium Navy Blue */
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 12px !important; /* Match tightened rounding */
        padding: 0.65rem 0.85rem !important; /* Tightened mobile padding */
        box-shadow: 0 10px 25px -5px rgba(21, 43, 71, 0.15) !important;
        margin-bottom: 0.75rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 0.65rem !important;
        box-sizing: border-box !important;
    }

    .top-navbar #header-club-logo {
        width: 32px !important; /* Sleeker logo */
        height: 32px !important;
    }

    .top-navbar #header-logo-fallback {
        font-size: 1.15rem !important;
    }

    .top-navbar #app-title {
        font-size: 0.9rem !important; /* Compact titles */
    }

    .top-navbar #sport-club-name {
        font-size: 0.75rem !important;
    }

    /* Tighten selector pills in mobile header */
    .top-navbar .sport-pill {
        padding: 0.3rem 0.75rem !important;
        font-size: 0.78rem !important;
    }

    .main-content-area {
        width: 100% !important;
    }

    .content-container {
        width: 100% !important;
        padding: 0 !important;
    }
}

/* ── Refine sport pills inside the dark top-navbar (Universal Glassmorphic styling) ── */
.top-navbar .sport-pill {
    border: 2px solid rgba(255, 255, 255, 0.15) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    box-shadow: none !important;
}
.top-navbar .sport-pill:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px) !important;
}
.top-navbar .sport-pill.active {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%) !important; /* Premium Electric Blue */
    border-color: #3B82F6 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25) !important;
}
