/**
 * Custom styles for Fleety Fleet Management System
 */

/* General Styles */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 1280px;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.card-header {
    border-bottom: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
    padding: 1rem 1.5rem;
}

/* Backgrounds */
.bg-primary-dark {
    background-color: #0062cc;
}

.bg-success-dark {
    background-color: #1e7e34;
}

.bg-warning-dark {
    background-color: #d39e00;
}

.bg-info-dark {
    background-color: #117a8b;
}

/* Tables */
.table th {
    font-weight: 600;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* QR Code Scanner */
#qr-reader {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    overflow: hidden;
}

#qr-reader img {
    width: 100%;
}

/* Camera Container */
#camera-container {
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    overflow: hidden;
}

/* Progress */
.progress {
    height: 1.5rem;
    font-size: 0.8rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    transition: width 0.6s ease;
}

/* Stats Cards */
.stat-card {
    border-radius: 0.5rem;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .icon {
    font-size: 3rem;
    opacity: 0.2;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

/* Buttons */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info {
    color: white;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-dismissible .btn-close {
    padding: 1rem;
}

/* Dashboard Cards */
.dashboard-card {
    height: 100%;
    transition: all 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* QR Code Display */
.qr-code-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.qr-code {
    margin: 0 auto;
    max-width: 200px;
}

.qr-code img {
    width: 100%;
    height: auto;
}

/* Footer */
footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        border: none;
    }
    
    #qr-reader {
        width: 100%;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn-group .btn {
        display: inline-block;
        width: auto;
        margin-bottom: 0;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Image Preview */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 0.25rem;
    margin-top: 0.5rem;
    display: none;
}

/* Map Container */
.map-container {
    height: 300px;
    border-radius: 0.25rem;
    overflow: hidden;
}

/* OCR Result */
.ocr-result {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-top: 1rem;
    border: 1px dashed #ced4da;
}

.ocr-highlight {
    background-color: #fff3cd;
    padding: 0.2rem;
    border-radius: 0.25rem;
}

/* Admin Dashboard */
.admin-dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-stat-card {
    flex: 1;
    min-width: 220px;
    padding: 1.5rem;
    border-radius: 0.5rem;
    background-color: white;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.admin-stat-card h4 {
    margin: 0;
    font-size: 1rem;
    color: #6c757d;
}

.admin-stat-card h2 {
    margin: 0.5rem 0 0 0;
    font-size: 2rem;
}

/* Vehicle Cards */
.vehicle-card {
    border-radius: 0.5rem;
    transition: transform 0.3s;
    height: 100%;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.vehicle-card .card-header {
    padding: 0.75rem 1.25rem;
}

.vehicle-card .card-body {
    padding: 1.25rem;
}

.vehicle-card .card-footer {
    padding: 0.75rem 1.25rem;
    background-color: rgba(0, 0, 0, 0.03);
}

/* Session Timeline */
.session-timeline {
    position: relative;
    padding-left: 2rem;
}

.session-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0.5rem;
    width: 2px;
    background-color: #e9ecef;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #007bff;
    border: 2px solid white;
}

.timeline-item.success::before {
    background-color: #28a745;
}

.timeline-item.warning::before {
    background-color: #ffc107;
}

.timeline-item.danger::before {
    background-color: #dc3545;
}

/* Highlight numbers in logs */
.highlight-number {
    font-weight: bold;
    color: #007bff;
}