/* Sidebar Styling */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 3.5rem;
}

.logo-img {
    width: 80%;
    height: auto;
    object-fit: contain;
}

/* Nav Links */
.nav-links { list-style: none; }
.nav-links li { margin-bottom: 0.5rem; }
.nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
    transition: 0.2s;
}

.nav-links li.active a, .nav-links a:hover {
    background-color: var(--nav-hover);
    color: var(--accent-color);
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2000;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Content Area */
.content {
    flex-grow: 1;
    padding: 3rem;
    overflow-y: auto;
}

/* Hide all sections by default */
.content-section {
    display: none; 
    opacity: 0;
}

/* ONLY show the section if it is the current target or has the active class */
.content-section:target,
.content-section.active {
    display: block; /* or 'flex' depending on your layout */
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Specific width logic for Events only when active */
#events.content-section:target,
#events.content-section.active {
    display: block;
    width: 100%; 
    max-width: 1100px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    body { display: block; }
    .menu-toggle { display: block; }
    .sidebar {
        position: fixed;
        left: -260px;
    }
    .sidebar.active { transform: translateX(260px); }
    .content { padding: 5rem 1.5rem; }
}

/* 1. Hide the admin link by default */
.nav-links a[href="#admin"] {
    display: none !important;
}

/* 2. Reveal it only when the .unlocked class is added by theme.js */
.nav-links a[href="#admin"].unlocked {
    display: flex !important;
}

/* --- Mobile Toggle Button --- */
.mobile-toggle {
    display: none; /* Hidden on desktop */
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: var(--accent-color);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* --- Responsive Sidebar Logic --- */
@media (max-width: 1024px) {
    /* 1. Pin the Sidebar to the literal left edge */
    .sidebar {
        position: fixed !important;
        top: 0;
        left: -280px; /* Start hidden */
        width: 280px;
        height: 100vh; /* Full viewport height */
        height: 100dvh; /* Dynamic viewport height for mobile browsers */
        z-index: 9999;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        
        /* Ensure it doesn't shift during scroll */
        margin: 0;
        border-radius: 0; 
    }

    /* 2. Use transform instead of 'left' for smoother, stickier animation */
    .sidebar.active {
        transform: translateX(280px);
    }

    /* 3. Pin the Toggle Button */
    .mobile-toggle {
        display: flex;
        position: fixed !important; /* Keep it pinned even when scrolling */
        top: 15px;
        left: 15px;
        z-index: 10000; /* Must be higher than sidebar */
        align-items: center;
        justify-content: center;
    }

    /* 4. Fix content overflow */
    body.menu-open {
        overflow: hidden; /* Prevent background scrolling when menu is open */
    }
}

.admin-form textarea {
    resize: vertical; /* Allow secretary to expand the box if needed */
    min-height: 80px;
    font-family: inherit;
}