/* Custom styles */
body {
    font-family: 'Inter', sans-serif;
    /* Wavy gradient background from your images */
    background-color: #fdf4ff; /* A light purple fallback */
    background-image: radial-gradient(at 0% 0%, hsla(286, 60%, 93%, 1) 0px, transparent 50%),
                        radial-gradient(at 100% 0%, hsla(339, 60%, 93%, 1) 0px, transparent 50%),
                        radial-gradient(at 100% 100%, hsla(240, 60%, 93%, 1) 0px, transparent 50%),
                        radial-gradient(at 0% 100%, hsla(212, 60%, 93%, 1) 0px, transparent 50%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

/* Custom toast notification */
#toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #581c87; /* theme-purple-800 */
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(200%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    z-index: 100;
}

#toast-notification.show {
    transform: translateY(0);
    opacity: 1;
}

/* Ensure scroll-behavior is smooth */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f3e8ff;
}
::-webkit-scrollbar-thumb {
    background: #a855f7; /* Tailwind's purple-500 */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #581c87; /* theme-purple-800 */
}

/* Payment method styles */
.payment-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

/* QR Code styles */
#payment-qr-code {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Map modal styles - Split Screen Layout */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 60;
}
.modal-backdrop.show {
    display: flex;
}
.modal-content {
    width: 98%;
    height: 95vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

.modal-header { 
    padding: 16px 24px; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 2px solid #eee; 
    background: linear-gradient(135deg, #581c87, #7c3aed); 
}
.modal-header h3 { 
    color: white; 
    margin: 0; 
    font-size: 1.5rem; 
    font-weight: 700; 
}
.modal-close { 
    background: transparent; 
    border: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
    color: white; 
    transition: transform 0.2s; 
}
.modal-close:hover { transform: scale(1.2); }

/* Split Screen Container */
.tracking-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 20px;
    padding: 20px;
    background: #fafafa;
}

/* Left Panel - Map */
.tracking-map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#map { 
    flex: 1;
    min-height: 400px;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

/* Ensure Leaflet map tiles load properly */
.leaflet-container {
    height: 100%;
    width: 100%;
    z-index: 1;
}

.leaflet-tile-container img {
    max-width: none !important;
}

.map-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
    background: white;
    border-top: 1px solid #eee;
}

.map-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-info-label {
    font-size: 0.75rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.map-info-value {
    font-size: 1.1rem;
    color: #581c87;
    font-weight: 700;
}

/* Right Panel - Details */
.tracking-details-section {
    width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow-y: auto;
}

/* Status Section */
.status-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}
.status-badge.in-progress { background: #fef3c7; color: #92400e; }
.status-badge.delivered { background: #dcfce7; color: #166534; }
.status-badge.pending { background: #fee2e2; color: #991b1b; }

.pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Progress Bar Section */
.progress-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.progress-step.active .step-dot {
    background: #7c3aed;
    color: white;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.progress-step.completed .step-dot {
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-align: center;
    font-weight: 500;
}

.progress-step.active .step-label {
    color: #7c3aed;
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: #10b981;
    font-weight: 600;
}

/* Info Cards */
.info-card {
    padding: 14px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #7c3aed;
}

.info-card-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-card-value {
    font-size: 1rem;
    color: #1f2937;
    font-weight: 700;
}

.info-card-subtext {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 2px;
}

/* Driver Card */
.driver-card {
    padding: 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid #fcd34d;
}

.driver-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 2px solid #f59e0b;
}

.driver-info {
    flex: 1;
}

.driver-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.driver-rating {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Action Buttons */
.tracking-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: #581c87;
}

.action-btn:hover {
    background: #f3e8ff;
    border-color: #7c3aed;
}

.action-btn.primary {
    background: #581c87;
    color: white;
    border-color: #581c87;
}

.action-btn.primary:hover {
    background: #7c3aed;
    border-color: #7c3aed;
}

/* Separator */
.divider {
    height: 1px;
    background: #e5e7eb;
}

.payment-option:hover {
    border-color: #a855f7;
}

.payment-option.selected {
    border-color: #581c87;
    background-color: #f3e8ff;
}

.payment-option input[type="radio"] {
    margin-right: 12px;
}

.payment-logo {
    height: 30px;
    margin-right: 12px;
}
