:root {
    --primary-color: #6a5acd;
    --primary-light: #9370db;
    --primary-dark: #483d8b;
    --secondary-color: #f8f9fa;
    --accent-color: #ff7f50;
    --text-main: #333;
    --text-muted: #666;
    --bg-main: #f4f7fe;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 5px 20px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
    
    /* Dashboard Card Colors */
    --card-province: #a5b4fc;
    --card-district: #bae6fd;
    --card-subdistrict: #d8b4fe;
    --card-area: #fbcfe8;
    --card-activity: #bbf7d0;
    --card-visitors: #fef08a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* font-family ถูกกำหนดในไฟล์เดียว: assets/css/font.css */
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.65;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Nav */
.main-header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

.main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

.auth-btn button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(106, 90, 205, 0.3);
}

.auth-btn button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Main Content Area */
#app-container {
    min-height: calc(100vh - 160px);
    padding: 40px 0;
}

/* Views Styles */
.view-section {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Login View */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card .user-icon {
    font-size: 4rem;
    color: var(--primary-light);
    margin-bottom: 20px;
    background: #f0edff;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.login-card h2 {
    margin-bottom: 30px;
    font-weight: 400;
    color: var(--text-muted);
    font-size: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
}

.input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #eee;
    border-radius: var(--radius-sm);
    outline: none;
    background: #fdfdff;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1);
}

.login-options {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 25px;
}

.login-btn {
    width: 100%;
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.stat-card:nth-child(1) { background-color: var(--card-province); }
.stat-card:nth-child(2) { background-color: var(--card-district); }
.stat-card:nth-child(3) { background-color: var(--card-subdistrict); }
.stat-card:nth-child(4) { background-color: var(--card-area); }
.stat-card:nth-child(5) { background-color: var(--card-activity); }
.stat-card:nth-child(6) { background-color: var(--card-visitors); }

.stat-card h3 {
    font-size: 1.1rem;
    color: #1e293b !important;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #000000 !important;
    border-bottom: 2px dashed rgba(0,0,0,0.15);
    display: inline-block;
    padding: 0 10px;
}

.dashboard-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.dashboard-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-box {
    background: #eeeeee;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
}

.chart-box h3 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.chart-with-list {
    display: flex;
    gap: 20px;
    align-items: center;
}

.chart-with-list canvas {
    max-width: 200px !important;
}

.chart-list {
    flex: 1;
    font-size: 0.85rem;
    list-style: none;
}

.chart-list li {
    margin-bottom: 5px;
    color: #555;
}

.activity-poster {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 15px;
}

.activity-details {
    text-align: center;
}

.activity-details h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.placeholder-lines {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(to right, #ccc, #ccc 5px, transparent 5px, transparent 10px);
    margin: 8px 0;
}

.map-container {
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Table Styles */
.table-container {
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th {
    background: #f8f9ff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-dark);
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

/* Modal Improvements */
.modal-detail-container {
    display: block;
    padding: 4px;
}

.modal-left {
    flex: 1;
    max-width: 300px;
}

.modal-logo-wrapper {
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: zoom-in;
    background: #f1f5f9;
}

.modal-logo-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity .2s;
}
.modal-logo-wrapper:hover img { opacity: .92; }

.modal-right {
    flex: 2;
}

.modal-title {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.modal-info-list p {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-info-list strong {
    color: #444;
    min-width: 150px;
    display: inline-block;
}

.btn-video {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e1f5fe;
    color: #039be5;
    padding: 5px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-maps {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #c8e6c9;
}

.modal-gallery h5 {
    font-weight: 700;
    margin-bottom: 15px;
    color: #555;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gallery-img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-img:hover {
    transform: scale(1.05);
}

/* Table Enhancements */
#resource-table thead th {
    background-color: #d1c4e9 !important;
    color: #4527a0 !important;
    text-align: center;
}

#resource-table tbody td {
    text-align: center;
}

#resource-table tbody td:nth-child(2),
#resource-table tbody td:nth-child(3) {
    text-align: left;
}

/* Sub Navigation */
.sub-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    background: white;
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.sub-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
    transition: var(--transition);
}

.sub-nav a.active {
    background: var(--primary-light);
    color: white;
}

/* Knowledge Cards */
.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.k-card {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.k-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.k-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.k-content {
    padding: 20px;
}

.k-tag {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
    display: inline-block;
}

.k-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.k-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 15px;
}

/* Detailed Tables */
.report-table-container {
    margin-top: 40px;
    background: white;
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.report-table {
    font-size: 0.85rem;
}

.report-table th {
    background: #eef2ff;
    border: 1px solid #dee2e6;
    text-align: center;
    vertical-align: middle;
}

.report-table td {
    border: 1px solid #dee2e6;
    text-align: center;
}

.report-table tr:nth-child(even) {
    background-color: #f9f9fb;
}

/* Footer */
.main-footer {
    background: linear-gradient(135deg, #483d8b 0%, #6a5acd 100%);
    color: rgba(255,255,255,0.85);
    border-top: none;
    margin-top: 60px;
    padding: 0;
    text-align: left;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 40px;
    padding: 50px 20px 35px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 14px;
}
.footer-brand i { font-size: 1.6rem; color: #ffd166; }

.footer-desc {
    font-size: 0.9rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.78);
    margin: 0;
}

.footer-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.18);
    position: relative;
}
.footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 40px;
    height: 2px;
    background: #ffd166;
}

.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li, .footer-contact li {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.footer-links a, .footer-contact a {
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.footer-links a:hover, .footer-contact a:hover {
    color: #ffd166;
    padding-left: 4px;
}
.footer-links a i { font-size: 0.65rem; opacity: 0.7; }
.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.footer-contact li i {
    color: #ffd166;
    margin-top: 4px;
    min-width: 18px;
    text-align: center;
}

.footer-bottom {
    background: rgba(0,0,0,0.18);
    padding: 14px 0;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.75);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-visitor-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        padding: 40px 16px 28px;
    }
    .footer-about { grid-column: span 2; }
}
@media (max-width: 600px) {
    .main-footer { margin-top: 30px; }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 26px;
        padding: 32px 16px 22px;
        text-align: left;
    }
    .footer-about { grid-column: auto; }
    .footer-brand { font-size: 1.1rem; }
    .footer-bottom { font-size: 0.75rem; padding: 12px 16px; }
    .footer-bottom-inner { justify-content: center; text-align: center; }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 80%;
    max-width: 700px;
    position: relative;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .dashboard-main { grid-template-columns: 1fr; }
}

/* -------------------------------------------
   Global Responsive Enhancements (All Screens)
---------------------------------------------- */

/* Large tablets / small desktops */
@media (max-width: 1024px) {
    .container { padding: 0 16px; }
    .home-activities-grid { grid-template-columns: repeat(2, 1fr); gap: 25px; }
    .dashboard-main, .dashboard-bottom { grid-template-columns: 1fr; gap: 20px; }
    .chart-with-list canvas { max-width: 160px !important; }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablets */
@media (max-width: 992px) {
    .container { max-width: 100%; padding: 0 16px; }
    .logo span { font-size: 1.15rem; }
    .logo { font-size: 1rem; }
    .nav-links { display: none; }
    .auth-btn button { padding: 8px 14px; font-size: 0.9rem; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 15px; }
    .stat-card { padding: 18px; }
    .stat-card .value { font-size: 1.6rem; }
    .home-activities-grid { grid-template-columns: repeat(2, 1fr); }
    .knowledge-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
    .programs-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
    #app-container { padding: 30px 0; }
    .modal-content { width: 92%; padding: 24px; }
    .modal-detail-container { display: block; padding: 10px; }
    .modal-left { max-width: 100%; }
}

/* Mobile devices */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .container { padding: 0 12px; }

    /* Header */
    .main-header { padding: 10px 0; }
    .main-header nav { flex-wrap: wrap; gap: 8px; }
    .logo { gap: 6px; }
    .logo i { font-size: 1.1rem; }
    .logo span { font-size: 0.95rem; line-height: 1.2; }
    .auth-btn button { padding: 7px 12px; font-size: 0.8rem; border-radius: 10px; }
    .auth-btn button i { font-size: 0.95rem; }

    /* Main content */
    #app-container { padding: 20px 0; min-height: calc(100vh - 200px); }

    /* Stats grid */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 25px; }
    .stat-card { padding: 14px 10px; border-radius: 12px; }
    .stat-card h3 { font-size: 0.85rem; margin-bottom: 6px; }
    .stat-card .value { font-size: 1.3rem; padding: 0 6px; }

    /* Dashboard grid */
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
        gap: 18px;
        margin-bottom: 30px;
    }
    .grid-item { padding: 16px; border-radius: 12px; }
    .grid-item h4 { font-size: 1rem; margin-bottom: 12px; }
    .map-item { grid-row: auto !important; min-height: 380px !important; }
    .map-item iframe { min-height: 380px !important; }
    .canvas-wrapper { min-height: 220px; height: 220px !important; }

    /* Home activities */
    .home-activities-grid { grid-template-columns: 1fr; gap: 20px; }
    .home-activity-poster, .home-activity-card img { height: auto !important; max-height: 240px; object-fit: cover; }
    .activities-section h2 { font-size: 1.3rem !important; margin-bottom: 20px !important; }

    /* Knowledge & programs */
    .knowledge-grid { grid-template-columns: 1fr; gap: 16px; }
    .k-card img { height: 160px; }
    .k-content { padding: 16px; }
    .programs-grid { grid-template-columns: 1fr; gap: 18px; }
    .program-card { padding: 18px; }
    .program-title { font-size: 1.1rem; }
    .program-card-footer { flex-direction: column; gap: 8px; }

    /* Sub navigation */
    .sub-nav { gap: 8px; padding: 10px; flex-wrap: wrap; }
    .sub-nav a { padding: 6px 12px; font-size: 0.85rem; }

    /* Tables */
    .table-container, .report-table-container { padding: 12px; border-radius: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table, .report-table, .summary-report-table { font-size: 0.75rem; min-width: 600px; }
    th, td { padding: 8px 6px !important; }

    /* Modal */
    .modal-content { width: 95% !important; margin: 8% auto !important; padding: 18px !important; border-radius: 18px !important; }
    .modal-detail-container { display: block; padding: 4px; }
    .modal-left { max-width: 100% !important; }
    .modal-logo-wrapper { min-height: 180px !important; }
    .modal-title { font-size: 1.2rem !important; }
    .modal-right .space-y-3\.5 > p { font-size: 13px; }
    .close-btn { right: 14px !important; top: 8px !important; font-size: 26px !important; }

    /* Footer */
    .main-footer { padding: 14px 10px; font-size: 0.75rem; }
    .main-footer p { line-height: 1.5; margin-bottom: 4px; word-break: break-word; }

    /* Misc map graphic — turn off positioning hacks on mobile */
    .map-graphic { min-height: auto; }
    .thailand-map-img { position: static; max-width: 80%; margin: 0 auto; display: block; }
    .mg-container { position: static; width: 100%; margin-top: 20px; }
    .mg-arrow-icon, .mg-pin-info { display: none; }
    .mg-circle { width: 180px; height: 180px; }
}

/* Small mobile */
@media (max-width: 480px) {
    .logo span { font-size: 0.82rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .auth-btn button span, .auth-btn button { font-size: 0.75rem; }
    .auth-btn button { padding: 6px 10px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 12px 8px; }
    .stat-card .value { font-size: 1.1rem; }
    .mobile-bottom-nav { height: 60px; }
    .mobile-nav-item { font-size: 0.65rem; }
    .mobile-nav-item i { font-size: 1.05rem; }
    .home-activity-poster { max-height: 180px; }
    .k-card img { height: 140px; }
    .modal-content { margin: 4% auto !important; padding: 14px !important; }
}

/* Extra small (very old phones) */
@media (max-width: 360px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .logo span { font-size: 0.75rem; max-width: 140px; }
    .auth-btn button i + * { display: none; }
}

/* Tablet landscape charts */
@media (min-width: 769px) and (max-width: 1199px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Make all images fluid by default */
img { max-width: 100%; height: auto; }

/* Make iframes fluid */
iframe { max-width: 100%; }

/* Prevent canvas overflow */
canvas { max-width: 100% !important; }

/* Summary Report Table */
.summary-report-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.8rem;
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

.summary-report-table th, .summary-report-table td {
    border: 1px solid #ddd;
    padding: 10px 5px;
    text-align: center;
}

.summary-report-table thead th {
    background-color: #d1c4e9;
    color: #4527a0;
    font-weight: 700;
}

.vertical-th {
    height: 320px;
    white-space: nowrap;
    position: relative;
    width: 45px;
    min-width: 45px;
    vertical-align: bottom;
    padding-bottom: 80px !important;
}

.vertical-th div {
    transform: rotate(-90deg);
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform-origin: center;
    width: 250px;
    text-align: left;
    margin-left: -125px;
}

.summary-report-table tbody td {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

.total-row {
    background-color: #f0edff;
    font-weight: 700;
}

.text-left {
    text-align: left !important;
    padding-left: 15px !important;
}

.btn-back-summary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-back-summary:hover {
    background: #5a6268;
}

.map-label {
    background: #4A90E2;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
    position: relative;
    white-space: nowrap;
}

.map-label::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #4A90E2;
}

/* Stats Report Tables (Blue Theme) */
.stats-report thead th {
    background-color: #E3F2FD !important;
    color: #1565C0 !important;
    border: 1px solid #BBDEFB !important;
}

.stats-report td {
    border: 1px solid #BBDEFB !important;
}

.stats-report .total-row {
    background-color: #E3F2FD !important;
    color: #1565C0 !important;
}

#topProvincesChart {
    max-height: 400px;
}

/* About Us Content */
.about-content p {
    margin-bottom: 15px;
    text-indent: 40px;
    text-align: justify;
}
.about-content ul {
    margin-left: 40px;
    margin-bottom: 15px;
}
.about-content li {
    margin-bottom: 5px;
}

/* -------------------------------------------
   Dashboard Redesign Styles
---------------------------------------------- */
.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 30px;
    margin-bottom: 50px;
}

.grid-item {
    background: #f4f4f4;
    border-radius: 15px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.grid-item h4 {
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.2rem;
}

.map-item {
    grid-row: span 2;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
}

.map-graphic {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 650px;
}

.thailand-map-img {
    position: absolute;
    top: 50px;
    left: 20px;
    max-width: 55%;
    filter: drop-shadow(0px 0px 5px rgba(220,50,150,0.5));
}

.dummy-pin {
    position: absolute;
    color: #e74c3c;
    font-size: 1.5rem;
}
.p1 { top: 18%; left: 15%; }
.p2 { top: 28%; left: 28%; }
.p3 { top: 35%; left: 18%; }
.p4 { top: 40%; left: 35%; }
.p5 { top: 48%; left: 15%; }
.p6 { top: 60%; left: 25%; }
.p7 { top: 70%; left: 30%; }
.p8 { top: 85%; left: 45%; }

/* Magnifying Glass Graphic */
.mg-container {
    position: absolute;
    top: 100px;
    right: 0;
    width: 350px;
    text-align: center;
}

.mg-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    margin-left: -150px;
}

.mg-arrow-icon {
    position: absolute;
    top: 50px;
    left: -80px;
    font-size: 3rem;
    color: #2e7d32;
}

.mg-circle {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 8px solid #000;
    overflow: hidden;
    margin: 0 auto;
    background: white;
}

.mg-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-plus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(0,0,0,0.6);
}

.mg-container::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: 30px;
    width: 8px;
    height: 80px;
    background: #000;
    transform: rotate(-45deg);
    border-radius: 4px;
}

.mg-pin-info {
    position: absolute;
    bottom: 150px;
    left: 45%;
    background: white;
    padding: 10px 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    gap: 15px;
    align-items: flex-start;
    font-size: 0.85rem;
    line-height: 1.4;
    max-width: 300px;
}

/* Charts */
.canvas-wrapper {
    flex-grow: 1;
    position: relative;
    min-height: 250px;
}

/* Activities Home Section */
.home-activities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.home-activity-card {
    display: flex;
    flex-direction: column;
}

.home-activity-poster {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.home-activity-details h4 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.desc-line {
    border-bottom: 2px dashed #000;
    margin: 15px 0;
}

/* -------------------------------------------
   Learning Programs Styles
---------------------------------------------- */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.program-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border-top: 5px solid var(--primary-color);
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.program-card-header {
    margin-bottom: 15px;
}

.program-title {
    color: var(--primary-dark);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.program-duration {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.program-card-body {
    flex-grow: 1;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.program-card-footer {
    display: flex;
    gap: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.btn-program-doc, .btn-program-vid {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-program-doc {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.btn-program-doc:hover {
    background: #ffe0b2;
    color: #e65100;
}

.btn-program-vid {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.btn-program-vid:hover {
    background: #ffcdd2;
    color: #c62828;
}

/* -------------------------------------------
   Statistics & Dashboard Responsive Redesign
---------------------------------------------- */
@media (max-width: 992px) {
    .stats-middle-grid {
        grid-template-columns: 1fr !important;
    }
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto !important;
    }
    .map-item {
        min-height: 500px !important;
    }
    .map-item iframe {
        min-height: 500px !important;
    }
}

@media (max-width: 768px) {
    .stats-middle-grid {
        padding: 20px !important;
        gap: 20px !important;
    }
    .stats-map-container img {
        width: 90% !important;
        max-width: 250px !important;
    }
    .map-item {
        min-height: 420px !important;
    }
    .map-item iframe {
        min-height: 420px !important;
    }
}

/* -------------------------------------------
   Mobile Bottom Navigation & Responsiveness
---------------------------------------------- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.06);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(106, 90, 205, 0.08);
    padding: 5px 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    flex: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease, color 0.3s ease;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 75px !important;
    }
    .main-footer {
        margin-bottom: 65px; /* Prevent footer content from overlapping bottom nav */
    }
}


