/* ===== CSS Variables ===== */
:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --secondary: #FF6584;
    --success: #28C76F;
    --danger: #EA5455;
    --warning: #FF9F43;
    --dark: #2C2C54;
    --gray: #8E8E93;
    --light-gray: #F0F0F5;
    --white: #FFFFFF;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-gray);
    color: var(--dark);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: var(--primary);
}

/* ===== Auth Pages ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--dark);
}

.auth-card .subtitle {
    text-align: center;
    color: var(--gray);
    margin-bottom: 32px;
    font-size: 14px;
}

.auth-card .logo {
    text-align: center;
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== Form Styles ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
    background: var(--light-gray);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #22a85e;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #d43d3e;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 100%;
}

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

/* ===== Toggle Switch ===== */
.driver-status-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    position: sticky;
    top: 60px;
    z-index: 99;
}

.driver-status-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.driver-status-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.driver-status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.driver-status-bar .toggle {
    flex-shrink: 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: #ccc;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle.active {
    background: var(--success);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--white);
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle.active::after {
    left: 27px;
}

.toggle-label {
    font-weight: 600;
    font-size: 14px;
}

/* ===== Role Selector ===== */
.role-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.role-option {
    flex: 1;
    padding: 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--light-gray);
}

.role-option:hover {
    border-color: var(--primary);
}

.role-option.selected {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.08);
}

.role-option .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.role-option .label {
    font-weight: 600;
    font-size: 14px;
}

/* ===== Dashboard Layout ===== */
.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--white);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.navbar .brand .brand-text {
    white-space: nowrap;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    line-height: 1.4;
    vertical-align: middle;
}

.navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.navbar .user-info {
    font-size: 14px;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar .user-info .greeting {
    color: var(--gray);
}

.navbar .user-info strong {
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-logout {
    background: var(--light-gray);
    color: var(--dark);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger);
    color: var(--white);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--light-gray);
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ===== My Orders Button ===== */
.my-orders-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    box-shadow: var(--shadow);
}

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

.my-orders-btn:active {
    transform: scale(0.99);
}

.my-orders-btn-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.my-orders-btn-icon {
    font-size: 20px;
}

.my-orders-btn-arrow {
    font-size: 22px;
    color: var(--gray);
    font-weight: 300;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    word-break: break-word;
}

#driver-price-display {
    font-size: 16px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

/* ===== Grid Layouts ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

/* ===== Map ===== */
.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid var(--light-gray);
}

#booking-map,
#driver-map,
#order-map {
    width: 100%;
    height: 100%;
}

/* ===== Order Card ===== */
.order-card {
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.order-card:hover {
    box-shadow: var(--shadow);
}

.order-card .order-id {
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 8px;
}

.order-card .order-locations {
    margin-bottom: 12px;
}

.order-card .location-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}

.order-card .location-row .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.dot-green {
    background: var(--success);
}

.dot-red {
    background: var(--danger);
}

.order-card .order-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--light-gray);
    flex-wrap: wrap;
    gap: 10px;
}

.order-card .order-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
}

.order-card .order-distance {
    color: var(--gray);
    font-size: 13px;
}

.order-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: #FFF3E0;
    color: #E65100;
}

.badge-accepted {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-picked_up {
    background: #F3E5F5;
    color: #7B1FA2;
}

.badge-completed {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-cancelled {
    background: #FFEBEE;
    color: #C62828;
}

.badge-active {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-inactive {
    background: #FFEBEE;
    color: #C62828;
}

/* ===== Chat ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    overflow: hidden;
}

.chat-header {
    background: var(--primary);
    color: var(--white);
    padding: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f8ff;
}

.chat-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.chat-message.sent {
    align-items: flex-end;
}

.chat-message.received {
    align-items: flex-start;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.chat-message.sent .chat-bubble {
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.chat-message.received .chat-bubble {
    background: var(--white);
    color: var(--dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-sender {
    font-size: 11px;
    color: var(--gray);
    margin-bottom: 4px;
    font-weight: 600;
}

.chat-time {
    font-size: 10px;
    color: var(--gray);
    margin-top: 4px;
}

.chat-message.sent .chat-time {
    color: rgba(255, 255, 255, 0.6);
}

.chat-input-container {
    display: flex;
    padding: 12px;
    background: var(--white);
    border-top: 1px solid var(--light-gray);
    gap: 8px;
    align-items: center;
}

.chat-input-container input[type="text"] {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.chat-input-container input[type="text"]:focus {
    border-color: var(--primary);
}

.chat-input-container > button:last-child {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-input-container > button:last-child:hover {
    background: var(--primary-dark);
}

.chat-media-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--light-gray);
    background: var(--white);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

/* Image preview bar */
.image-preview-bar {
    padding: 8px 16px;
    background: #f0f0f5;
    border-top: 1px solid var(--light-gray);
}

.image-preview-inner {
    display: inline-flex;
    align-items: flex-start;
    position: relative;
}

.image-preview-inner img {
    max-height: 80px;
    max-width: 120px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--light-gray);
}

.image-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--danger);
    color: var(--white);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Chat image messages */
.chat-bubble-image {
    padding: 4px !important;
    max-width: 280px !important;
    overflow: hidden;
}

.chat-bubble-image .chat-image {
    width: 100%;
    max-width: 272px;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    transition: opacity 0.2s;
}

.chat-bubble-image .chat-image:hover {
    opacity: 0.9;
}

.chat-image-caption {
    padding: 6px 10px 4px;
    font-size: 14px;
    line-height: 1.4;
}

/* Fullscreen image overlay */
.image-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
}

.image-fullscreen-overlay img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 4px;
}

.image-fullscreen-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ===== Price Input ===== */
.price-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-input-group input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.price-input-group input:focus {
    border-color: var(--primary);
}

.price-input-group .currency {
    font-size: 14px;
    color: var(--gray);
    font-weight: 600;
}

/* ===== Price Brackets ===== */
.price-brackets {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.bracket-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bracket-label {
    width: 90px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    flex-shrink: 0;
}

.bracket-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bracket-input-group .currency {
    font-size: 13px;
    color: var(--gray);
    font-weight: 600;
}

.bracket-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.bracket-input-group input:focus {
    border-color: var(--primary);
}

.bracket-hint {
    font-size: 12px;
    color: var(--gray);
    margin-top: 8px;
    font-style: italic;
}

/* ===== Driver Live Tracking ===== */
.tracking-info-bar {
    background: linear-gradient(135deg, #28C76F, #1fa85c);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(40, 199, 111, 0.3);
}

.tracking-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tracking-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    animation: trackingPulse 1.5s ease-in-out infinite;
}

@keyframes trackingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.tracking-label {
    font-weight: 600;
    font-size: 14px;
}

.tracking-time {
    font-size: 12px;
    opacity: 0.85;
}

/* Driver marker on map */
.driver-tracking-marker {
    background: transparent !important;
    border: none !important;
}

.driver-pulse-marker {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-icon-inner {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 3px 10px rgba(108, 99, 255, 0.4);
    z-index: 2;
    position: relative;
    border: 3px solid #fff;
}

.driver-pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    animation: driverPulseRing 2s ease-out infinite;
    z-index: 1;
}

@keyframes driverPulseRing {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.tracking-info-bar.hidden {
    display: none;
}

/* ===== Order Toast Notification ===== */
.order-toast {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90vw;
    width: 400px;
}

.order-toast.show {
    top: 24px;
}

.toast-icon {
    font-size: 32px;
    animation: bellRing 0.5s ease-in-out 0.4s 3;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.toast-content {
    flex: 1;
}

.toast-content strong {
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}

.toast-content p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.toast-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255,255,255,0.35);
}

/* Order count badge */
.order-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    margin-left: 6px;
    animation: badgePulse 1.5s ease-in-out infinite;
}

/* ===== Offering Card (Driver New Order Alert) ===== */
.offering-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.offering-cards-container:empty {
    display: none;
}

.offering-card {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.18);
    border: 2px solid var(--primary);
    overflow: hidden;
    transition: all 0.4s ease;
}

.offering-card-enter {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
}

.offering-card-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.offering-card-exit {
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    max-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.offering-card-pulse {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--success), var(--primary));
    background-size: 200% 100%;
    animation: offeringPulseBar 2s ease-in-out infinite;
}

@keyframes offeringPulseBar {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 0%; }
    100% { background-position: 0% 0%; }
}

.offering-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #F0F0F5;
}

.offering-card-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--primary);
}

.offering-bell {
    font-size: 20px;
    animation: bellRing 0.5s ease-in-out 0.3s 3;
}

.offering-dismiss {
    background: var(--light-gray);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.offering-dismiss:hover {
    background: var(--danger);
    color: white;
}

.offering-card-body {
    padding: 12px 16px;
}

.offering-route {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.offering-location {
    display: flex;
    align-items: center;
    gap: 10px;
}

.offering-address {
    font-size: 14px;
    color: var(--dark);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.offering-route-line {
    width: 2px;
    height: 12px;
    background: #D0D0D8;
    margin-left: 5px;
    border-radius: 1px;
}

.offering-meta {
    display: flex;
    gap: 16px;
}

.offering-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray);
    font-weight: 500;
}

.offering-meta-icon {
    font-size: 16px;
}

.offering-card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px 14px;
    border-top: 1px solid #F0F0F5;
}

.offering-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

/* ===== Order Detail Action Bar (Driver) ===== */
.order-detail-action-bar {
    margin-bottom: 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #f0fff4, #e8f5e9);
    border: 2px solid var(--success);
    box-shadow: 0 4px 16px rgba(40, 199, 111, 0.15);
    overflow: hidden;
}

.order-detail-action-bar.hidden {
    display: none;
}

.detail-action-content {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.detail-action-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.detail-action-icon {
    font-size: 28px;
    animation: bellRing 0.5s ease-in-out 0.3s 3;
}

.detail-action-info strong {
    display: block;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 2px;
}

.detail-action-info p {
    font-size: 13px;
    color: var(--gray);
    margin: 0;
}

.detail-pickup-badge {
    display: inline-block;
    background: #E3F2FD;
    color: #1565C0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.detail-accept-btn {
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(40, 199, 111, 0.3);
}

.detail-accept-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40, 199, 111, 0.4);
}

.detail-action-buttons {
    display: flex;
    gap: 10px;
}

.detail-status-btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.detail-status-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

@media (max-width: 768px) {
    .detail-action-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .detail-accept-btn,
    .detail-status-btn {
        width: 100%;
        text-align: center;
    }

    .detail-action-buttons {
        flex-direction: column;
        width: 100%;
    }
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Tab flash animation for new orders */
.tab-flash {
    animation: tabFlash 0.6s ease-in-out 5;
}

@keyframes tabFlash {
    0%, 100% { background: transparent; }
    50% { background: rgba(108, 99, 255, 0.2); }
}

/* ===== Location Input ===== */
.location-input-group {
    position: relative;
    margin-bottom: 16px;
}

.location-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark);
}

.location-input-group input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.location-input-group input:focus {
    border-color: var(--primary);
}

.location-input-group .input-icon {
    position: absolute;
    left: 12px;
    top: 36px;
    font-size: 16px;
}

/* ===== Booking Card ===== */
.booking-card {
    margin-bottom: 20px;
    position: relative;
}

.booking-inputs {
    display: flex;
    gap: 14px;
    padding: 0 0 16px;
}

.booking-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 18px;
    width: 20px;
    flex-shrink: 0;
}

.connector-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.connector-dot-green {
    background: #28C76F;
    border: 2px solid #1fa85c;
}

.connector-dot-red {
    background: #EA5455;
    border: 2px solid #d63031;
}

.connector-line {
    width: 2px;
    flex: 1;
    margin: 4px 0;
    background: repeating-linear-gradient(
        to bottom,
        var(--gray) 0, var(--gray) 4px,
        transparent 4px, transparent 8px
    );
    opacity: 0.4;
}

.booking-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.booking-field {
    position: relative;
}

.booking-field input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: var(--transition);
    background: #f7f7f7;
}

.booking-field input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.08);
}

.booking-field input::placeholder {
    color: #999;
}

.btn-locate {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

.btn-locate:hover {
    background: var(--light-gray);
}

/* ===== Suggestion Tabs ===== */
.suggestion-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 0;
}

.suggestion-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.suggestion-tab:hover {
    color: var(--dark);
}

.suggestion-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== Suggestion List (inline, not dropdown) ===== */
.suggestion-list {
    max-height: 400px;
    overflow-y: auto;
}

.suggestion-panel {
    display: none;
}

.suggestion-panel.visible {
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100%);
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1000;
}

/* Suggestion Items */
.sg-item {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid #f5f5f5;
}

.sg-item:last-child {
    border-bottom: none;
}

.sg-item:hover {
    background: #fafafe;
}

.sg-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    margin-right: 14px;
    margin-top: 2px;
}

.sg-icon.sg-icon-recent {
    background: #f0f0f0;
    color: var(--gray);
}

.sg-icon.sg-icon-saved {
    background: #f0eeff;
    color: var(--primary);
}

.sg-icon.sg-icon-pin {
    background: #fce4e4;
    color: #EA5455;
}

.sg-content {
    flex: 1;
    min-width: 0;
}

.sg-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-subtitle {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-action {
    flex-shrink: 0;
    margin-left: 8px;
    display: flex;
    align-items: center;
}

.sg-action-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--light-gray);
    background: #f8f8ff;
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.15s;
    opacity: 1;
}

.sg-action-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: scale(1.1);
}

.sg-action-btn.sg-save-btn {
    background: linear-gradient(135deg, #fff8e6, #fff3cc);
    border-color: #ffe082;
    color: #f5a623;
    font-size: 16px;
}

.sg-action-btn.sg-save-btn:hover {
    background: linear-gradient(135deg, #f5a623, #e69500);
    color: var(--white);
    border-color: #e69500;
}

.sg-section-title {
    padding: 14px 16px 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
}

.sg-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--gray);
    font-size: 14px;
}

.sg-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--primary);
    font-weight: 600;
    margin-top: 4px;
}

/* ===== Pickup Location Picker ===== */
.pickup-picker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.pickup-picker.hidden {
    display: none !important;
}

.pickup-picker-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--white);
    box-shadow: var(--shadow);
    z-index: 2;
}

.pickup-picker-back {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    transition: background 0.15s;
    flex-shrink: 0;
}

.pickup-picker-back:hover {
    background: var(--light-gray);
}

.pickup-picker-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--light-gray);
    border-radius: 28px;
    padding: 10px 18px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.pickup-picker-input:focus-within {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.08);
}

.pickup-picker-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--primary-dark);
    flex-shrink: 0;
}

.pickup-picker-input input {
    flex: 1;
    border: none;
    background: none;
    font-size: 15px;
    outline: none;
    color: var(--dark);
}

.pickup-picker-input input::placeholder {
    color: #999;
}

.pickup-picker-map-wrap {
    flex: 1;
    position: relative;
    min-height: 250px;
}

.pickup-picker-center-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.center-pin-icon {
    font-size: 36px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.3));
    line-height: 1;
    animation: pinBounce 0.4s ease-out;
}

@keyframes pinBounce {
    0% { transform: translateY(-20px); opacity: 0; }
    60% { transform: translateY(4px); }
    100% { transform: translateY(0); opacity: 1; }
}

.center-pin-shadow {
    width: 12px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    margin-top: -2px;
}

.pickup-picker-locate {
    position: absolute;
    bottom: 20px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: var(--shadow);
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.pickup-picker-locate:hover {
    background: var(--light-gray);
    transform: scale(1.05);
}

.pickup-picker-bottom {
    background: var(--white);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 2;
    max-height: 45vh;
    overflow-y: auto;
}

.pickup-picker-address {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
}

.pickup-picker-addr-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: var(--primary);
}

.pickup-picker-addr-text {
    flex: 1;
    min-width: 0;
}

.pickup-picker-addr-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 2px;
}

.pickup-picker-addr-subtitle {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pickup-picker-suggestions {
    max-height: 160px;
    overflow-y: auto;
}

.pickup-picker-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.pickup-picker-confirm {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius);
    margin-top: 4px;
    background: var(--primary);
    border: none;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.pickup-picker-confirm:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

/* ===== Distance Warning ===== */
.distance-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    margin-top: 12px;
    background: #fff3f3;
    border: 1px solid #ffd0d0;
    border-radius: 10px;
    color: #c0392b;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeSlide 0.3s ease;
}

.distance-warning.hidden {
    display: none !important;
}

.distance-warning-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

@keyframes fadeSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Ride Summary ===== */
.ride-summary {
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0eeff, #e8f5e9);
    border-radius: var(--radius);
    margin-top: 12px;
}

.ride-summary-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    font-size: 14px;
}

.ride-summary-divider {
    width: 1px;
    height: 24px;
    background: var(--gray);
    opacity: 0.3;
}

.ride-stat-label {
    font-size: 12px;
    color: var(--gray);
    margin-right: 6px;
}

.ride-stat-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
    margin-right: 2px;
}

/* ===== Active Order Banner ===== */
.active-order-banner {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}

.active-order-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.active-order-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.active-order-status {
    background: rgba(255,255,255,0.25);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.active-order-body {
    padding: 16px 20px;
}

.active-order-route {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.active-order-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 4px;
}

.active-order-dots .ao-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.active-order-dots .ao-dot-green { background: var(--success); }
.active-order-dots .ao-dot-red { background: var(--danger); }

.active-order-dots .ao-line {
    width: 2px;
    height: 20px;
    background: var(--border);
}

.active-order-addresses {
    flex: 1;
    min-width: 0;
}

.active-order-addr {
    font-size: 14px;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.active-order-addr + .active-order-addr {
    margin-top: 14px;
}

.active-order-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--gray);
}

.active-order-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.active-order-actions {
    display: flex;
    gap: 8px;
}

.active-order-actions .btn {
    flex: 1;
    font-size: 13px;
    padding: 10px 0;
}

/* ===== Vehicle Type Selector ===== */
.vehicle-selector {
    margin-top: 12px;
}

.vehicle-selector-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vehicle-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vehicle-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--white);
}

.vehicle-option:hover {
    border-color: var(--primary);
    background: #f8f7ff;
}

.vehicle-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0eeff, #ebe9ff);
    box-shadow: 0 0 0 1px var(--primary);
}

.vehicle-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f4ff;
    border-radius: 12px;
    flex-shrink: 0;
}

.vehicle-option.selected .vehicle-icon {
    background: rgba(108, 99, 255, 0.15);
}

.vehicle-info {
    flex: 1;
    min-width: 0;
}

.vehicle-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
}

.vehicle-desc {
    font-size: 12px;
    color: var(--gray);
    margin-top: 2px;
}

.vehicle-price {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
    white-space: nowrap;
    text-align: right;
}

/* ===== Search Results ===== */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.search-result-item:hover {
    background: rgba(108, 99, 255, 0.05);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* ===== Driver List ===== */
.driver-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--white);
    transition: var(--transition);
}

.driver-list-item:hover {
    box-shadow: var(--shadow);
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.driver-details h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.driver-details p {
    font-size: 13px;
    color: var(--gray);
}

.driver-price {
    text-align: right;
}

.driver-price .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.driver-price .per-km {
    font-size: 12px;
    color: var(--gray);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--light-gray);
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== Modal ===== */
/* Modal styles removed - now using dedicated pages */

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark);
}

.empty-state p {
    font-size: 14px;
}

/* ===== Alert ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.alert.visible {
    display: block;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

.alert-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px;
    }

    .navbar {
        padding: 0 12px;
        gap: 8px;
    }

    .navbar .brand {
        font-size: 18px;
        gap: 6px;
    }

    .navbar .nav-right {
        gap: 8px;
    }

    .navbar .user-info {
        font-size: 13px;
        max-width: 120px;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }

    .auth-card {
        padding: 24px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .map-container {
        height: 300px;
    }

    .chat-container {
        height: 400px;
    }

    .order-card .order-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .order-actions {
        justify-content: flex-start;
    }

    .active-order-actions {
        flex-wrap: wrap;
    }

    .active-order-meta {
        flex-wrap: wrap;
    }
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Chat Page Layout ===== */
.chat-fullpage-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px);
}

.chat-fullpage-container .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f8ff;
}

.chat-fullpage-container .chat-input-container {
    padding: 16px 20px;
    background: var(--white);
    border-top: 1px solid var(--light-gray);
}

.chat-fullpage-container .chat-input-container input {
    font-size: 15px;
    padding: 14px 20px;
}

/* ===== Hidden ===== */
.hidden {
    display: none !important;
}

/* ===== Page sections ===== */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

/* ===== Finding driver animation ===== */
.finding-driver {
    text-align: center;
    padding: 40px;
}

.finding-driver .pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    margin: 0 auto 20px;
    animation: pulse 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 99, 255, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(108, 99, 255, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(108, 99, 255, 0); }
}

.finding-driver h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.finding-driver p {
    color: var(--gray);
    font-size: 14px;
}

/* ===== Star Rating ===== */
.order-rating-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid var(--light-gray);
    background: #FAFAFA;
    border-radius: 0 0 var(--radius) var(--radius);
}

.rating-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}

.star-rating-input {
    display: inline-flex;
    gap: 2px;
}

.star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    font-size: 22px;
    line-height: 1;
    transition: transform 0.15s ease;
    color: #D0D0D0;
}

.star-btn:hover {
    transform: scale(1.25);
}

.star-btn.active {
    color: #FFB800;
}

.rating-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.rating-display .star {
    font-size: 18px;
    line-height: 1;
}

.rating-display .star.filled {
    color: #FFB800;
}

.rating-display .star.empty {
    color: #D0D0D0;
}

.rating-text {
    font-size: 13px;
    color: var(--gray);
    margin-left: 4px;
}

.avg-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #FFB800;
}

.avg-rating .star {
    font-size: 16px;
}

/* ===== Driver Match Scoring ===== */
.match-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.match-top {
    background: linear-gradient(135deg, #28C76F, #1fa85e);
    color: white;
}

.match-high {
    background: #E8F5E9;
    color: #2E7D32;
}

.match-mid {
    background: #FFF8E1;
    color: #F57F17;
}

.match-low {
    background: var(--light-gray);
    color: var(--gray);
}

.top-match-card {
    border-left: 3px solid var(--success);
}

.match-info-row {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    background: #F8F9FF;
    border-top: 1px solid #ECECF1;
    border-bottom: 1px solid #ECECF1;
}

.match-info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.match-info-label {
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
}

.match-info-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark);
}

/* ===== My Orders Page ===== */
.my-orders-filter {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-chip {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--white);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.scroll-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--gray);
    font-size: 13px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.scroll-end {
    text-align: center;
    padding: 16px;
    color: var(--gray);
    font-size: 13px;
    font-weight: 500;
}
