:root {
    --primary-color: #ffd22f;
}

* {
    box-sizing: border-box;
}

a {
    text-decoration: none;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f7fa;
}
.container {
    display: flex;
    height: 100vh;
}
.sidebar {
    width: 460px;
    background: #f1f1f1;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}
.sidebox {
    padding: 16px 20px;
    background: #fff;
    margin-bottom: 8px;
}
.sidebox:last-child {
    margin-bottom: 0;
}
.status {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 18px;
}
.driver-info {
    display: flex;
    align-items: start;
    gap: 15px;
}
.driver-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.driver-details {
    flex: 1;
}
.driver-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}
.driver-plate {
    color: #888;
    font-size: 14px;
    margin-bottom: 8px;
}
.driver-phone {
    margin-top: 14px;
    margin-bottom: 4px;
}
.phone-btn {
    color: var(--primary-color);
    background: #fff;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 15px;
    cursor: pointer;
}
.customer-info,
.order-timeline,
.route-detail {
}
.section-title {
    font-weight: 600;
    font-size: 20px;
    margin-bottom: 6px;
    color: var(--primary-color);
}
.customer-info-content {
    margin-top: 14px;
    display: flex;
    align-items: start;
    gap: 15px;
}
.customer-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #fdf1c2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
    flex-shrink: 0;
}
.customer-details {
    flex: 1;
}
.customer-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}
.customer-phone {
    color: #666;
    font-size: 14px;
}
.order-timeline ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.order-timeline li {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}
.order-timeline .time {
    color: var(--primary-color);
    font-weight: 500;
    margin-left: 8px;
}
.route-detail .booking-info {
    font-size: 14px;
    color: #333;
}
.booking-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.booking-row span {
    color: #666;
    font-size: 14px;
}
.booking-id {
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}
.booking-date {
    color: #888;
    font-size: 13px;
}
.map-area {
    flex: 1;
    position: relative;
}
#map {
    width: 100%;
    height: 100vh;
}
.vanilla-timeline {
    --timeline-color: var(--primary-color);
    --timeline-bg: #e6f7f1;
    --timeline-dot-size: 16px;
    --timeline-dot-color: var(--primary-color);
    --timeline-line-width: 3px;
    --timeline-font-size: 14px;
    --timeline-date-color: var(--primary-color);
    margin-left: 0;
    padding-left: 0;
}
.vanilla-timeline .vtl-item {
    background: none;
    border: none;
    box-shadow: none;
    margin-bottom: 8px;
}
.vanilla-timeline .vtl-date {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 13px;
}
.vanilla-timeline .vtl-content {
    color: #333;
    font-size: 14px;
    font-weight: 400;
}
.custom-timeline {
    position: relative;
    margin: 20px 0;
    padding-left: 30px;
    min-height: 100px;
}
.custom-timeline::before {
    content: "";
    position: absolute;
    left: 28px;
    top: 12px;
    bottom: 14px;
    width: 2px;
    background: var(--primary-color);
    z-index: 0;
}
.timeline-item {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    align-items: flex-start;
    z-index: 1;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-icon {
    position: absolute;
    left: -14px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}
.timeline-icon.current {
    background: var(--primary-color);
    width: 18px;
    height: 18px;
    left: -10px;
    top: 4px;
    border: none;
}
.timeline-icon.done {
    background: var(--primary-color);
}
.timeline-content {
    margin-left: 30px;
}
.timeline-title {
    font-weight: 500;
}
.timeline-time {
    color: #888;
    font-size: 13px;
}
.timeline-item:last-child .timeline-icon.done {
    background: var(--primary-color);
    color: #fff;
}

.status i {
    margin-right: 8px;
    color: var(--primary-color);
}

.phone-btn i {
    margin-right: 6px;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: rgba(255, 210, 47, 0.1);
}

.copy-btn i {
    font-size: 14px;
}

.route-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0 0 0;
}
.route-point-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #222;
    margin-top: 2px;
}
.route-point-icon.to {
    color: var(--primary-color);
    font-size: 16px;
}
.route-point-info {
    flex: 1;
}
.route-point-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 15px;
    margin-bottom: 2px;
}
.route-point-title.to {
    color: var(--primary-color);
}
.route-point-address {
    color: #888;
    font-size: 13px;
    line-height: 1.4;
}
.route-distance {
    text-align: center;
    color: #888;
    font-size: 15px;
    margin: 14px 0 0 0;
    font-weight: 500;
    border-top: 1px solid #eee;
    padding-top: 14px;
}
.route-distance i {
    margin-right: 7px;
    font-size: 15px;
    color: #bbb;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: 100dvh;
    }
    .map-area {
        order: 1;
        height: 60dvh;
        min-height: 240px;
        flex: none;
        position: relative;
        width: 100vw;
    }
    #map {
        width: 100vw;
        height: 100%;
        min-height: 240px;
    }
    .sidebar {
        order: 2;
        width: 100vw;
        height: 40dvh;
        min-height: 200px;
        max-height: 100dvh;
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 10;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        transition: height 0.3s;
        overflow-y: auto;
        background: #f1f1f1;
        touch-action: pan-y;
    }
    .sidebar.fullscreen {
        height: 100dvh !important;
        min-height: 100dvh !important;
        border-radius: 0;
    }
    .sidebox {
        border-radius: 0;
        box-shadow: none;
    }
    body {
        overflow-x: hidden;
    }
}

@media (max-width: 600px) {
    .map-area {
        min-height: 160px;
        height: 55dvh;
    }
    .sidebar {
        min-height: 160px;
        height: 45dvh;
    }
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    z-index: 9999;
}

.loading-container {
    text-align: center;
}

.loading-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.1rem;
    color: #666;
}

.driver-marker {
    width: 64px;
    height: 64px;
    overflow: hidden;
    transform-origin: center center;
    transition: transform 0.5s ease;
}

.driver-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: white;
    z-index: 9999;
}

.error-container {
    text-align: center;
}

.error-icon {
    color: #dc3545;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.retry-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.retry-btn:hover {
    background: #e6b800;
}
