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

/* FIX: Universal Box Sizing ensures padding never breaks width calculations */
*, *::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;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

.main-wrapper {
    margin-left: var(--sidebar-w);
    padding-top: var(--topbar-h);
    min-height: 100vh;
    transition: all 0.3s ease;
}

.content-area {
    padding: 30px;
}

.sidebar {
    width: var(--sidebar-w);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

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

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-links li 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;
}

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

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

.nav-icon {
    width: 25px;
    text-align: center;
    margin-right: 10px;
}

.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-group-items li a.active {
    border-left: none;
    color: var(--primary);
}

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

.nav-divider span {
    display: flex;
    align-items: center;
}

.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);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
}

.sidebar-footer a {
    color: #F44336;
    text-decoration: none;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: #ff6659;
}

.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;
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    z-index: 900;
    transition: left 0.3s ease;
    box-sizing: border-box;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
}

.bottom-bar .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    background: none;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 5px;
}

.bottom-bar .nav-item i {
    font-size: 1.2rem;
    margin-bottom: 3px;
}

.bottom-bar .nav-item.active {
    color: var(--primary);
}

@media (max-width: 992px) {
    .main-wrapper {
        margin-left: 0;
        padding-bottom: 70px;
    }
    
    .topbar {
        left: 0;
        padding: 0 15px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .bottom-bar {
        display: flex;
    }
}

.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;
    box-sizing: border-box; /* FIX: Applied directly to buttons as well */
}

.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;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }