: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: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 1;
    /* Ensure map is interactable but behind modals */
}

/* 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;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    header {
        padding: 0.8rem 1rem;
    }

    header .logo img {
        height: 30px;
    }

    header .btn-secondary {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    /* Hero adjustments */
    div[style*="height: 200px"] {
        height: 15vh !important;
        /* Responsive height */
        max-height: 150px;
        min-height: 120px;
        margin-bottom: -20px !important;
    }

    .container {
        flex-direction: column;
        padding: 0.5rem;
        gap: 1rem;
    }

    .booking-panel {
        min-width: 100%;
        max-width: 100%;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        /* Ensure booking panel is accessible */
        z-index: 2;
        /* Default order: Map below form on mobile? */
        /* If user wants map prominent, we can keep map at bottom but make it tall */
    }

    #map {
        height: 50vh;
        /* Increased height for visibility checking */
        width: 100%;
        display: block !important;
        order: 2;
        margin-top: 0;
    }

    .vehicle-selection {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Tracking Mode - Full Screen Map */
body.tracking-mode .booking-panel {
    display: none !important;
}

body.tracking-mode .container {
    height: 90vh;
    padding: 0;
}

body.tracking-mode #map {
    height: 100% !important;
    width: 100%;
    position: fixed;
    top: 60px;
    /* Below header */
    left: 0;
    z-index: 5;
    border-radius: 0;
}

body.tracking-mode .status-overlay {
    display: block;
}

.status-overlay {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
    border-left: 5px solid var(--primary-color);
}

.vehicle-card {
    padding: 0.5rem;
}

/* Chat Widget */
.chat-widget {
    display: none;
    position: fixed;
    bottom: 80px;
    /* Above status overlay */
    right: 20px;
    width: 300px;
    height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    flex-direction: column;
    border: 1px solid #ddd;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.chat-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-footer {
    padding: 0.5rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
    background: white;
    border-radius: 0 0 12px 12px;
}

.message {
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    max-width: 80%;
    font-size: 0.9rem;
}

.message.sent {
    background: #dcf8c6;
    /* WhatsApp green-ish */
    align-self: flex-end;
}

.message.received {
    background: white;
    border: 1px solid #eee;
    align-self: flex-start;
}

.close-chat {
    cursor: pointer;
    font-size: 1.2rem;
}

.vehicle-card i {
    font-size: 1.5rem;
}

.vehicle-card div {
    font-size: 0.9rem;
}

/* Adjust Safety Tip for Mobile */
.safety-tip {
    font-size: 0.8rem;
    padding: 0.8rem;
}

/* Adjust Footer for Mobile */
footer {
    padding: 2rem 1rem;
    margin-top: 2rem;
}

.security-badges {
    gap: 1rem;
    flex-direction: row;
    justify-content: center;
}

.security-badges img {
    height: 40px;
}
}

/* Very Small phones */
@media (max-width: 380px) {
    .vehicle-selection {
        grid-template-columns: 1fr;
        /* Stack vehicles on tiny screens */
    }

    #map {
        height: 40vh;
    }
}