/* styles/layout/app-layout.css */

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding-left: var(--sidebar-width); /* Offset by sidebar width */
    transition: padding-left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed + .main-content {
    padding-left: var(--sidebar-width-collapsed); /* Adjust offset when collapsed */
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--theme-border);
    background-color: var(--theme-background); /* Ensure bg */
    height: var(--header-height);
    position: sticky; /* Keep header visible */
    top: 0;
    z-index: 900; /* Below sidebar */
}

.content-header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--theme-text);
}

/* Status Bar */
.status-bar {
    padding: 0; /* Remove padding */
    background-color: transparent; /* Make transparent */
    font-size: 0.8rem;
    color: var(--theme-text-secondary);
    border: none; /* Remove border */
    margin: 0; /* Remove margin */
    display: flex;
    gap: 1rem;
}

.status-item { /* Style for individual status items */
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.status-item code {
    font-size: 1em;
    color: var(--theme-text);
    background-color: transparent;
    padding: 0;
    word-break: break-all;
}

/* Content Section */
.content-section {
    padding: 1.5rem;
    flex-grow: 1; /* Allow content to fill space */
}

/* General Section Styling */
.content-section > section { /* Space between sections within a content page */
    margin-bottom: 2rem;
    /* border-bottom: 1px dashed var(--theme-border); Removed border for My Reports */
}

.content-section > section:last-child {
    /* border-bottom: none; */
    margin-bottom: 0;
}

.content-section h2 { /* Style for main section titles */
    font-size: 1.3rem;
    color: var(--theme-accent);
    margin-top: 0;
    margin-bottom: 1rem;
}

.content-section h3 { /* Style for sub-sections */
    font-size: 1.15rem;
    color: var(--theme-text);
    margin-top: 1rem;
    margin-bottom: 0.8rem;
}

/* Section Header Bar */
.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--theme-border);
}

.section-header-bar h2 {
    margin: 0;
    color: var(--theme-accent);
    font-size: 1.4rem;
}

.section-actions {
    display: flex;
    gap: 1rem;
}

.section-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.section-actions button i.fa-spin {
    animation: fa-spin 1s linear infinite;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .section-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .section-header-bar h2 {
        font-size: 1.3rem;
    }

    .main-content {
        padding-left: 0; /* No fixed padding */
    }

    .content-header {
        padding-left: 4.5rem; /* Increased space for toggle button */
        position: relative; /* Needed for absolute positioning of toggle */
    }

    .content-header h1 { 
        font-size: 1.3rem; 
    }

    .status-bar { 
        display: none; 
    } /* Hide status bar on small screens */
}

/* Mobile Sidebar Overlay */
#mobile-sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
    z-index: 999; /* Below sidebar (1000), above content */
    display: none; /* Hidden by default */
    cursor: pointer;
}

/* Sidebar Toggle Button (MOVED BUTTON) */
#sidebar-toggle-btn { /* Selector now targets the MOVED button */
    display: block !important; /* Ensure it's visible now that it's in the header */
    position: absolute;
    left: 0.8rem; /* Adjust position */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002; /* Above sidebar */
    font-size: 1.5rem; /* Make larger */
    color: var(--theme-text); /* Make sure it's visible */
    padding: 0.5rem;
    display: block !important; /* Ensure it's always visible */
}

/* Animation for fa-spin */
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}