/* ==========================================================================
   Order Tracking System - Customer Frontend CSS
   ========================================================================== */

:root {
    --primary-color: #DC2626;
    --secondary-color: #991B1B;
    --header-bg-color: #DC2626;
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 1. Header - Logo Centered Only with Configurable Background */
.site-header {
    background-color: var(--header-bg-color);
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-logo-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 55px;
    text-decoration: none;
}

.header-logo-wrapper img {
    width: var(--logo-width, 160px);
    max-width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

.default-logo-text {
    font-size: 1.6rem;
    font-weight: 900;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 2. Visual Hero Container (Full Screen Height Desktop & Mobile) */
.hero-container {
    width: 100%;
    min-height: calc(100vh - 70px);
    height: calc(100vh - 70px);
    position: relative;
    overflow: hidden;
    background-color: #0F172A;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.hero-single-mode {
    background-color: #F8FAFC;
    padding: 0;
    height: auto;
    min-height: auto;
    overflow: visible;
    display: block;
}

.slider-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.single-image-wrapper {
    width: 100%;
    position: relative;
}

.hero-slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-slide.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

.hero-picture {
    display: block;
    width: 100%;
    height: 100%;
}

.hero-picture img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Single Image Centered Layout */
.single-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px 80px 20px;
    background: transparent;
}

.single-centered-img {
    width: var(--single-desktop-width, 650px);
    max-width: 100%;
    height: var(--single-desktop-height, auto);
    display: block;
    box-shadow: none !important;
}

.single-centered-img img {
    width: 100%;
    max-width: 100%;
    height: var(--single-desktop-height, auto);
    display: block;
    margin: 0 auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: none !important;
}

/* Inline Track Form container responsive width */
.inline-track-container {
    width: 100%;
    max-width: 420px; /* Mobile width */
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    text-align: left;
}

@media (min-width: 769px) {
    .inline-track-container {
        max-width: var(--single-desktop-width, 650px); /* Desktop width matching the single desktop image setting */
    }
}

.fallback-hero-slide {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 40px 20px 100px 20px;
    text-align: center;
    color: #FFFFFF;
}

/* Slider Controls */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.slider-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.08);
}

.slider-arrow.prev { left: 16px; }
.slider-arrow.next { right: 16px; }

.slider-dots {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #FFFFFF;
    width: 24px;
    border-radius: 12px;
}

/* 3. TRACE & TRACK OVERLAY BAR AT BOTTOM OF HERO (CENTERED ON DESKTOP) */
.trace-track-bar-container {
    width: auto;
    min-width: 480px;
    max-width: 700px;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background: rgba(30, 30, 30, 0.78);
    backdrop-filter: blur(8px);
    padding: 12px 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: none;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.trace-track-bar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: space-between;
}

.trace-btn-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trace-truck-svg {
    color: #FFFFFF;
    fill: currentColor;
    display: inline-block;
}

.trace-search-svg {
    color: #FFFFFF;
    stroke: currentColor;
    display: inline-block;
}

.trace-track-bar-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    border-color: rgba(255, 255, 255, 0.6);
}

.trace-title-text {
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
}

.trace-icon {
    font-size: 1.2rem;
}

.trace-search-icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 4. FLOATING CHAT WITH US WIDGET (BOTTOM RIGHT CORNER) */
.floating-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    background: var(--primary-color);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 12px;
    padding: 8px 14px 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-chat-widget:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 12px 30px rgba(220, 38, 38, 0.5);
    background: var(--secondary-color);
}

.chat-avatar-badge {
    width: 38px;
    height: 38px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.chat-label-text {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-align: left;
}

/* WhatsApp Custom Image Button Styling */
.floating-chat-widget.floating-chat-image-mode {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    display: block;
}

.floating-chat-widget.floating-chat-image-mode:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-6px) scale(1.05);
}

.floating-chat-custom-img {
    display: block;
    width: var(--wa-btn-width, 160px);
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.2));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.floating-chat-widget.floating-chat-image-mode:hover .floating-chat-custom-img {
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.3));
}

/* Modal Popup Tracking */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #F1F5F9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: #E2E8F0;
    color: var(--text-main);
}

.modal-header-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
}

.modal-header-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-main);
    background-color: #F8FAFC;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.btn-primary-custom {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary-custom:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* Tracking Result Display */
.result-header {
    background: #F8FAFC;
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    text-align: left;
    border-left: 4px solid var(--primary-color);
}

.result-greeting {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-main);
}

.result-info-box {
    text-align: left;
    margin-bottom: 20px;
}

.result-item {
    margin-bottom: 12px;
}

.result-item-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.result-item-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

.status-highlight-card {
    background: #FFF5F5;
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.status-large-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.status-title-text {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.status-description-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 16px;
}

.status-timestamp {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #FFFFFF;
    padding: 6px 14px;
    border-radius: 50px;
    display: inline-block;
    border: 1px solid var(--border-color);
}

/* Not Found Card */
.not-found-card {
    text-align: center;
    padding: 24px 10px;
}

.not-found-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

.not-found-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #EF4444;
    margin-bottom: 8px;
}

.not-found-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 16px;
    }

    .trace-track-bar-container {
        left: 0;
        transform: none;
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-radius: 0;
        padding: 8px 12px;
    }

    .trace-track-bar-btn {
        max-width: 100%;
        font-size: 0.88rem;
        padding: 10px 14px;
    }

    .floating-chat-widget {
        bottom: 16px;
        right: 16px;
        padding: 6px 12px 6px 8px;
    }

    .chat-avatar-badge {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .chat-label-text {
        font-size: 0.7rem;
    }

    .floating-chat-custom-img {
        width: calc(var(--wa-btn-width, 160px) * 0.8);
        max-width: 140px;
    }

    .single-centered-img {
        width: var(--single-mobile-width, 300px);
        height: var(--single-mobile-height, auto);
    }

    .single-centered-img img {
        height: var(--single-mobile-height, auto);
    }

    .modal-card {
        padding: 24px 20px;
    }
}

/* Tracking Timeline Stepper */
.tracking-timeline-container {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.timeline-stepper {
    display: flex;
    flex-direction: column;
    position: relative;
    padding-left: 5px;
}

.timeline-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    position: relative;
    align-items: flex-start;
}

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

.timeline-time-col {
    flex: 0 0 95px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.35;
    padding-top: 2px;
}

.timeline-time-col .timeline-date {
    white-space: nowrap;
}

.timeline-time-col .timeline-hour {
    color: #64748B;
    font-weight: 500;
    font-size: 0.72rem;
    margin-top: 2px;
}

.timeline-node-col {
    flex: 0 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    align-self: stretch;
}

.timeline-circle {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2.5px solid #475569;
    background: #FFFFFF;
    z-index: 2;
    margin-top: 5px;
    transition: all 0.3s ease;
}

/* The first step is the active/latest status */
.timeline-step:first-child .timeline-circle {
    border-color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.timeline-line {
    width: 0;
    border-left: 2px dashed #475569;
    position: absolute;
    top: 22px;
    bottom: -26px;
    left: 9px;
    z-index: 1;
}

.timeline-desc-col {
    flex-grow: 1;
    text-align: left;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #1E293B;
    padding-top: 0;
}

.timeline-checkpoint-desc {
    word-wrap: break-word;
}

.timeline-checkpoint-desc p {
    margin-bottom: 4px;
}

.timeline-checkpoint-desc p:last-child {
    margin-bottom: 0;
}
