:root {
    --primary-color: #2563eb;
    --primary-color-dark: #1d4ed8;
    --primary-color-soft: #eff6ff;
    --secondary-color: #0f172a;
    --background-light: #f7f8fa;
    --surface: #ffffff;
    --border-color: #e5e7eb;
    --text-muted: #6b7280;
    --text-heading: #0f172a;
    --danger: #dc2626;
    --radius: 8px;
}

body {
    font-family: "Mitr", sans-serif !important;
    background-color: var(--background-light);
    color: var(--text-heading);
    margin: 0;
    padding: 0;
}

/* ============================================================
   Flat card — single shared surface used by every section block
   ============================================================ */
.card {
    background: var(--surface);
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: none;
    transition: none;
}

.card:hover {
    box-shadow: none;
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.1rem !important;
}

/* Consistent section title used across every block on the page */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: 0.01em;
}

.section-title .icon {
    color: var(--primary-color);
    font-size: 0.95rem;
}

.section-title__sub {
    display: block;
    margin-top: 2px;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger) !important;
}

/* ============================================================
   Detection card — visually prominent through size, not effects
   ============================================================ */
.detection-card .section-title {
    margin-bottom: 18px;
}

.detection-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.detection-form__input-wrap {
    position: relative;
    flex: 1;
}

.detection-form__input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.detection-form .form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 40px;
    font-size: 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-heading);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.detection-form .form-control:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.detection-form__btn {
    height: 48px;
    min-width: 140px;
    padding: 0 22px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s ease;
}

.detection-form__btn:hover,
.detection-form__btn:focus {
    background: var(--primary-color-dark);
    color: #fff;
}

@media (max-width: 576px) {
    .detection-form {
        flex-direction: column;
    }
    .detection-form__btn {
        width: 100%;
    }
}

/* ============================================================
   Stat cards — identical visual weight to other cards
   ============================================================ */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 0;
    text-align: center;
    box-shadow: none;
}

.stat-card__value {
    margin: 0 0 4px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger);
    line-height: 1.1;
}

.stat-card__label {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================================
   Map block — flush inside card, no extra borders
   ============================================================ */
.datamaps-popup {
    background-color: #fff;
    border-radius: var(--radius);
    overflow: hidden;
}

#world-map {
    width: 100%;
}

/* ============================================================
   Tables — flat, consistent with cards
   ============================================================ */
.table {
    margin-bottom: 0;
    color: var(--text-heading);
}

.table thead {
    background: #f9fafb;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.table thead th {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
}

.table th,
.table td {
    padding: 12px;
    border-color: var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.table .badge {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 999px;
}

/* Form base */
.form-control {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn-primary {
    background-color: var(--primary-color);
    border: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-lang:hover {
    color: var(--primary-color);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    cursor: pointer;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
    width: 1.5em;
    height: 1.5em;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1085fa;
}

.navbar-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-item a {
    font-size: 20px;
}

.nav-link:hover {
    color: #4e73df;
}

.language-buttons {
    display: flex;
    gap: 0.5rem;
}

@media (max-width: 991.98px) {
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .language-buttons {
        margin-top: 1rem;
    }
}

/* DataTables — flat to match the rest of the page */
.dataTables_wrapper .dataTables_filter input {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: calc(100% - 4rem) !important;
    max-width: 300px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_filter input:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    text-align: left;
    margin-bottom: .75rem;
    margin-top: .25rem;
    color: var(--text-muted);
}

.dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius);
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
}

.dataTables_wrapper .dataTables_length select:hover,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: 0;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: .75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius) !important;
}

.table.table-bordered.dtr-details {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
}

.table.table-bordered.dtr-details td, .table.table-bordered.dtr-details th {
    padding: 10px;
    border: 1px solid #dee2e6;
    height: auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

.table.table-bordered.dtr-details td span {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.table.table-bordered.dtr-details th {
    font-weight: bold;
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table-section .table {
    border-radius: var(--radius);
    overflow: hidden;
}

.text-break{
    padding: 0 !important;
}

.text-break p{
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.text-break span{
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.text-center{
    text-align: center;
}

.table-responsive {
    overflow-x: hidden;
}

@media (max-width: 1399px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

::placeholder {
    font-family: "Mitr", sans-serif;
}

.text-decoration-none a{
    text-decoration: none;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 576px) {
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
}

 .footer-logo {
        height: 40px;
        transition: transform 0.2s ease;
    }

    .footer-logo:hover {
        transform: scale(2.15); /* ขยาย 15% เมื่อ hover */
        cursor: pointer;
    }