/* Hero */
.hero {
    height: var(--hero-height);
    border-radius: 14px;
    text-align: center;
    padding-top: 24px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    margin: 0;
}

.hero-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Search Card */

.search-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.field-wrap {
    position: relative;
}

.field-select-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 0 12px;
    background: white;
}

.field-select-wrap .field-select {
    border: none;
    padding: 0;
    height: auto;
    flex: 1;
    min-width: 0;
}

.field-select-wrap .field-select:focus {
    box-shadow: none;
}

.field-select-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

.field-select,
.field-input {
    height: 44px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    font-family: inherit;
    width: 100%;
    background: white;
}

.field-select {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.field-input {
    padding-right: 40px;
    font-size: 15px;
    letter-spacing: 1px;
}

.field-input::placeholder {
    color: var(--text-secondary);
}

.field-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

.field-icon-right {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.field-icon-left {
    width: 16px;
    height: 16px;
    color: #2563EB;
    flex-shrink: 0;
}

.btn-search {
    width: 100%;
    height: 46px;
    margin-top: 10px;
    background: linear-gradient(180deg, #3A7BFF, var(--primary));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(47, 107, 255, 0.35);
    font-family: inherit;
}

.btn-search:hover {
    opacity: 0.95;
}

.btn-search:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading */
.search-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.search-loading.active {
    display: flex;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--divider);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result sections (hidden until search) */
.result-section {
    display: none;
}

.result-section.visible {
    display: block;
}

/* 1. Container danh sách vi phạm */
.result-card {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* 2. Header section - Vehicle Summary */
.vehicle-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.vehicle-summary-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vehicle-summary-icon {
    width: 24px;
    height: 24px;
    color: #2563EB;
    flex-shrink: 0;
}

.vehicle-plate {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.vehicle-meta {
    font-size: 14px;
    color: #6B7280;
    margin-top: 2px;
}

.vehicle-summary-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.vehicle-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6B7280;
}

.vehicle-stats .stat-num {
    font-size: 18px;
    font-weight: 700;
}

.stat-total .stat-num { color: #F59E0B; }
.stat-unhandled .stat-num { color: #EF4444; }
.stat-handled .stat-num { color: #10B981; }

.vehicle-updated {
    font-size: 14px;
    color: #6B7280;
}

/* 3–4. Table danh sách vi phạm */
.violation-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.violation-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.violation-table thead tr {
    height: 44px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.violation-table th {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    padding: 12px;
    white-space: nowrap;
}

.violation-table td {
    padding: 12px;
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
}

.violation-table tbody tr:hover {
    background: #F9FAFB;
}

.violation-table .cell-hanhvi,
.violation-table .cell-diachi {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 6. Badge trạng thái */
.badge-processed {
    background: #DCFCE7;
    color: #166534;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-unprocessed {
    background: #FEE2E2;
    color: #991B1B;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.link-detail {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.link-detail:hover {
    text-decoration: underline;
}

/* 7. Expand chi tiết vi phạm */
.violation-detail-row td {
    background: #FAFAFA;
    border-bottom: 1px solid var(--divider);
    padding: 0;
    vertical-align: top;
}

.violation-detail-cell {
    padding: 20px 12px;
}

.violation-detail-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.violation-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.violation-detail-block {
    margin-bottom: 16px;
}

.violation-detail-block:last-child {
    margin-bottom: 0;
}

.violation-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.violation-detail-label svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.violation-detail-content {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* 8. Mức phạt card */
.fine-card {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 10px;
    padding: 16px;
}

.fine-card-amount {
    font-size: 16px;
    font-weight: 600;
    color: #C2410C;
}

.fine-card-note {
    font-size: 12px;
    color: #9A3412;
    margin-top: 4px;
}

/* 9. Nơi giải quyết list */
.noi-giai-quyet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.noi-giai-quyet-list li {
    margin-bottom: 8px;
    padding-left: 0;
}

.noi-giai-quyet-list li:last-child {
    margin-bottom: 0;
}

.noi-giai-quyet-name {
    font-weight: 600;
    color: var(--text-primary);
}

.noi-giai-quyet-addr {
    font-size: 13px;
    color: #6B7280;
    margin-top: 2px;
}

/* 10. Nút gọi điện */
.btn-call {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2563EB;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-call:hover {
    background: #1D4ED8;
    color: white;
}

/* 11. Footer tải app */
.app-download-card {
    margin-top: 24px;
    background: #F9FAFB;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.app-download-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-download-emoji {
    font-size: 28px;
    line-height: 1;
}

.app-download-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.app-download-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin-top: 2px;
}

.app-download-badge {
    flex-shrink: 0;
}

.app-download-badge img {
    display: block;
    height: 40px;
}

/* Violation list title */
.violation-list-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-top: 0;
    margin-bottom: 0;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    color: var(--success);
    margin: 0 auto 12px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Download App */
.download-card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    margin-top: var(--card-gap);
    gap: 16px;
}

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

.download-android-icon {
    width: 40px;
    height: 40px;
    color: #34A853;
    flex-shrink: 0;
}

.download-title {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.download-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.download-badge {
    height: 48px;
    cursor: pointer;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .vehicle-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .vehicle-summary-right {
        align-items: flex-start;
    }

    .violation-detail-grid {
        grid-template-columns: 1fr;
    }

    .violation-table-wrap {
        overflow-x: scroll;
    }

    .search-grid {
        grid-template-columns: 1fr;
    }

    .app-download-card {
        flex-direction: column;
        text-align: center;
    }

    .app-download-left {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .navbar-site-name {
        font-size: 16px;
    }

    .btn-android span {
        display: none;
    }
}