/* Timeline Screen Modern UI - Premium Aesthetics */
.timeline-container {
    font-family: 'DM Sans', sans-serif;
    padding: 70px 20px 80px 20px;
    background: var(--bg-color, #f4f6f8);
    min-height: 100vh;
    color: var(--text-color, #333);
}

.dark-mode .timeline-container {
    --bg-color: #121212;
    --text-color: #fff;
    --card-bg: rgba(30, 30, 30, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
}

.timeline-container {
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.05);
    --primary: #00a63c; /* AfriDelivery Green */
    --inactive: #d1d5db;
}

/* Glassmorphism Map Card */
.timeline-map-card {
    background: var(--card-bg);
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -70px;
    margin-bottom: 24px;
    border-radius: 0 0 24px 24px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease forwards;
}

#timeline_map {
    width: 100%;
    height: 250px;
    background: #e0e0e0; /* Placeholder color before map loads */
}

/* Order Details Card */
.timeline-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease forwards 0.1s;
}

.timeline-rider-status {
    background: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
    padding: 12px 16px;
    margin-bottom: 24px;
    border-radius: 4px 8px 8px 4px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
    animation: slideUpFade 0.6s ease forwards 0.2s;
}

.timeline-rider-status i {
    color: #ff9800;
    font-size: 20px;
    margin-top: 2px;
}

.timeline-rider-status strong {
    font-weight: 600;
    color: #ff9800;
    display: block;
    margin-bottom: 4px;
}

.timeline-header-info h5 {
    margin: 0 0 4px 0;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-color);
}

.timeline-header-info p {
    margin: 0 !important;
    font-size: 0.95rem;
    color: #888;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 6px;
    text-align: left !important;
    width: 100%;
}

.timeline-header-info p i {
    font-size: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.order-total {
    text-align: right;
}

.order-total span {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.order-total strong {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 600;
}

/* Vertical Timeline Steps */
.timeline-steps {
    position: relative;
    padding: 10px 0 20px 20px;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease forwards 0.2s;
}

.timeline-steps::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 35px; /* aligned with center of circles */
    width: 2px;
    background: var(--inactive);
    z-index: 1;
}

.timeline-step {
    position: relative;
    padding-left: 50px;
    margin-bottom: 30px;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.step-icon {
    position: absolute;
    left: -4px;
    top: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--inactive);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--inactive);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.timeline-step.active .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 166, 60, 0.5);
    transform: scale(1.1);
}

.timeline-step.completed .step-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Connecting line progressive coloring */
.timeline-step.completed::after {
    content: '';
    position: absolute;
    left: 15px; /* Match left offset for line */
    top: 38px;
    width: 2px;
    height: calc(100% - 8px);
    background: var(--primary);
    z-index: 1;
}

.step-content {
    padding-top: 8px;
}

.step-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.timeline-step.active .step-title,
.timeline-step.completed .step-title {
    color: var(--text-color);
}

.step-desc {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
    display: none;
    animation: fadeIn 0.4s ease;
}

.timeline-step.active .step-desc,
.timeline-step.cancelled .step-desc {
    display: block;
}

/* Button */
.btn-new-order {
    display: block;
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #AE2326 0%, #d32f2f 100%);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    box-shadow: 0 8px 20px rgba(174, 35, 38, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease forwards 0.3s;
}

.btn-new-order:hover, .btn-new-order:active {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(174, 35, 38, 0.4);
    background: linear-gradient(135deg, #d32f2f 0%, #AE2326 100%);
}

/* Cancelled State */
.timeline-step.cancelled .step-icon {
    background: #AE2326;
    border-color: #AE2326;
    color: #fff;
    box-shadow: 0 0 15px rgba(174, 35, 38, 0.5);
    animation: pulseRed 2s infinite;
}

.timeline-step.cancelled .step-title {
    color: #AE2326;
}

/* Animations */
@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(174, 35, 38, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(174, 35, 38, 0); }
    100% { box-shadow: 0 0 0 0 rgba(174, 35, 38, 0); }
}

/* Driver Info Card inside Map Container */
.driver-info-badge {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.dark-mode .driver-info-badge {
    background: rgba(30, 30, 30, 0.9);
    color: #fff;
}

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

.driver-details {
    flex: 1;
}

.driver-details h6 {
    margin: 0 0 2px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.driver-details p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.dark-mode .driver-details p {
    color: #aaa;
}

.driver-call-btn {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 166, 60, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
}

.driver-call-btn:hover {
    background: var(--primary);
    color: #fff;
}

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

.timeline-actions .btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFade 0.6s ease forwards 0.3s;
}

.timeline-actions .btn-action {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.timeline-actions .btn-action:hover {
    background: rgba(0,0,0,0.05);
}

.dark-mode .timeline-actions .btn-action:hover {
    background: rgba(255,255,255,0.05);
}

.timeline-actions .btn-primary {
    background: rgba(174, 35, 38, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(174, 35, 38, 0.3);
}

.timeline-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(174, 35, 38, 0.5);
    background: rgba(174, 35, 38, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.timeline-payment-info {
    margin-top: 12px;
    padding: 12px;
    background: rgba(0, 166, 60, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: var(--text-color);
}
.dark-mode .timeline-payment-info {
    background: rgba(0, 166, 60, 0.1);
}

#btn_order_screen_reload {
    position: fixed;
    right: 0;  
    top: 0;
    width: 48px;
    height: 48px;
    padding: 12px;
    cursor: pointer;
    z-index: 1001;
    color: white;
}

#btn_order_screen_chat {
    position: fixed;
    right: 48px;  
    top: 0;
    width: 48px;
    height: 48px;
    padding: 12px;
    cursor: pointer;
    z-index: 1001;
    color: white;
}

#action_layer_content {
    overflow: auto !important;
    height: 100%;
}

/* =========================================================
   Modern Receipt Overlay
========================================================= */
.modern-receipt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000; /* Above action layer */
    display: flex;
    align-items: flex-end; /* Bottom sheet style */
    justify-content: center;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.receipt-container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px 40px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    font-family: inherit;
    color: #333;
}

/* Dark mode support */
body.dark-theme .receipt-container {
    background: #1e1e1e;
    color: #f5f5f5;
}

.receipt-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: background 0.2s;
}

body.dark-theme .receipt-close-btn {
    background: #333;
    color: #aaa;
}

.receipt-close-btn:active {
    background: #e0e0e0;
}

.receipt-header {
    text-align: center;
    padding-bottom: 20px;
}

.receipt-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 8px;
}

.receipt-header h2 {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.receipt-header .receipt-address,
.receipt-header .receipt-order-id,
.receipt-header .receipt-date {
    margin: 2px 0;
    color: #888;
    font-size: 0.95rem;
}

.receipt-divider {
    height: 1px;
    background: #eee;
    margin: 16px 0;
}

body.dark-theme .receipt-divider {
    background: #333;
}

.receipt-divider.dashed {
    background: none;
    border-top: 1px dashed #ccc;
}

body.dark-theme .receipt-divider.dashed {
    border-top: 1px dashed #444;
}

.receipt-items {
    margin: 16px 0;
}

.receipt-item-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 1rem;
}

.receipt-item-qty {
    flex: 0 0 40px;
    font-weight: 600;
    color: #555;
}

body.dark-theme .receipt-item-qty {
    color: #aaa;
}

.receipt-item-name {
    flex: 1;
    padding-right: 12px;
}

.receipt-item-price {
    font-weight: 600;
    white-space: nowrap;
}

.receipt-totals {
    margin: 16px 0;
}

.receipt-tot-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1rem;
    color: #666;
}

body.dark-theme .receipt-tot-row {
    color: #aaa;
}

.receipt-grand-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 16px 0;
    color: var(--primary);
}

.receipt-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.95rem;
    color: #888;
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
}

body.dark-theme .receipt-footer {
    background: #2a2a2a;
    color: #aaa;
}

/* Animations */
.animated {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

@keyframes slideInUp {
    from {
        transform: translate3d(0, 100%, 0);
        visibility: visible;
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}
.slideInUp { animation-name: slideInUp; }

@keyframes slideOutDown {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        visibility: hidden;
        transform: translate3d(0, 100%, 0);
    }
}
.slideOutDown { animation-name: slideOutDown; }

/* New Receipt Styles */
.receipt-thank-you {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin: 8px 0;
}

.receipt-customer-details {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
    text-align: left;
}

body.dark-theme .receipt-customer-details {
    border-top-color: #333;
    color: #aaa;
}

.receipt-customer-details h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

body.dark-theme .receipt-customer-details h4 {
    color: #eee;
}

.receipt-customer-details p {
    margin: 4px 0;
}

.receipt-download-btn {
    width: 100%;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

/* Print styling for PDF generation */
#printable_receipt_area {
    background: white;
    padding: 20px;
}

/* Motorcycle Animation */
@keyframes driveMotorcycle {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(2px) translateY(-1px); }
    50% { transform: translateX(4px) translateY(0); }
    75% { transform: translateX(2px) translateY(1px); }
}

.timeline-step.active .step-icon.is-motorcycle i {
    animation: driveMotorcycle 0.8s infinite linear;
    display: inline-block;
}

