/* =========================================
   Global Main Interface Styles
   Supports both the SPA Dashboard (home.php) and Auth / Logout / Testimonials pages
   ========================================= */
:root {
    /* Core Brand & SPA Variables */
    --primary-color: #8D6E63;
    --primary-dark: #5D4037;
    --primary-darker: #3E2723;
    --primary-light: #D7CCC8;
    --primary-medium: #8D6E63;
    --secondary-color: #A1887F;
    --accent-color: #D7CCC8;
    --bg-light: #F8F9FA;
    --bg-secondary: #F4F6F9;
    --bg-tertiary: #EFEBE9;
    --bg-cream: #FDFBF9;
    --text-primary: #3E2723;
    --text-secondary: #5D4037;
    --text-dark: #3E2723;
    --text-muted: #6C757D;
    --text-light: #FFFFFF;
    --border-light: #E5E7EB;
    --sidebar-width: 270px;
    --gradient-primary: linear-gradient(135deg, #8D6E63 0%, #4E342E 100%);
    --gradient-secondary: linear-gradient(135deg, #5D4037 0%, #3E2723 100%);
    --shadow-light: 0 2px 10px rgba(62, 39, 35, 0.08);
    --shadow-medium: 0 6px 20px rgba(62, 39, 35, 0.14);
    --shadow-heavy: 0 12px 36px rgba(62, 39, 35, 0.22);
    --transition-bounce: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);

    /* Auth Stylesheet Variables (login.css, loginverification.css, resetpassword.css, logout.css) */
    --primary-blue-light: #E0F7FA;
    --primary-blue: #81D4FA;
    --glass-white: rgba(255, 255, 255, 0.92);
    --white: #FFFFFF;
    --brown-dark: #4E342E;
    --brown-teddy: #8D6E63;
    --brown-light: #D7CCC8;
    --danger: #D32F2F;
    --success: #2E7D32;
    --radius: 16px;
    --shadow-sm: 0 2px 8px rgba(141, 110, 99, 0.15);
    --shadow-md: 0 8px 24px rgba(141, 110, 99, 0.22);
    --shadow-lg: 0 12px 32px rgba(141, 110, 99, 0.25);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F4F6F9;
    color: var(--text-dark);
    overflow-x: hidden;
}

.admin-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--gradient-secondary);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    box-shadow: var(--shadow-medium);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1.15rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.12);
}

.sidebar-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 50%;
    background: #ffffff;
    padding: 4px;
    margin: 0 auto 0.5rem;
    display: block;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.sidebar-header p {
    font-size: 0.78rem;
    margin: 0.2rem 0 0;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    padding: 0.75rem 0.65rem 2rem;
    flex: 1;
}

.nav-section {
    margin-bottom: 0.65rem;
}

.nav-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent-color);
    cursor: pointer;
    border-radius: 8px;
    user-select: none;
    transition: background 0.2s ease;
}

.nav-section-title:hover {
    background: rgba(255, 255, 255, 0.08);
}

.nav-section-chevron {
    font-size: 0.7rem;
    transition: transform 0.25s ease;
}

.nav-section.collapsed .nav-section-chevron {
    transform: rotate(-90deg);
}

.nav-subtabs {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.2rem;
}

.nav-link,
.lms-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.95rem;
    color: rgba(255, 255, 255, 0.85) !important;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link i,
.lms-nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.nav-link:hover,
.lms-nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff !important;
    transform: translateX(3px);
}

.nav-link.active {
    background: var(--primary-color);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.content-header {
    background: #ffffff;
    border-bottom: 1px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-light);
}

/* Mobile Navigation Toggle & Overlay */
.nav-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1050;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: var(--shadow-medium);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.nav-overlay.active {
    display: block;
}

/* Transitions & Utilities */
.fade-in {
    animation: fadeInContent 0.25s ease-in-out;
}

.fade-out {
    opacity: 0;
    transform: translateY(-6px);
    transition: all 0.18s ease;
}

.loading-content {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-header {
        padding-left: 4rem !important;
    }
}