/* Forestry Management System - Clean Dark Theme */

/* Dark theme variables */
:root {
    --bs-dark: #212529;
    --bs-dark-rgb: 33, 37, 41;
    --bs-light: #f8f9fa;
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
    --bs-info: #0dcaf0;
    
    /* Custom variables for consistency */
    --sidebar-width: 260px;
    --navbar-height: 56px;
}

/* Force desktop layout - no mobile responsive behavior */
body {
    min-width: 1200px !important;
    background-color: var(--bs-dark) !important;
    color: var(--bs-light) !important;
    overflow-x: auto;
}

html {
    min-width: 1200px !important;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background-color: #1a1d20;
    border-right: 1px solid #495057;
    /* Keep scrollbar on inner container to prevent overlap with toggle */
    overflow: hidden;
    z-index: 100;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #2c3034;
}

.sidebar-header .logo {
    color: var(--bs-light);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
}

.sidebar-header .logo i {
    margin-right: 0.5rem;
    color: var(--bs-primary);
}

.sidebar.collapsed .sidebar-header .logo span {
    display: none;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
}


.nav-section {
    margin-bottom: 1.5rem;
}

.nav-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Support existing h6 headings used in templates */
.sidebar-heading {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #2c3034;
    color: var(--bs-light);
}

.nav-link.active {
    background-color: var(--bs-primary);
    color: white;
}

.nav-link i {
    width: 1.5rem;
    text-align: center;
    margin-right: 0.75rem;
}

.sidebar.collapsed .nav-link span {
    display: none;
}

.sidebar.collapsed .nav-header,
.sidebar.collapsed .sidebar-heading {
    display: none;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

/* Sidebar Toggle Button - fixed circular button near content edge */
.sidebar-toggle {
    position: fixed;
    top: calc(var(--navbar-height) + 12px);
    left: calc(var(--sidebar-width) + 12px);
    z-index: 1001;
    background: #2c3034;
    color: var(--bs-light);
    border: 1px solid #495057;
    width: 36px;
    height: 36px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    cursor: pointer;
}

.sidebar-toggle:hover {
    background: #3a3f44;
    color: #fff;
}

.sidebar-toggle i { pointer-events: none; }

/* Main Content Area */
.content-wrapper {
    margin-left: var(--sidebar-width);
    padding: calc(var(--navbar-height) + 1.5rem) 1.5rem 1.5rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.sidebar.collapsed ~ .content-wrapper {
    margin-left: 60px;
}

/* Cards */
.card {
    background-color: #2c3034;
    border: 1px solid #495057;
    color: var(--bs-light);
}

.card-header {
    background-color: #343a40;
    border-bottom: 1px solid #495057;
    color: var(--bs-light);
}

/* Tables */
.table-dark {
    --bs-table-bg: #2c3034;
    --bs-table-striped-bg: #343a40;
    --bs-table-hover-bg: #373b3e;
    --bs-table-border-color: #495057;
    color: var(--bs-light);
}

/* Forms */
.form-control {
    background-color: #343a40;
    border: 1px solid #495057;
    color: var(--bs-light);
}

.form-control:focus {
    background-color: #343a40;
    border-color: var(--bs-primary);
    color: var(--bs-light);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select {
    background-color: #343a40;
    border: 1px solid #495057;
    color: var(--bs-light);
}

.form-select:focus {
    background-color: #343a40;
    border-color: var(--bs-primary);
    color: var(--bs-light);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Buttons - use Bootstrap's built-in dark theme styles */
.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-secondary {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* Alerts */
.alert {
    border: none;
}

/* Navigation bar */
.navbar-dark {
    background-color: #1a1d20 !important;
}

/* Dropdowns */
.dropdown-menu {
    background-color: #2c3034;
    border: 1px solid #495057;
}

.dropdown-item {
    color: var(--bs-light);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #343a40;
    color: var(--bs-light);
}

/* Fix text colors */
h1, h2, h3, h4, h5, h6 {
    color: var(--bs-light);
}

.text-muted {
    color: #6c757d !important;
}

/* Ensure consistent spacing and layout */
.container-fluid {
    max-width: none;
}

/* Remove any mobile responsive behavior */
@media (max-width: 1400px) {
    .container, .container-fluid, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
        max-width: none !important;
        width: 100% !important;
    }
}

/* Force desktop layout for all Bootstrap components */
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6,
.col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12,
.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6,
.col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12,
.col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6,
.col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 {
    flex: 0 0 auto !important;
}

/* Force tables to be horizontally scrollable instead of stacking */
.table-responsive {
    overflow-x: auto !important;
}

.table {
    min-width: 700px !important;
}

/* Hide any mobile-specific elements */
.d-block.d-md-none,
.d-sm-block.d-md-none,
.d-lg-none,
.d-xl-none {
    display: none !important;
}

/* Show desktop-only elements */
.d-none.d-md-block,
.d-none.d-lg-block,
.d-none.d-xl-block {
    display: block !important;
}

.d-none.d-md-flex,
.d-none.d-lg-flex,
.d-none.d-xl-flex {
    display: flex !important;
}

.sidebar-content {
    padding: 1rem 0;
}
