/* ==========================================================================
   DINO LOGISTICS - RESULT & TIMELINE STYLES (ENHANCED UX)
   Focus: Result Cards, Tables, Stepper, History
   ========================================================================== */

.result-card-premium {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    border-top: 4px solid #ef4444; 
    margin-top: 40px;
    margin-bottom: 60px;
}

.result-header {
    padding: 20px 24px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-header h5 {
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-custom { width: 100%; border-collapse: collapse; }
.table-custom thead th {
    background: #f8fafc; color: #64748b; font-size: 0.75rem;
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 16px 24px; border-bottom: 1px solid #e2e8f0; text-align: left;
}
.table-custom tbody td {
    padding: 20px 24px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; color: #1e293b; font-size: 0.95rem; background: #ffffff;
}
.table-custom tbody tr.main-row { transition: background-color 0.2s ease; cursor: pointer; }
.table-custom tbody tr.main-row:hover { background-color: #f8fafc; }

.toggle-icon {
    width: 28px; height: 28px; border-radius: 50%; background: #f1f5f9;
    color: #ef4444; display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; transition: transform 0.3s ease, background 0.3s;
}
.main-row:hover .toggle-icon { background: #ef4444; color: white; }

.tracking-detail-row { background: #ffffff; }
.detail-wrapper {
    padding: 40px; border-left: 4px solid #ef4444; 
    background: #f8fafc; margin: 20px; border-radius: 8px;
    border: 1px solid #f1f5f9; box-shadow: none;
}

/* ==========================================================================
   TIMELINE & STEPPER UI (IMPROVED)
   ========================================================================== */
.step-wizard {
    display: flex; justify-content: space-between;
    margin-bottom: 50px; position: relative; padding: 0 10px;
}
.step-wizard::before {
    content: ''; position: absolute; top: 18px; left: 30px; right: 30px;
    height: 2px; background: #e2e8f0; z-index: 0;
}
.step-item {
    position: relative; z-index: 1; text-align: center;
    flex: 1; display: flex; flex-direction: column; align-items: center;
}
.step-circle {
    width: 36px; height: 36px; background: white; border: 2px solid #e2e8f0;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px; font-weight: 700; font-size: 0.85rem; color: #94a3b8;
    transition: all 0.3s ease;
}
.step-label {
    font-size: 0.65rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.05em; background: #f8fafc; padding: 0 6px;
}

/* STEPPER STATES */
/* 1. Passed Steps (Abu-abu gelap) */
.step-item.passed .step-circle { border-color: #94a3b8; color: #94a3b8; }
.step-item.passed .step-label { color: #64748b; }

/* 2. Active/Current Step (Merah) */
.step-item.active .step-circle {
    border-color: #ef4444; background: #ef4444; color: white;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); transform: scale(1.1);
}
.step-item.active .step-label { color: #ef4444; }

/* 3. Delivered/Success Step (Hijau) */
.step-item.success .step-circle {
    border-color: #10b981; background: #10b981; color: white;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15); transform: scale(1.1);
}
.step-item.success .step-label { color: #10b981; }


/* ==========================================================================
   VERTICAL HISTORY LIST (IMPROVED UX)
   ========================================================================== */
.history-title {
    font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 24px;
    display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px;
}
.timeline-v { position: relative; padding-left: 10px; }
.timeline-v::before {
    content: ''; position: absolute; top: 8px; bottom: 0; left: 24px;
    width: 2px; background: #e2e8f0; /* Garis lebih tegas */
}

.history-item { position: relative; padding-left: 60px; padding-bottom: 35px; }

/* Default Circle (Past History - Muted) */
.history-item::before {
    content: ''; position: absolute; left: 19px; top: 6px; width: 12px; height: 12px;
    border-radius: 50%; background: #cbd5e1; border: 2px solid #f8fafc;
    z-index: 2; box-shadow: 0 0 0 1px #e2e8f0;
}

/* DATE & TIME PISAH BIAR RAPI */
.history-datetime {
    margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.history-date { font-size: 0.8rem; color: #64748b; font-weight: 500; }
.history-time { font-size: 0.8rem; color: #0f172a; font-weight: 700; background: #f1f5f9; padding: 2px 6px; border-radius: 4px;}

/* STATUS TEXT */
.history-status { font-size: 1rem; font-weight: 800; color: #475569; text-transform: uppercase; letter-spacing: 0.02em; }
.history-desc { font-size: 0.95rem; color: #334155; margin-top: 6px; line-height: 1.5; }

/* --- ACTIVE STATE (POSISI SAAT INI / MERAH) --- */
.history-item.active::before {
    background: #ef4444; width: 16px; height: 16px; left: 17px; top: 4px;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
    animation: pulse-red 2s infinite;
}
.history-item.active .history-status { color: #ef4444; }
.history-item.active .history-desc { font-weight: 500; color: #0f172a; }

/* --- SUCCESS STATE (DELIVERED / HIJAU) --- */
.history-item.success::before {
    background: #10b981; width: 16px; height: 16px; left: 17px; top: 4px;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}
.history-item.success .history-status { color: #10b981; }
.history-item.success .history-desc { font-weight: 500; color: #0f172a; }

/* ANIMASI PULSE UNTUK STATUS TERKINI */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* TOMBOL LIHAT BUKTI (Proof Button) */
.btn-proof {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 12px; font-size: 0.85rem; padding: 6px 14px;
    background-color: #fff; border: 1px solid #cbd5e1; color: #334155;
    border-radius: 20px; text-decoration: none; font-weight: 600;
    transition: all 0.2s;
}
.btn-proof:hover {
    background-color: #f8fafc; border-color: #94a3b8; color: #0f172a;
}
.btn-proof i { color: #ef4444; }

@media (max-width: 768px) {
    .step-label { display: none; }
    .detail-wrapper { padding: 25px 20px; margin: 10px 0; border-left-width: 4px; }
    .table-custom thead { display: none; }
}