/* === GIAO DIỆN TRA CỨU HIỆN ĐẠI - ĐOÀN THANH NIÊN === */
:root {
    /* Brand Colors - Youth Union */
    --brand-blue: #0065BD;
    /* Xanh Đoàn */
    --brand-blue-dark: #004d91;
    --brand-blue-light: #e6f0fa;
    --brand-accent: #DA251C;
    /* Đỏ cờ (nhấn) */

    /* Neutral Colors */
    --text-main: #1e293b;
    --text-sub: #64748b;
    --bg-page: #f0f4f8;
    --bg-card: #ffffff;
    --border-light: #e2e8f0;

    /* Functional Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Effects */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-blue: 0 10px 25px -5px rgba(0, 101, 189, 0.25);

    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Abstract Shapes */
.bg-shape-1,
.bg-shape-2 {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

.bg-shape-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--brand-blue-light) 0%, rgba(255, 255, 255, 0) 70%);
    top: -100px;
    right: -100px;
}

.bg-shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #e0f2fe 0%, rgba(255, 255, 255, 0) 70%);
    bottom: -50px;
    left: -100px;
}

/* --- HEADER --- */
.app-header {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-wrapper {
    flex-shrink: 0;
}

.logo-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.title-group h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--brand-blue);
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.title-group .subtitle {
    font-size: 0.8rem;
    color: var(--text-sub);
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 0.1rem;
}

/* --- MAIN CONTAINER --- */
.main-container {
    max-width: 600px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* --- CARDS --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid white;
    box-shadow: var(--shadow-lg);
}

/* --- SEARCH SECTION --- */
.search-card {
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Decoration line top */
.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-light));
}

.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* Form Styles */
.search-form {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.input-group input {
    flex: 1;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    background: #fff;
    transition: var(--transition);
    color: var(--text-main);
    font-weight: 600;
}

.input-group input:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 101, 189, 0.1);
}

/* Rounded Input Variant for Modal */
.input-rounded {
    border-radius: 99px !important;
    text-align: center;
    border: 1px solid var(--brand-blue) !important;
}

/* End of Input Styles */

.input-group input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--brand-blue);
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 6px -1px rgba(0, 101, 189, 0.2);
}

.btn-primary:hover {
    background: var(--brand-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 101, 189, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.divider {
    display: flex;
    align-items: center;
    color: var(--text-sub);
    font-size: 0.8rem;
    font-weight: 600;
    margin: 1.5rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.divider span {
    padding: 0 1rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem;
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: var(--text-sub);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
    background: var(--brand-blue-light);
}

.btn-full {
    width: 100%;
}

/* --- RESULTS SECTION --- */
#results-section {
    animation: slideUp 0.4s ease-out;
}

.result-header {
    text-align: center;
    background: linear-gradient(135deg, var(--brand-blue), #004d91);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-blue);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

/* Subtle pattern overlay */
.result-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

.result-header .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-header .plate-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: var(--transition);
    animation: fadeIn 0.5s ease backwards;
}

.history-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

/* HIỆU ỨNG CHO MỤC MỚI NHẤT */
.history-card.latest-highlight {
    border: 2px solid var(--brand-blue);
    background: #f8fbff;
    position: relative;
    box-shadow: 0 0 0 4px rgba(0, 101, 189, 0.1);
    animation: highlightPulse 2s infinite;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 101, 189, 0.2);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(0, 101, 189, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 101, 189, 0);
    }
}

.latest-badge {
    background: linear-gradient(135deg, #FF6B6B, #EE5253);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(238, 82, 83, 0.3);
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-3px);
    }

    60% {
        transform: translateY(-1.5px);
    }
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-item .label {
    color: var(--text-sub);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-item .value {
    color: var(--text-main);
    font-weight: 600;
    text-align: right;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-badge.parking {
    background: #dcfce7;
    color: #166534;
}

.status-badge.departed {
    background: #f1f5f9;
    color: #475569;
}

/* Fee Details */
.fee-value-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.fee-details-toggle {
    background: transparent;
    border: none;
    color: var(--brand-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.fee-details-toggle:hover {
    background: var(--brand-blue-light);
}

.fee-details-toggle.expanded svg {
    transform: rotate(180deg);
}

.fee-details-content {
    background: #f8fafc;
    margin-top: 1rem;
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.9rem;
    display: none;
    /* JS will toggle */
    border: 1px solid var(--border-light);
}

.fee-details-content.visible {
    display: block;
    animation: fadeIn 0.3s;
}

/* === FEE RECEIPT STYLES === */
.fee-receipt {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-light);
    font-size: 0.9rem;
}

.fee-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fee-row.header {
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 0.25rem;
}

.fee-label {
    flex: 2;
    color: var(--text-main);
}

.fee-time {
    flex: 1;
    text-align: right;
    color: var(--text-sub);
    font-size: 0.85rem;
}

.fee-amount {
    flex: 1;
    text-align: right;
    font-weight: 600;
    color: var(--text-main);
}

.fee-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border-light);
    font-weight: 700;
    font-size: 1rem;
    color: var(--brand-blue);
}


/* --- MODAL --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 420px;
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.modal-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* Specific Phone Modal Styles */
#phone-verify-form .btn-primary,
#phone-verify-form .btn-secondary {
    border-radius: 99px;
    /* Pill shape buttons */
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 700;
}

#phone-verify-form .btn-secondary {
    background: white;
    border: 1px dashed var(--border-light);
    color: var(--text-sub);
}

#phone-verify-form .btn-secondary:hover {
    border-color: var(--text-sub);
    color: var(--text-main);
}


.modal-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

#camera-feed {
    width: 100%;
    border-radius: var(--radius-md);
    background: black;
    margin-bottom: 1.5rem;
}

#close-scanner-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-page);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

#close-scanner-btn:hover {
    background: #e2e8f0;
}

/* --- ANIMATIONS --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .search-card {
        padding: 1.5rem;
    }

    .search-form .input-group {
        flex-direction: column;
    }

    .btn-primary {
        width: 100%;
        padding: 0.875rem;
    }

    .result-header .plate-number {
        font-size: 2rem;
    }
}

/* --- LOADING & MESSAGES --- */
.message-box,
.loading-box {
    text-align: center;
    padding: 2rem;
    color: var(--text-sub);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-light);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === NEW UI ENHANCEMENTS (REVISED & FIXED) === */

/* 1. TOAST NOTIFICATIONS */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 320px;
    max-width: 400px;
    animation: toastSlideIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    border-left: 5px solid var(--brand-blue);
    position: relative;
    overflow: hidden;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast-message {
    color: #1e293b;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 2. PREMIUM EMAIL BUTTON (GLOBAL) */
.btn-email {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-email:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(245, 158, 11, 0.3);
    filter: brightness(1.05);
}

/* 3. MODAL & FORM STYLING (FIXED) */
.modal-icon-wrapper {
    width: 72px;
    height: 72px;
    background: rgba(0, 101, 189, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--brand-blue);
}

.modal-icon-wrapper svg {
    width: 36px;
    height: 36px;
    stroke-width: 1.5px;
}

/* FIX FLEX CONFLICT */
/* FIX FLEX CONFLICT */
#email-receipt-form .input-group {
    display: block !important;
    position: relative !important;
    margin-bottom: 1.5rem !important;
}

/* Icon positioning */
#email-receipt-form .input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    z-index: 10;
    width: 20px;
    height: 20px;
    transition: color 0.3s;
}



/* Modern Input Field */
#email-receipt-form .input-rounded {
    width: 100%;
    padding: 16px 20px 16px 52px !important;
    /* Left padding for icon */
    font-size: 1rem;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px;
    /* Not pill, modern rounded rect */
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
    font-weight: 500;
    text-align: left !important;
    /* Left align is better for typing */
}

#email-receipt-form .input-rounded:focus {
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 4px rgba(0, 101, 189, 0.1);
    outline: none;
}

#email-receipt-form .input-rounded::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

/* ENVELOPE ANIMATION */
#email-receipt-form .input-icon {
    overflow: visible;
    /* Allow flap to go outside */
    pointer-events: none;
    /* Click through to input */
}

#email-receipt-form .input-icon polyline {
    transform-origin: 12px 6px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Trigger animation when adjacent input is focused */
#email-receipt-form input:focus+.input-icon polyline {
    transform: scaleY(-1);
}

#email-receipt-form input:focus+.input-icon {
    color: var(--brand-blue);
    filter: drop-shadow(0 2px 3px rgba(0, 101, 189, 0.2));
}

/* Premium Primary Button in Modal */
#email-receipt-form .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #0065BD 0%, #00509d 100%);
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px -6px rgba(0, 101, 189, 0.4);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#email-receipt-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 101, 189, 0.5);
    background: linear-gradient(135deg, #0074d9 0%, #005bb5 100%);
}

#email-receipt-form .btn-secondary {
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 12px;
    margin-top: 4px;
    width: 100%;
    cursor: pointer;
    transition: color 0.2s;
}

#email-receipt-form .btn-secondary:hover {
    color: var(--text-main);
    text-decoration: underline;
    background: transparent;
}

/* SUCCESS MODAL STYLES */
.success-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon-wrapper svg {
    width: 40px;
    height: 40px;
    stroke-width: 3px;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Specific Premium Button for Success Modal */
#email-success-modal .btn-primary {
    width: 100% !important;
    /* Forces full width */
    padding: 16px 24px !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.5) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: block !important;
    margin-top: 1rem;
}

#email-success-modal .btn-primary:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 12px 25px -8px rgba(16, 185, 129, 0.7) !important;
    filter: brightness(1.1);
}

#email-success-modal .btn-primary:active {
    transform: translateY(-1px) !important;
}

/* Button Loading State */
.btn-loading {
    color: transparent !important;
    position: relative;
    pointer-events: none;
    cursor: wait;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    margin-top: -12px;
    margin-left: -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: btnSpin 0.8s linear infinite;
}

@keyframes btnSpin {
    to {
        transform: rotate(360deg);
    }
}

/* LIST VIEW EXPANSION STYLES */
.history-card-body.collapsed {
    display: none;
}

.history-card-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-card-header.active .header-action svg {
    transform: rotate(180deg);
}

.header-action svg {
    transition: transform 0.3s ease;
}




/* MODERN CARD DESIGN */
.history-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Minimal shadow */
    overflow: hidden;
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.history-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Latest Card Accent */
.history-card.latest-card {
    border: 1px solid var(--brand-blue);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}





.history-card-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    background: #fff;
    cursor: pointer;
    gap: 16px;
    position: relative;
    transition: background-color 0.2s;
}

.history-card-header:hover {
    background-color: #f8fafc;
}

/* Add separation line and spacing only when body is visible */
.history-card-body {
    padding: 24px 20px 20px;
    border-top: 1px dashed #e2e8f0;
    background: #fff;
}


/* 1. Icon Box */
.header-icon-box {
    width: 52px;
    /* Balanced size */
    height: 52px;
    border-radius: 16px;
    /* Softer roundness */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon-box.parking {
    background: #ecfdf5;
    color: #10b981;
}

.header-icon-box.departed {
    background: #f1f5f9;
    color: #64748b;
}

/* 2. Info Column */
.header-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center vertically */
    gap: 8px;
    /* Balanced gap */
}

.header-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-text-refined {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Latest Text */
.latest-text {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand-blue);
    background: rgba(14, 165, 233, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-time-row {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 400;
}

/* 3. Arrow Column */
.header-arrow-col {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.history-card-header.active .header-arrow-col svg {
    transform: rotate(180deg);
}

/* End of Card Header Styles */

/* Ensure body respects collapsed state even in latest card */
.history-card-body.collapsed {
    display: none;
}

.history-card.latest-card .history-card-body {
    background: white;
}