/* Header & Sidebar Styles */

#page-container {
    width: 100%;
    transition: transform 0.3s ease-in-out;
}

.main-header {
    width: 100%;
    height: 70px; /* Set a fixed height for the header bar */
    position: fixed;
    top: 0;
    left: 0;
    background-color: transparent;
    z-index: 999; /* Keep it behind the sidebar and button */
    box-sizing: border-box;
}

.sidebar-toggle {
    position: fixed;
    top: 15px; /* Increased top margin */
    left: 20px; /* Positioned at the edge */
    z-index: 1002; /* Always on top */
    background-color: var(--grey-background);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s ease-in-out; /* Animate position */
}

.sidebar-toggle.open {
    left: 300px; /* 280px sidebar width + 20px offset */
}

.sidebar-toggle svg {
    stroke: var(--text-color);
    transition: transform 0.3s ease-in-out; /* Animate rotation */
}

.sidebar-toggle.open svg {
    transform: rotate(180deg);
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background-color: var(--grey-background);
    padding: 20px;
    box-sizing: border-box;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto; /* Allow vertical scrolling if content overflows */
}

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

/* Push page content when sidebar is open */
.sidebar.open ~ #page-container {
    transform: translateX(280px);
}

/* Prevent body scroll when sidebar is open to stop layout jump */
body.sidebar-open {
    overflow: hidden;
}

.sidebar a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.sidebar a:hover {
    background-color: rgba(0,0,0,0.1);
}

.sidebar-title {
    font-family: 'Lora', serif;
    font-weight: 900;
    font-size: 2rem;
    text-align: center;
    margin: 0 0 20px 0;
    color: var(--text-color);
}

/* --- BOTTOM SIDEBAR ACTIONS --- */

.sidebar-bottom-actions {
    margin-top: auto; /* Pushes this whole block to the bottom */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between buttons */
    width: 100%;
}

.sidebar-divider {
    width: 100%;
    height: 1px;
    background-color: var(--text-color);
    border: none;
    margin: 0;
}

/* Secondary button style (like News/Contact) */
.sidebar-button-secondary {
    display: block !important;
    padding: 10px 20px !important;
    background-color: transparent !important;
    color: var(--text-color) !important;
    border: 2px solid var(--text-color) !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    font-family: 'Lora', serif !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.sidebar-button-secondary:hover {
    background-color: #2a2a2a !important;
    border-color: #2a2a2a !important;
    color: var(--white) !important;
}

/* Primary button style (like original Login) */
.sidebar-button-primary {
    display: block !important;
    padding: 10px 20px !important;
    background-color: var(--text-color) !important;
    color: var(--white) !important;
    border: 2px solid var(--text-color) !important;
    border-radius: 30px !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    font-family: 'Lora', serif !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
}

.sidebar-button-primary:hover {
    background-color: #555 !important;
    border-color: #555 !important;
}

/* --- Mobile Overlay --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000; /* Below sidebar, above content */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

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