/* 
 * Fuel Dispense Sheet Admin - Custom Styles
 * Main stylesheet with modern typography and enhanced aesthetics
 */

:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    
    /* Override Bootstrap font variables */
    --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    --bs-body-font-size: 0.875rem !important;
}

body {
    font-family: var(--font-family) !important;
    font-weight: 400;
    line-height: 1.6;
    padding-top: 56px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
    margin: 0 !important;
}

/* Modern typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family) !important;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.h1, .h2 {
    font-weight: 700 !important;
    letter-spacing: -0.03em;
}

/* Sidebar styling */
.sidebar {
    position: fixed !important;
    top: 56px !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1000 !important;
    width: 16.66667% !important; /* col-md-2 equivalent */
    overflow-y: auto !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    transform: translateX(0) !important;
    transition: transform 0.3s ease-in-out !important;
    background-color: var(--secondary-color);
    color: white;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.75);
    padding: 0.75rem 1rem;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
    color: white;
    border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link.active {
    color: white;
    border-left: 3px solid var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

.sidebar .nav-link i {
    margin-right: 10px;
}

/* Main content area */
.main-content {
    margin-left: 16.66667% !important; /* Same as sidebar width */
    padding-top: 1rem !important;
    flex: 1;
}

/* Form styling */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Card styling */
.card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 20px;
    border-radius: 0.5rem;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Table styling */
.table-container {
    overflow-x: auto;
}

.table th {
    background-color: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Equipment Table Styling - Modern and Compact */
.equipment-datatable {
    font-size: 0.875rem !important; /* 14px - slightly smaller than default */
    font-family: var(--font-family) !important;
    font-weight: 400 !important;
}

.equipment-datatable thead th {
    font-size: 0.85rem !important; /* 13.6px - compact header */
    font-weight: 600 !important;
    font-family: var(--font-family) !important;
    letter-spacing: -0.01em;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    color: var(--dark-color);
    white-space: nowrap; /* Prevent header wrapping */
    vertical-align: middle;
}

.equipment-datatable tbody td {
    font-size: 0.875rem !important; /* 14px */
    font-family: var(--font-family) !important;
    padding: 0.65rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    white-space: nowrap; /* Prevent cell wrapping for most columns */
}

/* Allow wrapping only for model column if needed */
.equipment-datatable tbody td:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    max-width: 200px;
}

.equipment-datatable tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.08);
    transition: background-color 0.15s ease-in-out;
}

/* Modern button styling in table */
.equipment-datatable .btn-group-sm .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

/* Modern form controls */
.form-control, .form-select {
    font-family: var(--font-family);
    font-size: 0.875rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Modern button styling */
.btn {
    font-family: var(--font-family);
    font-weight: 500;
    letter-spacing: -0.01em;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

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

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-1px);
}

/* Footer styling */
footer {
    margin-top: auto;
    padding: 20px 0;
    background-color: var(--light-color);
    border-top: 1px solid #eee;
    text-align: center;
}

/* Utility classes */
.required-field::after {
    content: "*";
    color: var(--danger-color);
    margin-left: 3px;
}

/* Navbar and layout fixes */
.navbar {
    height: 56px; /* Fixed navbar height */
}

.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    padding: 0.25rem 0.5rem !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
    width: 1.5em !important;
    height: 1.5em !important;
}

body {
    padding-top: 56px !important; /* Exact navbar height */
    margin: 0 !important;
}

.container-fluid {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.row {
    margin-top: 0 !important;
}

.sidebar {
    position: fixed !important;
    top: 56px !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1000 !important;
    width: 16.66667% !important; /* col-md-2 equivalent */
    overflow-y: auto !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    transform: translateX(0) !important;
    transition: transform 0.3s ease-in-out !important;
}

.main-content {
    margin-left: 16.66667% !important; /* Same as sidebar width */
    padding-top: 1rem !important;
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 75% !important;
        transform: translateX(-100%) !important;
    }
    
    .sidebar.show {
        transform: translateX(0) !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .navbar-toggler {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .navbar-toggler {
        display: none !important;
    }
    
    .sidebar {
        transform: translateX(0) !important;
    }
}

/* Final font overrides - loaded last to ensure precedence, excluding Font Awesome */
body,
html,
.container,
.container-fluid,
.row,
.col,
.card,
.btn:not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]),
.form-control,
.nav,
.navbar,
input,
select,
textarea,
label,
p,
span:not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]),
div:not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]),
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* DataTables final overrides - excluding Font Awesome */
.dataTables_wrapper,
.dataTables_wrapper *:not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]):not(i[class*="fa"]),
table.dataTable,
table.dataTable *:not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]):not(i[class*="fa"]),
.equipment-datatable,
.equipment-datatable *:not(.fa):not(.fas):not(.far):not(.fab):not([class*="fa-"]):not(i[class*="fa"]) {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    font-size: 0.875rem !important;
}

table.dataTable thead th,
.equipment-datatable thead th {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
}

/* Force smaller text overall - excluding Font Awesome */
body {
    font-size: 14px !important;
}

/* Ensure Font Awesome icons maintain their font family */
.fa, .fas, .far, .fab, .fal, .fad, .fat, .fass,
[class*="fa-"],
i[class*="fa"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
}