/* Custom styles to override Tailwind and enhance aesthetics */
html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: linear-gradient(to bottom, #2F4327, #000);
    color: #333;
}

/* --- FIX 4: HEADER STYLES (RESPONSIVE) --- */
header {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    gap: 15px;
}

.logo {
    height: 50px; 
    width: 100px;  
    border-radius: 50%;
    margin-right: 10px;
    object-fit: contain;
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-left span {
    font-weight: 900;
    font-size: 24px;
    color: #2F4327;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #2F4327;
    font-weight: bold;
}

/* --- FIX 4: MOBILE MENU BUTTON --- */
.mobile-menu-btn {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 24px;
    color: #2F4327;
    cursor: pointer;
}

/* NOTIFICATION STYLES (NEW) */
.notification-container {
    position: relative;
    cursor: pointer;
}

#notification-bell {
    font-size: 22px;
    color: #2F4327;
}

#notification-dot {
    position: absolute;
    top: -2px;
    right: -3px;
    width: 9px;
    height: 9px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 1.5px solid white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

#notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid #eee;
}
.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}
.notification-item:hover {
    background-color: #f9fafb;
}
.notification-item:last-child {
    border-bottom: none;
}
.notification-item.unread {
    background-color: #f0f5ff;
    font-weight: 500;
}
.notification-item p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}
.notification-item small {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
    display: block;
}

/* --- FIX 4: NAVIGATION STYLES (RESPONSIVE) --- */
nav.desktop-nav {
    display: none; /* Hidden on mobile by default */
    flex-wrap: nowrap; 
    justify-content: flex-start; 
    gap: 25px;
    margin: 0 20px; 
    flex-grow: 1;
}

nav.desktop-nav a {
    padding: 5px;
    text-decoration: none;
    color: #2F4327;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
    background-color: transparent; /* No background on desktop */
}

nav.desktop-nav a:hover {
    color: #3b5d33;
    background-color: transparent; /* No background on hover for desktop */
}

/* Mobile Nav Menu */
nav.mobile-nav {
    display: flex;
    flex-direction: column;
    background-color: white;
    position: sticky; /* Stick it below the header */
    top: 70px; /* Adjust based on header height */
    z-index: 998;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

nav.mobile-nav.hidden {
    display: none;
}

nav.mobile-nav a {
    padding: 15px 20px;
    text-decoration: none;
    color: #2F4327;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
nav.mobile-nav a:last-child {
    border-bottom: none;
}
nav.mobile-nav a:hover {
    background-color: #f9fafb;
}


/* Show desktop nav and hide mobile button on larger screens */
@media (min-width: 1024px) {
    nav.desktop-nav {
        display: flex; /* Show desktop nav */
    }
    .mobile-menu-btn {
        display: none; /* Hide hamburger */
    }
    nav.mobile-nav {
        display: none; /* Hide mobile nav */
    }
}

/* Show mobile button and hide desktop nav on smaller screens */
@media (max-width: 1023px) {
    nav.desktop-nav {
        display: none; /* Hide desktop nav */
    }
    .mobile-menu-btn {
        display: block; /* Show hamburger */
    }
}
/* --- END FIX 4 --- */


/* MAIN CONTENT & FORM STYLES */
.main {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    gap: 30px;
    flex-wrap: wrap;
}

.info {
    flex: 1 1 300px;
}

.info h1 {
    color: #2F4327;
}

.info p {
    line-height: 1.6;
    color: #666;
}

.car-image {
    flex: 1 1 300px;
    width: 100%;
    max-width: 400px;
    height: 250px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
    position: relative; /* Added for carousel */
}

/* NEW CAROUSEL STYLES */
.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Hide all slides by default */
    transition: opacity 1s ease-in-out; /* Smooth fade transition */
    border-radius: 10px;
}

.carousel-slide.active {
    opacity: 1; /* Show only the active slide */
}

.form-section {
    max-width: 800px;
    margin: 40px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-section h2 {
    margin-bottom: 20px;
    text-align: center;
    color: #2F4327;
}

input, label, select {
    width: 100%;
    display: block;
    margin: 10px 0 5px;
}

input, select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* BUTTON STYLES */
.btn-primary {
    background-color: #2F4327;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background-color: #3b5d33;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.15);
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    background-color: #d1d5db;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}


.contact-links {
    text-align: center;
    margin-top: 20px;
}

.contact-links a {
    margin: 0 15px;
    text-decoration: none;
    color: #2F4327;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* TAB STYLES */
.tabs {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.tabs button {
    background-color: #2F4327;
    color: #ffffff;
    font-weight: bold;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tabs button.active {
    background-color: #3b5d33;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tabs button:hover {
    background-color: #3b5d33;
    transform: translateY(-2px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

footer {
    text-align: center;
    color: #E7DCC6;
    padding: 20px;
    background-color: #2F4327;
    font-size: 14px;
}

/* MAP STYLES */
#map-container {
    width: 100%;
    height: 50vh; /* UPDATED: Was 400px, now 50% of viewport height */
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 10; /* Make sure map is below controls */
}

.controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.85);
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    gap: 0.5rem;
}

.controls button {
    box-shadow: none;
}

.controls button.active {
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    background-color: #3b82f6; /* Use a different color for map active state */
}

#loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    display: none; /* Hide initially, shown by JS */
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* MODAL & MESSAGE BOX STYLES */
.message-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    z-index: 3000;
    display: none; /* Hidden by default */
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.message-box button {
    padding: 0.5rem 1rem;
    font-size: 14px;
    box-shadow: none;
}

.message-box button:hover {
    transform: none;
    box-shadow: none;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

/* PAYMENT MODAL STYLES */
.payment-options-container {
    margin-top: 20px;
}
.payment-button-selected {
    box-shadow: 0 0 0 4px #3b82f6 !important; /* Blue ring for selection */
}
.payment-option-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 600;
}
.payment-option-label.momo {
    background-color: #FACC15;
    color: #1a202c;
}
.payment-option-label.momo:hover {
    background-color: #fbd38d;
}
/* Removed Airtel and Card styles as they are no longer used */

.location-selection {
    text-align: center;
    margin: 15px 0;
    font-weight: bold;
    color: #3b5d33;
}

/* AUTH & DASHBOARD STYLES */
.driver-ui {
    display: none;
    padding: 20px;
    text-align: center;
}

.user-ui {
    display: block; /* Default visible state for user UI */
}

#driver-login-form.active, #driver-signup-form.active {
    display: block;
}

.login-toggle-btn {
    background: #ffffff;
    color: #333;
    border-radius: 5px;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #ccc;
}

.login-toggle-btn.active {
    background: #2F4327;
    color: white;
}

.dashboard-section {
    display: none;
}
.dashboard-section.active {
    display: block;
}

/* --- DASHBOARD MENU POLISH (FIX 5) --- */
.dashboard-menu {
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 10px;
    /* Allow horizontal layout on mobile */
    display: flex;
    flex-direction: row;
    overflow-x: auto;
}
.dashboard-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 6px;
    font-weight: 500;
    color: #374151;
    gap: 8px; /* For icons if added later */
    white-space: nowrap; /* Prevent wrapping */
}
.dashboard-menu a:hover {
    background-color: #f0f0f0;
}
.dashboard-menu a.active {
    background-color: #2F4327;
    color: white;
    font-weight: bold;
}
/* Make menu vertical on desktop */
@media (min-width: 768px) {
    .dashboard-menu {
        flex-direction: column;
        overflow-x: visible;
    }
}
/* --- END DASHBOARD MENU POLISH --- */


.profile-image-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #2F4327;
    margin: 0 auto 1rem;
    position: relative;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* WALLET & REFERRALS */
.wallet-card {
    background: linear-gradient(135deg, #3b5d33, #2F4327);
    color: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

.wallet-card .balance {
    font-size: 2.5rem;
    font-weight: 900;
}

/* TABLES (History & Admin) */
.history-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
}

.history-table th, .history-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.history-table th {
    background-color: #f9fafb;
    font-weight: bold;
    color: #374151;
}

/* --- ADMIN DASHBOARD SPECIFIC (NEW - REDESIGN FIX 4) --- */
.admin-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 10px;
}
.admin-menu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 6px;
    font-weight: 500;
    color: #374151;
}
.admin-menu a:hover {
    background-color: #f0f0f0;
}
.admin-menu a.active {
    background-color: #2F4327;
    color: white;
    font-weight: bold;
}
.admin-menu a .fas { /* Icon spacing */
    margin-right: 10px;
}
.admin-badge {
    background-color: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}
.admin-section {
    display: none;
}
.admin-section.active {
    display: block;
    animation: fadeInUp 0.5s ease-out; /* Re-use existing animation */
}

/* (Existing Admin Styles - Kept for content) */
.admin-table-container {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
    font-size: 14px;
}
.admin-table th, .admin-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.admin-table th {
    background-color: #f9fafb;
    font-weight: bold;
    color: #374151;
}
.admin-actions button {
    margin-right: 5px;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.admin-actions button:hover {
    opacity: 0.8;
}
.admin-actions button.delete {
    background-color: #ef4444;
    color: white;
}
.admin-actions button.approve {
    background-color: #22c55e;
    color: white;
}
.admin-actions button.reject {
    background-color: #f59e0b;
    color: white;
}

.admin-stat-card {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: center;
}
/* --- END ADMIN DASHBOARD --- */


/* RIDE STATUS & LIVE TRACKING STYLES (NEW) */
.ride-info-card {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}
.ride-info-card h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
#live-ride-map-container {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    margin-top: 1rem;
}
.user-pulse-icon {
    background-color: #3b82f6;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
/* Add these styles for smooth transitions */
.fadeable {
    transition: opacity 0.4s ease-out, visibility 0.4s ease-out;
    opacity: 1;
    visibility: visible;
}

.fadeable.hidden {
    opacity: 0;
    visibility: hidden;
}

/* DRIVER AVAILABILITY TOGGLE (NEW) */
.availability-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 1rem;
}
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #22c55e;
}
input:focus + .slider {
    box-shadow: 0 0 1px #22c55e;
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* ONLINE/OFFLINE STATUS DOT (NEW) */
.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.status-dot.online {
    background-color: #22c55e;
}
.status-dot.offline {
    background-color: #ef4444;
}

/* RATING SYSTEM STARS (NEW) */
.rating-stars {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 1rem;
}
.rating-stars .star {
    font-size: 2.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}
.rating-stars .star:hover,
.rating-stars .star.selected {
    color: #facc15;
}


/* NEW GEOSEARCH (ADDRESS SEARCH BAR) STYLES */
#map-search-container {
    margin-bottom: 15px;
}

.geosearch form {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
    display: flex;
}

.geosearch input[type="text"] {
    width: 100%;
    padding: 10px;
    border: none;
    margin: 0;
    border-radius: 5px 0 0 5px;
}
.geosearch input[type="text"]:focus {
    box-shadow: none;
    outline: none;
}

.geosearch .glass {
    width: 50px;
    border: none;
    border-left: 1px solid #ccc;
    background-color: #f9fafb;
    border-radius: 0 5px 5px 0;
}

.geosearch .results {
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 300px;
    overflow-y: auto;
}

.geosearch .results > * {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.geosearch .results > *:hover {
    background-color: #f0f0f0;
}
.geosearch .results > .active {
    background-color: #e0e0e0;
}

/* --- CSS BUG FIX (FIX 6) --- */
/* The broken, nested #map rule and pulse icon styles were removed from the end of the file. */
/* The styles below are the CORRECT ones, placed in the global scope. */

.user-pulse-icon {
    width: 15px;
    height: 15px;
    background-color: #2F4327;
    border-radius: 50%;
    animation: pulse-user 2s infinite;
}

@keyframes pulse-user {
    0% { box-shadow: 0 0 0 0 rgba(47, 67, 39, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(47, 67, 39, 0); }
    100% { box-shadow: 0 0 0 0 rgba(47, 67, 39, 0); }
}