/* Custom styles for Miriad Haulage Jobs */

:root {
    --primary-color: #FF6700;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --miriad-orange: #FF6700;
    --miriad-orange-light: #FF8533;
    --miriad-orange-dark: #E55A00;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    padding-top: 56px; /* Account for fixed navbar */
}

body.admin-body {
    padding-top: 0;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.form-control, .form-select {
    border-radius: 0.375rem;
}

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

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

.badge {
    font-size: 0.8em;
}

/* Job card styles */
.job-card {
    border-left: 4px solid var(--primary-color);
}

.job-card.featured {
    border-left-color: var(--warning-color);
}

.job-card.urgent {
    border-left-color: var(--danger-color);
}

/* Form styles */
.form-label {
    font-weight: 600;
    color: #495057;
}

.required {
    color: var(--danger-color);
}

/* Dashboard styles */
.dashboard-card {
    background: linear-gradient(135deg, var(--miriad-orange) 0%, var(--miriad-orange-dark) 100%);
    color: white;
    border: none;
}

.dashboard-card .card-body {
    padding: 2rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* Filter sidebar */
.filter-sidebar {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

/* Application status badges */
.status-pending {
    background-color: var(--warning-color);
    color: #000;
}

.status-accepted {
    background-color: var(--success-color);
    color: #fff;
}

.status-rejected {
    background-color: var(--danger-color);
    color: #fff;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }

    .lead {
        font-size: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom checkbox and radio styles */
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Table styles */
.table {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.border-success {
    border-color: var(--success-color) !important;
}

/* Animation for page transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo styles */
.navbar-brand img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

/* Miriad orange theme overrides */
.btn-primary {
    background-color: var(--miriad-orange);
    border-color: var(--miriad-orange);
}

.btn-primary:hover {
    background-color: var(--miriad-orange-dark);
    border-color: var(--miriad-orange-dark);
}

.btn-outline-primary {
    color: var(--miriad-orange);
    border-color: var(--miriad-orange);
}

.btn-outline-primary:hover {
    background-color: var(--miriad-orange);
    border-color: var(--miriad-orange);
}

.text-primary {
    color: var(--miriad-orange) !important;
}

.bg-primary {
    background-color: var(--miriad-orange) !important;
}

.border-primary {
    border-color: var(--miriad-orange) !important;
}

/* Card hover effects with orange theme */
.card:hover .card-title {
    color: var(--miriad-orange);
}

/* Form focus states */
.form-control:focus, .form-select:focus {
    border-color: var(--miriad-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 103, 0, 0.25);
}

/* Admin panel gradient update */
.admin-sidebar {
    background: #f8f9fa !important;
    border-right: 1px solid #dee2e6;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.05);
    margin-top: 0.5rem;
}

@media (max-width: 767.98px) {
    .admin-sidebar {
        margin-top: 0;
    }
}

/* Footer positioning */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* Override body padding when sidebar is present */
body.with-driver-sidebar {
    padding-left: 0 !important;
}

/* Fix dropdown z-index issues globally */
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

.dropdown {
    position: relative !important;
    z-index: 9998 !important;
}

.dropdown.show .dropdown-menu {
    z-index: 9999 !important;
}

/* Ensure cards don't interfere with dropdowns */
.card {
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.card-body {
    overflow: visible !important;
}

/* Specific fix for document cards */
.document-item {
    position: relative;
    z-index: 1;
}

.document-item .dropdown {
    z-index: 9998 !important;
}

.document-item .dropdown-menu {
    z-index: 9999 !important;
}

/* Footer link styling */
.footer-link {
    color: white !important;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-link:hover {
    color: #FF6700 !important; /* Orange text on hover */
    background-color: white !important; /* White background on hover */
}

/* Driver Sidebar Styling */
.driver-sidebar {
    position: fixed;
    top: 56px; /* Start below the sticky navbar height */
    left: 0;
    height: calc(100vh - 56px); /* Full height minus navbar */
    width: 250px;
    background: white;
    border-right: 3px solid var(--miriad-orange);
    color: var(--miriad-orange);
    z-index: 100; /* Lower than header/footer */
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 30px 20px 20px 20px;
    border-bottom: 1px solid rgba(255, 103, 0, 0.2);
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-avatar {
    width: 50px;
    height: 50px;
    background: var(--miriad-orange);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.driver-details h6 {
    margin: 0;
    font-weight: 600;
    color: var(--miriad-orange);
}

.driver-details small {
    color: rgba(255, 103, 0, 0.7);
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav .nav-link {
    color: var(--miriad-orange);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    border: none;
    border-radius: 0;
}

.sidebar-nav .nav-link:hover {
    background-color: rgba(255, 103, 0, 0.1);
    color: var(--miriad-orange-dark);
    transform: translateX(5px);
}

.sidebar-nav .nav-link.active {
    background-color: rgba(255, 103, 0, 0.15);
    color: var(--miriad-orange-dark);
    border-right: 3px solid var(--miriad-orange);
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    color: var(--miriad-orange);
    transition: color 0.2s ease-in-out;
}

.sidebar-nav .nav-link:hover i,
.sidebar-nav .nav-link.active i {
    color: var(--miriad-orange-dark);
}

.sidebar-divider {
    border-color: rgba(255, 103, 0, 0.2);
    margin: 20px 0;
}

/* Adjust main content when sidebar is present */
body.with-driver-sidebar .main-content {
    margin-left: 250px;
    padding-top: 76px; /* Account for fixed header height + some spacing */
    min-height: calc(100vh - 56px); /* Account for navbar height */
}

/* Keep header and footer completely independent - full width */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000 !important;
    width: 100% !important;
    margin-left: 0 !important;
}

footer {
    position: relative;
    z-index: 1000 !important;
    width: 100% !important;
    margin-left: 0 !important;
    left: 0 !important;
    clear: both;
}


/* Mobile menu dropdown - hidden by default on desktop */
.mobile-menu-dropdown {
    display: none;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    /* Hide sidebar on mobile */
    .driver-sidebar {
        display: none !important;
    }

    /* Remove sidebar offset on mobile */
    body.with-driver-sidebar {
        padding-left: 0;
    }

    body.with-driver-sidebar .main-content {
        margin-left: 0 !important;
    }

    /* Show mobile menu dropdown */
    .mobile-menu-dropdown {
        display: block !important;
    }
}

@media (min-width: 769px) {
    /* Show sidebar on desktop */
    .driver-sidebar {
        display: block !important;
    }

    /* Hide mobile menu dropdown on desktop */
    .mobile-menu-dropdown {
        display: none !important;
    }
}

/* Comprehensive Mobile Responsive Styles */
@media (max-width: 767px) {
    /* Remove sidebar offset on mobile */
    body.with-driver-sidebar .main-content {
        margin-left: 0 !important;
    }

    /* Container adjustments */
    .container, .container-fluid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Card adjustments */
    .card {
        margin-bottom: 1rem;
    }

    .card-header h5, .card-header h4 {
        font-size: 1rem;
        line-height: 1.4;
        word-wrap: break-word;
    }

    .card-header small {
        font-size: 0.85rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Typography */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.95rem;
    }

    /* Buttons */
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .btn-lg {
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }

    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    /* Forms */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }

    .form-control, .form-select {
        font-size: 0.9rem;
    }

    /* Tables - make them scrollable */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.85rem;
    }

    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Alert messages */
    .alert {
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    /* Badge adjustments */
    .badge {
        font-size: 0.75rem;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }
}

/* Extra small devices (320px - 375px) */
@media (max-width: 375px) {
    /* Further reduce padding */
    .container, .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .card-body {
        padding: 0.75rem;
    }

    /* Typography */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    h4, h5 {
        font-size: 1rem;
    }

    h6 {
        font-size: 0.9rem;
    }

    /* Buttons */
    .btn {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    /* Forms */
    .form-label {
        font-size: 0.85rem;
    }

    .form-control, .form-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    /* Tables */
    table {
        font-size: 0.75rem;
    }

    /* Navbar */
    .navbar-brand {
        font-size: 1rem;
    }

    /* Card headers */
    .card-header h5, .card-header h4 {
        font-size: 0.9rem;
    }
}
