/* ───────────────────────────────────────────────
   Consolidated & Fixed Styles
─────────────────────────────────────────────── */

.wgl-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 15px;
}

.tracking-form-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.08);
    padding: 28px 20px;
    margin-bottom: 32px;
}

.tracking-form-section h2 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 700;
    color: #111;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
}

.input_track_num {
    flex: 1;
    min-width: 260px;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: all 0.25s;
}

.input_track_num:focus {
    border-color: #ff7d44;
    box-shadow: 0 0 0 4px rgba(255,125,68,0.2);
    outline: none;
}

.btn-track {
    padding: 14px 36px;
    font-weight: 600;
    background: linear-gradient(90deg, #ff7d44, #e06b38);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(255,125,68,0.3);
}

.btn-track:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255,125,68,0.4);
}

/* Results */
.tracking-results {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.07);
    padding: 28px;
}

/* Top Status Area */
.status-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: #fafafa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 32px;
}

.tracking-main-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tracking-number {
    font-size: 1.9rem;
    font-weight: 700;
    color: #111;
}

.status-badge {
    padding: 8px 20px;
    color: white;
    font-weight: 700;
    border-radius: 50px;
    font-size: 1rem;
    display: inline-block;
}

.btn-print {
    padding: 12px 32px;
    background: #f97316;
    color: #ffffff;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.25s;
}

.btn-print:hover {
    background: #c2410c;
    color: #ffffff;
    transform: translateY(-1px);
}

/* Progress Steps */
.progress-container {
    display: flex;
    align-items: center;
    margin: 40px 0;
    position: relative;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
}

.step-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 10px;
}

.step-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
}

.step.active .step-label {
    color: #ff7d44;
}

.step-connector {
    height: 4px;
    flex-grow: 1;
    background: #e2e8f0;
    margin: 0 6px;
    position: relative;
    top: -24px;
}

.step-connector.active {
    background: linear-gradient(to right, #ff7d44, #e06b38);
}

/* Compact status detail */
.status-detail-compact {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 24px 0;
    border-left: 4px solid #ff7d44;
}

.detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.detail-label {
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.detail-value {
    font-weight: 500;
    color: #1e293b;
}

.detail-value.danger {
    color: #dc2626;
}

.scroll-hint {
    font-size: 0.9rem;
    color: #64748b;
    font-style: italic;
    margin: 0;
}

/* Side-by-side Timeline + Map */
.history-map-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin: 40px 0;
}

@media (min-width: 992px) {
    .history-map-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Timeline */
.timeline-section {
    margin: 0;
}

.timeline-section .section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.2rem;
}

.timeline-container {
    position: relative;
    padding-left: 36px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 16px;
    width: 3px;
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    transition: all 0.3s;
}

.timeline-dot {
    position: absolute;
    left: -36px;
    top: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 4px solid white;
    box-shadow: 0 0 0 4px #e2e8f0;
    z-index: 2;
    transition: all 0.3s;
}

.timeline-item.latest .timeline-dot {
    background: #ff7d44;
    border-color: #ff7d44;
    box-shadow: 0 0 0 6px rgba(255,125,68,0.25);
    animation: pulse-dot 2s infinite;
}

.timeline-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    transition: all 0.3s;
}

.timeline-item.latest .timeline-content {
    border-color: #ff7d44;
    box-shadow: 0 4px 16px rgba(255,125,68,0.15);
}

.timeline-date {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.timeline-location, .timeline-status {
    margin: 6px 0;
    font-size: 1rem;
}

.timeline-remark {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    transition: all 0.3s;
}

.remark-label {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
    margin-bottom: 4px;
}

.remark-text {
    color: #334155;
    line-height: 1.45;
    transition: max-height 0.3s ease;
}

/* Pulse animation */
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(255,125,68,0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255,125,68,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,125,68,0); }
}

/* Map Section */
.map-section {
    margin: 0;
}

.map-section .section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.2rem;
}

.map-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.map-fallback {
    height: 380px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
    padding: 30px;
}

.map-fallback p {
    font-weight: 600;
    margin-bottom: 8px;
}

/* Info Blocks */
.info-blocks {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 32px 0;
}

.info-block {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.info-header {
    background: #6c757d;
    color: white;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 1.05rem;
}

.info-content {
    padding: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.info-content h6 {
    margin: 2px 0 10px;
    font-size: 1.05rem;
    color: #222;
}

.divider {
    height: 1px;
    background: #dee2e6;
    margin: 10px 0;
}

/* Shipment + Package Image row (side by side on desktop, stacked on mobile) */
.shipment-package-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 32px 0;
}

.shipment-info {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.shipment-info .info-header {
    background: #495057;
}

.package-image-block {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.package-image-block .info-header {
    background: #495057;
}

.package-image-wrap {
    text-align: center;
}

.package-image-block .package-image {
    max-width: 100%;
    height: auto;
    max-height: 280px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.package-image-block .no-image-msg {
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

/* Not Found */
.not-found {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}

.not-found h2 {
    color: #c53030;
    margin-bottom: 16px;
}

.not-found button {
    margin-top: 16px;
    padding: 12px 40px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Responsive */
@media (min-width: 768px) {
    .progress-container {
        flex-wrap: nowrap;
    }
    .step-connector {
        display: block;
    }
    .info-blocks {
        flex-direction: row;
        gap: 24px;
    }
    .info-block {
        flex: 1;
    }
    .shipment-package-row {
        flex-direction: row;
        gap: 24px;
    }
    .shipment-info,
    .package-image-block {
        flex: 1;
    }
}

@media (max-width: 767px) {
    .progress-container {
        flex-wrap: wrap;
        gap: 24px 12px;
        justify-content: center;
    }
    .step {
        flex: 0 0 45%;
        max-width: 45%;
    }
    .step-connector {
        display: none !important;
    }
    .status-top {
        flex-direction: column;
        text-align: center;
    }
    .history-map-container {
        grid-template-columns: 1fr;
    }
    .map-wrapper iframe {
        height: 320px;
    }
}

@media (max-width: 480px) {
    .step {
        flex: 0 0 48%;
        max-width: 48%;
    }
}
