/* Define color variables at the root level */
:root {
    /* Primary colors */
    --primary-color: #FD5C63;
    --primary-hover: #951A2E;
    
    /* Background colors */
    --bg-gradient-start: #2c3e50;
    --bg-gradient-end: #4a2c3e;
    
    /* UI element colors */
    --navbar-bg: #222;
    --card-bg: white;
    --success-color: #28a745;
    --success-hover: #218838;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    
    /* Text colors */
    --text-light: white;
    --text-dark: black;
    --text-muted: #818181;
}

/* Common Styles for All Pages */
body, html {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-light);
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Enhanced Navbar Styling */
.navbar {
    background: var(--navbar-bg) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 0.8rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    color: white !important;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

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

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-1px);
}

/* Active page indicator */
.nav-item.active .nav-link {
    background-color: rgba(255, 255, 255, 0.25);
    color: white !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.nav-item.active .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Visual divider between nav sections */
.nav-divider {
    width: 1px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
    align-self: center;
}

/* Special styling for logout link */
.logout-nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.4rem 1rem !important;
}

.logout-nav-link:hover {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #ff6b6b !important;
}

.logout-nav-link i {
    margin-right: 5px;
    font-size: 0.9em;
}

.navbar-toggler {
    border: none !important;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    color: white !important;
    transform: scale(1.1);
}

.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none;
}

/* Dropdown Menu Styling */
.navbar .dropdown-menu {
    background-color: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    min-width: 200px;
}

.navbar .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.6rem 1.5rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.navbar .dropdown-item i {
    margin-right: 8px;
    width: 18px;
    text-align: center;
    opacity: 0.8;
}

.navbar .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 1.8rem;
}

.navbar .dropdown-item.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.navbar .dropdown-item.active:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

/* Dropdown toggle arrow styling */
.navbar .dropdown-toggle::after {
    margin-left: 0.4em;
    vertical-align: 0.15em;
    transition: transform 0.3s ease;
}

.navbar .dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Active dropdown parent styling */
.navbar .dropdown.active > .nav-link {
    background-color: rgba(255, 255, 255, 0.25);
    color: white !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.navbar .dropdown.active > .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Icons in nav links */
.nav-link i {
    margin-right: 6px;
    font-size: 0.9em;
    opacity: 0.9;
}

/* Mobile responsive adjustments */
@media (max-width: 991px) {
    .nav-divider {
        display: none;
    }
    
    .nav-link {
        margin: 0.2rem 0;
    }
    
    .logout-nav-link {
        margin-top: 1rem;
        border-color: rgba(220, 53, 69, 0.5);
    }
    
    /* Mobile dropdown adjustments */
    .navbar .dropdown-menu {
        background-color: #1a1a1a;
        border: none;
        box-shadow: none;
        margin-top: 0;
        padding-left: 1rem;
    }
    
    .navbar .dropdown-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .navbar .dropdown-item:hover {
        padding-left: 1.3rem;
    }
}

/* Full-height wrapper for centering the login box */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full viewport height */
    margin: 0;
}

/* Styling for the login box */
.login-box {
    background: rgba(60, 74, 82, 0.3); /* Light background for contrast */
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    width: 100%;
    max-width: 400px; /* Limit the max width of the login box */
}

/* Adjust form inputs */
.form-control {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    color: white;
}

.form-control::placeholder {
    color: #ccc;
}

#loginButton {
    margin-top: 20px;
    border-radius: 30px;
    background: #FD5C63;
    border: none;
}

#loginButton:hover {
    background: #951A2E;
}

/* General Button Styles for Consistency */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 30px;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

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

/* Styling for Login/Logout Button Container */
#loginLogoutButton {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
}

/* Phone Input Wrapper Styling */
.phone-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 0;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.phone-input-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(253, 92, 99, 0.3);
}

.phone-prefix {
    color: #ccc;
    padding: 10px 0 10px 20px;
    font-weight: 500;
    user-select: none;
    pointer-events: none;
    background: transparent;
}

.phone-input {
    background: transparent;
    border: none;
    border-radius: 0;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
    padding: 10px 20px 10px 5px;
    color: white;
    flex: 1;
}

.phone-input:focus {
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
}

.phone-input::placeholder {
    color: #ccc;
}

/* Ensure phone input maintains white text color even with validation classes */
.phone-input.is-valid,
.phone-input.is-invalid {
    color: white !important;
    background: transparent !important;
}

.phone-input.is-valid:focus,
.phone-input.is-invalid:focus {
    color: white !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Container styling for the admin page (manage jobs) */
.admin-container {
    max-width: 90%; /* Default to 90% of the screen width */
    margin: 0 auto; /* Center the container */
    padding: 20px;
    transition: margin-left 0.5s;
}

/* Admin Job Card Width */
.admin-container .card {
    width: 100%;
    max-width: 1200px; /* Limit the max width of the card on larger screens */
    margin: auto;
}

/* Adjustments for Box Shadow and Padding for Card Consistency */
.card {
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    background-color: white;
    color: black;
    padding: 20px;
    margin-bottom: 30px;
}

/* Sliding Side Navigation */
.sidenav {
    height: 100%;
    width: 0; /* Hidden by default */
    position: fixed; /* Overlay on top of content */
    z-index: 2;
    top: 0;
    left: 0;
    background-color: #333;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
}

/* Dark overlay for when the menu is open */
.sidenav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    display: none;
    transition: opacity 0.5s;
}

/* Sidenav Links */
.sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #818181;
    display: block;
    transition: 0.3s;
}

.sidenav a:hover {
    color: #f1f1f1;
}

.logout-link {
    color: #ffffff;
    background-color: #DC3545;
    text-decoration: none;
    font-size: 20px;
    display: block;
    padding: 10px 32px;
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.logout-link:hover {
    background-color: #a71d2a;
}

/* Custom Button Styles for Sidenav */
.sidenav-button {
    background-color: #FD5C63;
    border: none;
    color: white;
    font-size: 18px;
    padding: 10px 15px;
    border-radius: 5px;
    display: block;
    margin: 10px auto;
    text-align: center;
    width: 80%;
}

.sidenav-button:hover {
    background-color: #951A2E;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .sidenav {
        width: 100%;
        padding-top: 60px;
    }

    .admin-container {
        padding: 15px;
    }

    .admin-container .card {
        width: 100%; /* Ensure full width on smaller screens */
    }
}

/* Menu Button Styling */
.menu-button {
    background-color: #FD5C63;
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px 20px;
    border-radius: 5px;
    position: absolute;
    top: 10px;
    left: 10px;
    cursor: pointer;
}

.menu-button:hover {
    background-color: #951A2E;
}

/* Sidenav overlay for dark background when menu is opened */
.menu-open .sidenav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
    display: block;
}

.sidenav-overlay {
    display: none;
}

.is-valid {
    border-color: #28a745; /* Green for valid */
}
.is-invalid {
    border-color: #dc3545; /* Red for invalid */
}

.supplemenary-link {
    color: #D3D3D3; /* Example: blue color */
    font-size: 14px; /* Example: font size */
    text-decoration: none; /* Removes the underline */
}

/* Add a hover effect if desired */
.forgot-supplemenary:hover {
    color: #0056b3; /* Darker shade on hover */
    text-decoration: underline; /* Underline on hover */
}

/* Table Header Styling - Change from blue to black */
.card-header, 
.table-header,
.manage-jobs-header {
    background: #222 !important;
    color: white !important;
    border-radius: 5px 5px 0 0 !important;
    padding: 15px 20px !important;
}

/* Style for the Add Job button to match the black theme */
.btn-success, 
.btn-primary.add-job-btn {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
}

.btn-success:hover, 
.btn-primary.add-job-btn:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    transform: translateY(-2px) !important;
}

/* Modal Styling - Unified */
.modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-title {
    color: #212529;
    font-weight: 600;
}

.modal-body {
    color: #212529;
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 10px 10px;
}

.modal-footer .btn {
    border-radius: 4px;
    padding: 8px 16px;
}

.modal-footer .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.modal-footer .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.modal-footer .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Add visual feedback for fields at their character limit */
.at-limit {
    border-color: #ffc107 !important; /* Warning color */
    background-color: rgba(255, 193, 7, 0.1);
}

/* Toggle button styling - updated for better horizontal layout */
.toggle-btn {
    min-width: 150px;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    border: none;
    padding: 12px 25px;
    margin: 0 10px 20px;
    border-radius: 30px;
    transition: all 0.3s ease;
    display: inline-block; /* Ensure inline layout */
}

.toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.toggle-btn.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Add container for toggle buttons to ensure horizontal layout */
.toggle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    gap: 15px; /* Space between buttons */
}

/* Toggle Switch for Driver/Dispatcher Selection */
.toggle-switch-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 240px;
    height: 40px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
}

.toggle-option {
    z-index: 1;
    color: var(--text-light);
    font-weight: 500;
    width: 50%;
    text-align: center;
    transition: color 0.3s;
}

.toggle-option.active {
    color: white;
    font-weight: 600;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 34px;
    width: 120px;
    left: 3px;
    bottom: 3px;
    border-radius: 17px;
    background-color: var(--primary-color);
    transition: transform 0.3s;
}

input:checked + .toggle-slider:before {
    transform: translateX(114px);
}

/* Forgot Password Modal Styling */
#forgotPasswordModal .modal-body p {
    color: #495057;
    margin-bottom: 20px;
}

#forgotPasswordModal .form-control {
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 10px 15px;
    color: #495057;
}

#forgotPasswordModal .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(253, 92, 99, 0.25);
}

#forgotPasswordModal .form-control::placeholder {
    color: #6c757d;
}

#forgotPasswordModal .invalid-feedback {
    display: block;
    margin-top: 0.25rem;
    font-size: 80%;
    color: #dc3545;
}

#forgotPasswordModal .alert {
    margin-bottom: 0;
    margin-top: 15px;
}

#forgotPasswordModal .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 4px;
}

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

#forgotPasswordModal .btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    opacity: 0.65;
}

/* Password hint styling for better visibility */
.password-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #b8b8b8 !important;
    line-height: 1.4;
    transition: opacity 0.3s ease;
}

.password-hint.d-none {
    display: none !important;
}