/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: #383838 !important;
    transform: translateX(-100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Show sidebar by default on desktop */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

/* Collapsed sidebar state (desktop/tablet only) */
@media (min-width: 1024px) {
    .sidebar.collapsed {
        width: 70px;
        transform: translateX(0);
        overflow: visible;
    }
    
    /* Hide logo text completely */
    .sidebar.collapsed .logo-text {
        display: none;
    }
    
    /* Hide section titles completely */
    .sidebar.collapsed .nav-section-title {
        display: none;
    }
    
    /* Style nav items for icon-only display */
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 0.75rem 0;
        margin: 0.25rem 0.5rem;
        border-radius: 8px;
        position: relative;
        overflow: visible;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
    }
    
    /* Center icons and remove margin */
    .sidebar.collapsed .nav-item i {
        margin: 0;
        font-size: 1.1rem;
    }
    
    /* Hide all text in nav items */
    .sidebar.collapsed .nav-item {
        font-size: 0;
        line-height: 0;
    }
    
    /* Position badge on top-right of icon */
    .sidebar.collapsed .nav-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        transform: scale(0.75);
        min-width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Rotate toggle icon */
    .sidebar.collapsed .sidebar-toggle i {
        transform: rotate(90deg);
    }
    
    /* Adjust main content when sidebar is collapsed */
    .main-content.sidebar-collapsed {
        margin-left: 70px !important;
    }
    
    /* Tooltip effect for collapsed nav items */
    .sidebar.collapsed .nav-item::after {
        content: attr(title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: #383838;
        color: #ffffff;
        padding: 0.5rem 0.75rem;
        border-radius: 6px;
        font-size: 0.85rem;
        font-weight: normal;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        margin-left: 0.75rem;
        z-index: 1001;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        pointer-events: none;
    }
    
    .sidebar.collapsed .nav-item:hover::after {
        opacity: 1;
        visibility: visible;
    }
    
    /* Adjust sidebar sections spacing in collapsed mode */
    .sidebar.collapsed .nav-section {
        margin-bottom: 1rem;
    }
    
    /* Adjust header padding in collapsed mode */
    .sidebar.collapsed .sidebar-header {
        padding: 1.5rem 1rem;
        justify-content: center;
    }
    
    .sidebar.collapsed .logo {
        margin: 0;
    }
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #555555;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.sidebar-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #ddd;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: none; /* Hidden by default, shown on desktop */
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

/* Show toggle button on desktop/tablet only */
@media (min-width: 1024px) {
    .sidebar-toggle {
        display: block;
    }
}

.logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3CAF5E 0%, #49FF9F 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
}

.logo-text {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    color: #999;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    padding: 0 1.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: #ddd;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0 0.5rem;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-light);
    border-radius: 8px;
}

.nav-item.active {
    background: linear-gradient(135deg, #3CAF5E 0%, #49FF9F 100%);
    color: var(--text-light);
    border-radius: 8px;
}

.nav-item i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.nav-badge {
    background: #49FF9F;
    color: #383838;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    margin-left: auto;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: 0;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    position: relative;
}

.main-content.sidebar-open {
    margin-left: 280px;
}

/* Collapsed state has higher priority than open state */
.main-content.sidebar-collapsed {
    margin-left: 70px !important;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #333333;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.menu-toggle:hover {
    background: #EAF4EE;
}

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

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content.sidebar-open {
        margin-left: 0;
    }

    .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: 280px;
    }

    .menu-toggle {
        display: none;
    }

    .sidebar-overlay {
        display: none;
    }
}

/* Dropdown Section - general styling */
.dropdown-section {
    margin-bottom: 1rem;
}

/* Only clubs section gets scroll functionality */
.dropdown-section.clubs-section {
    max-height: 185px; /* Height for exactly 3 items (60px + 4px margin each) */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
}

/* Custom scrollbar styling - only for clubs section */
.dropdown-section.clubs-section::-webkit-scrollbar {
    width: 4px;
}

.dropdown-section.clubs-section::-webkit-scrollbar-track {
    background: #383838;
    border-radius: 2px;
}

.dropdown-section.clubs-section::-webkit-scrollbar-thumb {
    background: #3CAF5E;
    border-radius: 2px;
}

.dropdown-section.clubs-section::-webkit-scrollbar-thumb:hover {
    background: #49FF9F;
}

.dropdown-section-title {
    color: #333; /* Dark text color for better readability */
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
}

.club-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-height: 60px;
    height: 60px;
}

.club-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(2px);
}

.club-item.active {
    background: linear-gradient(135deg, #3CAF5E 0%, #49FF9F 100%);
    border-color: #49FF9F;
}

.club-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.club-gae {
    background: linear-gradient(135deg, #3CAF5E 0%, #49FF9F 100%);
}

.club-knltb {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.club-tennis {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.club-hockey {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.club-info {
    flex: 1;
    min-width: 0;
}

.club-info h4 {
    color: #333; /* Dark text color for better readability */
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-item.active .club-info h4 {
    color: white; /* White text for active item */
}

.club-info p {
    color: #666; /* Dark gray text for subtitle */
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.club-item.active .club-info p {
    color: rgba(255, 255, 255, 0.8); /* Light text for active item subtitle */
}