:root {
    --primary-color: #f26722;
    /* Lalamove Orange */
    --secondary-color: #323232;
    --bg-color: #f4f4f4;
    --white: #ffffff;
    --gray-light: #e0e0e0;
    --text-color: #333;
    --success-color: #28a745;
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    /* Prevent horizontal scroll on mobile */
    overflow-x: hidden;
}

header {
    background-color: var(--white);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .logo {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* User Sceneario Styles */
.booking-panel {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 350px;
    max-width: 450px;
}

.input-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    /* Prevent zoom on iOS */
    font-size: 16px;
}

.input-group input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.vehicle-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.vehicle-card {
    border: 2px solid var(--gray-light);
    border-radius: 6px;
    padding: 1rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
}

.vehicle-card.selected {
    border-color: var(--primary-color);
    background-color: #fff5f0;
}

.vehicle-card i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.vehicle-card.selected i {
    color: var(--primary-color);
}

.price-display {
    display: none;
    /* Hidden initially */
    margin-top: 1.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    text-align: right;
    color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 1rem;
    width: 100%;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s;
    /* Touch target size */
    min-height: 48px;
}

.btn-primary:hover {
    background-color: #d1561b;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

/* Safety Tip Balloon */
.safety-tip {
    background-color: #fff5f0;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    position: relative;
    animation: float 3s ease-in-out infinite;
    line-height: 1.4;
}

.safety-tip::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    border-width: 0 10px 10px 10px;
    border-style: solid;
    border-color: transparent transparent var(--primary-color) transparent;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Map Area */
#map {
    flex: 2;
    min-width: 350px;
    height: 450px;
    /* Reduced from 600px */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 1;
}

/* Chat Widget Styles - Floating Window */
.chat-widget {
    display: none;
    /* Toggled by JS */
    position: fixed;
    bottom: 80px;
    /* Above the status panel on mobile */
    right: 20px;
    width: 350px;
    height: 400px;
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    flex-direction: column;
    overflow: hidden;
    z-index: 3000 !important;
    border: 1px solid #ddd;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-chat {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-footer {
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

/* Chat Messages Bubbles */
.message {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
}

.message.received {
    background: white;
    align-self: flex-start;
    border: 1px solid #ddd;
    border-bottom-left-radius: 2px;
}

.message.sent {
    background: #dcf8c6;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Mobile Tweak for Chat */
@media (max-width: 480px) {
    .chat-widget {
        width: 90%;
        right: 5%;
        bottom: 20px;
        /* Adjusted if needed */
        height: 50vh;
    }
}

/* Admin Styles */
.admin-sidebar {
    width: 250px;
    background: var(--white);
    height: 100vh;
    padding: 1rem;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.admin-content {
    margin-left: 250px;
    padding: 2rem;
    flex: 1;
}

.order-card {
    background: var(--white);
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--gray-light);
}

.order-card.status-paid {
    border-left-color: var(--primary-color);
}

.order-card.status-dispatched {
    border-left-color: #ffc107;
}

.order-card.status-delivered {
    border-left-color: var(--success-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
    background: #eee;
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: #f0f0f0;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
}

/* Footer Styles */
footer {
    background: var(--white);
    padding: 3rem 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--gray-light);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.security-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.security-badges img {
    height: 60px;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: grayscale(10%);
}

.security-badges img:hover {
    transform: scale(1.05);
    filter: grayscale(0%);
}

.copyright {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.copyright i {
    color: var(--success-color);
    margin-right: 5px;
}

/* --- Tracking UI System (Added for animation & focus mode) --- */

/* 1. Status Overlay (The card that shows driver info) */
.status-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 1.5rem;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    text-align: center;
}

/* 2. TRACKING MODE ACTIVE (Triggered by JS when Dispatch/Delivering) */
body.tracking-mode {
    overflow: hidden;
    /* Prevent scrolling away from map */
}

/* HIDE the Booking Panel */
body.tracking-mode .booking-panel {
    display: none !important;
}

/* HIDE the Hero Image */
body.tracking-mode div[style*="height: 200px"] {
    display: none !important;
}

/* HIDE Footer */
body.tracking-mode footer {
    display: none !important;
}

/* FULL SCREEN MAP */
body.tracking-mode #map {
    position: fixed;
    top: 60px;
    /* Below header */
    left: 0;
    width: 100% !important;
    height: calc(100vh - 60px) !important;
    z-index: 5;
    border-radius: 0;
    margin: 0;
}

/* SHOW the Status Overlay */
body.tracking-mode .status-overlay {
    display: block;
    animation: slideUpPanel 0.4s ease-out;
}

/* Animation for the panel */
@keyframes slideUpPanel {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Status Overlay Content Styling */
.status-overlay h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.status-overlay p {
    color: #666;
    margin-bottom: 1rem;
}

.status-overlay .btn-primary {
    position: static;
    margin-top: 10px;
    width: 100%;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    /* Green glow for Whatsapp */
}

/* Desktop Tweak */
@media (min-width: 769px) {
    body.tracking-mode .status-overlay {
        width: 380px;
        bottom: 20px;
        left: 20px;
        border-radius: 16px;
        border: 1px solid #eee;
    }
}