/* /assets/template/global.css */

/* --- UNIVERSAL RESET & SIZING --- */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary: #b85c38;
    --primary-hover: #e27042;
    --bg-main: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-panel: #111111;
    --border: #333333;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    
    --sidebar-w: 260px;
    --topbar-h: 70px;
    --bottombar-h: 65px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden; /* Prevents horizontal scroll on mobile */
}

/* --- THE MASTER FLEXBOX APP LAYOUT --- */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.main-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background-color: var(--bg-main);
}

/* --- SIDEBAR COMPONENT --- */
.sidebar {
    width: var(--sidebar-w);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-list li {
    margin: 0;
    padding: 0;
}

.sidebar-nav-list a, .nav-divider {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    user-select: none;
}

.sidebar-nav-list a i {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

.sidebar-nav-list a:hover, .nav-divider:hover {
    background-color: var(--bg-card);
    color: var(--primary);
}

.sidebar-nav-list a.active {
    background-color: var(--bg-card);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* Sidebar Section Headers */
.sidebar-nav-list li.nav-section {
    padding: 25px 20px 10px 20px;
    font-size: 0.75rem;
    color: #666666;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: default;
    user-select: none;
}

/* Sidebar Accordion Menus (From your Staging Code) */
.nav-group-items {
    list-style: none;
    padding: 0;
    background-color: #080808;
    display: none;
}

.nav-group-items.expanded {
    display: block;
}

.nav-group-items li a {
    padding-left: 55px;
    font-size: 0.85rem;
    border-left: none;
}

.nav-divider {
    justify-content: space-between;
}

.nav-divider i.fa-chevron-down {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-divider.open i.fa-chevron-down {
    transform: rotate(180deg);
}

/* --- TOPBAR COMPONENT --- */
.topbar {
    height: var(--topbar-h);
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    z-index: 900;
}

/* Mobile Toggle Hamburger Icon */
.mobile-toggle {
    display: none; 
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}

/* --- BOTTOMBAR COMPONENT (MOBILE) --- */
.bottombar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottombar-h);
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border);
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottombar-nav {
    height: 100%;
    width: 100%;
}

.bottombar-nav .sidebar-nav-list {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bottombar-nav .sidebar-nav-list li {
    flex: 1; /* This forces each button to take up equal width */
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bottombar-nav .sidebar-nav-list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 4px; /* Space between icon and text */
}

.bottombar-nav .sidebar-nav-list a i {
    width: auto;
    margin: 0 !important;
    font-size: 1.3rem;
    color: var(--text-muted);
}

.bottombar-nav .sidebar-nav-list a.active,
.bottombar-nav .sidebar-nav-list a.active i {
    color: var(--primary) !important;
}

/* Ensure icons/text don't wrap and hide headers */
.bottombar-nav .nav-section, 
.bottombar-nav .nav-divider { display: none !important; 
}

/* Hide section headers and dropdown carets in bottom bar */
.bottombar-nav .nav-divider,
.bottombar-nav .nav-group-items,
.bottombar-nav .nav-section { display: none !important; }

/* --- UI COMPONENTS (Cards & Buttons) --- */
.service-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-primary, .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(184, 92, 56, 0.3);
    color: #fff;
}

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--primary);
    color: #fff;
}

/* --- UTILITIES --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.desktop-only { display: flex; }
.mobile-only { display: none; }

/* --- RESPONSIVE BREAKPOINTS (Mobile) --- */
@media (max-width: 992px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
    .bottombar { display: block; }
    .mobile-toggle { display: block; } /* Shows the hamburger menu on mobile */
    
    .topbar { padding: 0 15px; }

    .content-area {
        padding: 20px 15px;
        padding-bottom: calc(var(--bottombar-h) + 30px);
    }

    /* Mobile Sidebar Sliding Logic */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.9);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
}