/* ============================================
    FUEL TRACKER - CUSTOM STYLES
    ============================================ */

/* CSS Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* ============================================
    GENERAL STYLES
    ============================================ */

body {
    font-family: -apple-system, BlinkMacMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

/* ============================================
    NAVIGATION
    ============================================ */

.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar .nav-link {
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-radius: 0.25rem;
}

.navbar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar .nav-link.active {
    font-weight: 500;
}

/* ============================================
    CARDS
    ============================================ */

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* ============================================
    STAT CARDS
    ============================================ */

.stat-card {
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
}

.stat-card h6 {
    color: #6c757d;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-icon.bg-primary {
    background-color: var(--primary-color);
}

.stat-icon.bg-success {
    background-color: var(--success-color);
}

.stat-icon.bg-info {
    background-color: var(--info-color);
}

.stat-icon.bg-warning {
    background-color: var(--warning-color);
}

.stat-icon.bg-danger {
    background-color: var(--danger-color);
}

/* ============================================
    TABLES
    ============================================ */

.table {
    background-color: white;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr {
    transition: background-color 0.2s ease;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

.table-responsive {
    border-radius: 0.25rem;
}

/* ============================================
    BADGES
    ============================================ */

.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge i {
    font-size: 0.875em;
}

/* ============================================
    BUTTONS
    ============================================ */

.btn {
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* ============================================
    FORMS
    ============================================ */

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #212529;
}

.form-control,
.form-select {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    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(13, 110, 253, 0.25);
    outline: 0;
}

.form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Password Strength Indicator */
.progress {
    height: 5px;
    border-radius: 0.25rem;
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.3s ease, background-color 0.3s ease;
}

#passwordStrength.weak {
    background-color: var(--danger-color);
}

#passwordStrength.medium {
    background-color: var(--warning-color);
}

#passwordStrength.strong {
    background-color: var(--success-color);
}

/* ============================================
    ALERTS
    ============================================ */

.alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0a3622;
}

.alert-danger {
    background-color: #f8d7da;
    color: #58151c;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

.alert-dismissible .btn-close {
    padding: 1.25rem 1rem;
}

/* ============================================
    CHARTS
    ============================================ */

canvas {
    max-height: 300px;
}

/* ============================================
    DROPDOWN MENUS
    ============================================ */

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
}

.dropdown-item {
    transition: background-color 0.2s ease;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item i {
    margin-right: 0.5rem;
    width: 1rem;
    text-align: center;
}

.dropdown-divider {
    margin: 0.5rem 0;
}

/* ============================================
    LOGIN / REGISTER PAGES
    ============================================ */

body.bg-light {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.login-page .card,
.register-page .card {
    animation: fadeIn 0.5s ease;
}

/* ============================================
    UTILITIES
    ============================================ */

.text-primary {
    color: var(--primary-color) !important;
}

.text-muted {
    color: #6c757d !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
    SCROLLBAR
    ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
    ANIMATIONS
    ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.alert {
    animation: fadeIn 0.3s ease;
}

/* ============================================
    RESPONSIVE
    ============================================ */

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    canvas {
        max-height: 200px;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* ============================================
    PRINT STYLES
    ============================================ */

@media print {
    .navbar,
    .btn,
    .card-header .badge,
    .dropdown-toggle {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        page-break-inside: avoid;
    }
    
    body {
        background: white;
    }
}

/* ============================================
    LOADING SPINNER
    ============================================ */

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* ============================================
    CUSTOM COMPONENTS
    ============================================ */

/* Vehicle Selector */
.vehicle-selector {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
}

/* Fillup Icons */
.fillup-partial {
    color: var(--warning-color);
}

.fillup-full {
    color: var(--success-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ============================================
    TABLE CLICKABLE ROWS (New)
    ============================================ */

/* Ensures the cursor changes to indicate clickability */
.clickable-row {
    cursor: pointer;
}

/* CRITICAL: Wraps the TR contents in a link and ensures the link acts as a table row */
a.table-row-link {
    display: contents; /* Allows the link content to act as the row itself */
    color: inherit; /* Prevents blue link text */
    text-decoration: none; /* Removes underline */
}

/* Ensures the entire linked row gets a hover effect */
a.table-row-link:hover > tr {
    background-color: #f8f9fa !important; /* Matches existing .table-hover hover color */
}

/* Remove default table-hover behavior on the tr element when it's wrapped by our link */
.table-hover tbody tr:hover {
    background-color: transparent; /* Resetting default Bootstrap hover */
}


/* ============================================
    ACCESSIBILITY
    ============================================ */

.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}