@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;700&display=swap');

body {
    font-family: 'Sarabun', sans-serif;
    background-color: #f0f9ff;
    margin: 0;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* 🛠️ แก้ปัญหา Leaflet Map แสดงผลภาพตัดขอบ/ภาพแหว่งจาก Tailwind CSS Preflight */
.leaflet-container img,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container img {
    max-width: none !important;
    max-height: none !important;
}

#dashOneMap {
    min-height: 550px !important;
    height: 650px !important;
    width: 100% !important;
}

#waterMap,
#evacMap,
#dashWaterMap,
#floodReportMap {
    min-height: 400px !important;
    height: 450px !important;
    width: 100% !important;
}

/* 🖥️ โหมดขยายแผนที่เต็มจอ (One Map Fullscreen) */
#dashOneMapCard.onemap-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

#dashOneMapCard.onemap-fullscreen #dashOneMapViewport {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
}

#dashOneMapCard.onemap-fullscreen #dashOneMap {
    flex: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
}

/* 🎛️ One Map Fullscreen Floating HUD Widgets */
.onemap-hud-controls {
    display: none;
}

#dashOneMapCard.onemap-fullscreen .onemap-hud-controls {
    display: flex;
}

.onemap-hud-layer {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    overflow: hidden;
}

#dashOneMapCard.onemap-fullscreen .onemap-hud-layer {
    display: block;
}

.onemap-hud-widget {
    position: absolute;
    pointer-events: auto;
    width: 280px;
    max-width: calc(100vw - 24px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 1rem;
    box-shadow: 0 18px 40px -12px rgba(2, 6, 23, 0.65);
    color: #f8fafc;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.onemap-hud-widget.is-dragging {
    box-shadow: 0 24px 50px -10px rgba(37, 99, 235, 0.45);
    border-color: rgba(96, 165, 250, 0.6);
    user-select: none;
}

.onemap-hud-drag-handle {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.onemap-hud-drag-handle:active {
    cursor: grabbing;
}

.onemap-hud-widget.is-collapsed .onemap-hud-body {
    display: none;
}

/* ☀️ One Map HUD Light Mode */
#onemapHudLayer.hud-theme-light .onemap-hud-widget {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(203, 213, 225, 0.95);
    color: #0f172a;
    box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.22);
}

#onemapHudLayer.hud-theme-light .onemap-hud-drag-handle {
    background: rgba(241, 245, 249, 0.96) !important;
    border-bottom-color: rgba(226, 232, 240, 0.95) !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-white:not(.hud-keep-white) {
    color: #0f172a !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-slate-200,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-slate-300 {
    color: #334155 !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-slate-400 {
    color: #64748b !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .bg-slate-800,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .bg-slate-800\/70,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .bg-slate-800\/80 {
    background-color: #f8fafc !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .bg-slate-700,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .bg-slate-700\/80 {
    background-color: #e2e8f0 !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .border-slate-700\/60,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .border-slate-700\/70,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .border-slate-700\/80,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .border-slate-600\/80 {
    border-color: #cbd5e1 !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-pink-200,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-pink-300 {
    color: #be185d !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-amber-200,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-amber-300:not(.hud-keep-amber) {
    color: #b45309 !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-purple-200,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-purple-300,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-purple-200\/80 {
    color: #7e22ce !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-rose-200,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-rose-300,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-rose-200\/80 {
    color: #be123c !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-emerald-200,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-emerald-300,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-emerald-200\/80 {
    color: #047857 !important;
}

#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-sky-300,
#onemapHudLayer.hud-theme-light .onemap-hud-widget .text-sky-400 {
    color: #0369a1 !important;
}

/* Sidebar Desktop Logic */
.sidebar-expanded {
    width: 14rem;
}

.sidebar-collapsed {
    width: 4.5rem;
}

.nav-text,
.logo-text {
    transition: opacity 0.2s;
}

.sidebar-collapsed .nav-text,
.sidebar-collapsed .logo-text {
    display: none;
}

/* 👤 สไตล์การ์ดโปรไฟล์และปุ่มออกจากระบบบริเวณ Sidebar ล่าง */
.sidebar-profile-container {
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar-profile-card {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

/* เมื่อกดย่อ Sidebar (Collapsed: กว้าง 4.5rem = 72px) กล่องโปรไฟล์จะไม่ล้น */
.sidebar-collapsed .sidebar-profile-container {
    padding: 0.375rem 0.25rem;
}

.sidebar-collapsed .sidebar-profile-card {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0.25rem;
    gap: 0.375rem;
    background: #f8fafc;
}

.sidebar-collapsed .sidebar-profile-info {
    display: none !important;
}

.sidebar-collapsed .sidebar-logout-btn {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
}

/* Active States */
.active-menu {
    background-color: #eff6ff;
    border-left: 4px solid #2563eb;
    color: #1e40af;
    font-weight: bold;
}

.active-menu-mobile {
    color: #2563eb !important;
    font-weight: bold;
}

.animate-pulse-fast {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .7;
    }
}

#loginPage {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #090d16 0%, #0c1a30 40%, #172554 75%, #0b1528 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 🌊 คลื่นน้ำจางๆ สวยงามพลิ้วไหวสำหรับพื้นหลังหน้า Login (Soft Ambient Water Waves) */
.login-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    min-height: 140px;
    max-height: 240px;
    pointer-events: none;
    z-index: 1;
}

.login-parallax > use {
    animation: loginWaveMove 25s cubic-bezier(.55, .5, .45, .5) infinite;
}

.login-parallax > use:nth-child(1) {
    animation-delay: -2s;
    animation-duration: 12s;
    fill: rgba(56, 189, 248, 0.08); /* sky-400 จาง */
}

.login-parallax > use:nth-child(2) {
    animation-delay: -3s;
    animation-duration: 18s;
    fill: rgba(37, 99, 235, 0.12); /* blue-600 จาง */
}

.login-parallax > use:nth-child(3) {
    animation-delay: -4s;
    animation-duration: 24s;
    fill: rgba(14, 165, 233, 0.15); /* sky-500 จาง */
}

.login-parallax > use:nth-child(4) {
    animation-delay: -5s;
    animation-duration: 32s;
    fill: rgba(30, 58, 138, 0.20); /* blue-900 จาง */
}

@keyframes loginWaveMove {
    0% {
        transform: translate3d(-90px, 0, 0);
    }
    100% {
        transform: translate3d(85px, 0, 0);
    }
}

.water-card-img-container {
    height: 100px;
    width: 100%;
    overflow: hidden;
    background-color: #e2e8f0;
}

@media (min-width: 768px) {
    .water-card-img-container {
        height: 160px;
    }
}

@media (max-width: 767px) {
    .main-content-area {
        padding-bottom: 120px !important;
    }

    .card-title {
        font-size: 0.75rem;
    }

    .card-value {
        font-size: 1.25rem;
    }
}

/* ==============================================================
Responsive Layout: ตั้งแต่ มือถือ ไปจนถึง แท็บเล็ต 12 นิ้ว (1366px)
============================================================== */
@media (max-width: 1366px) {
    .sidebar-desktop {
        display: none !important;
    }

    .bottom-nav-mobile {
        display: flex !important;
    }

    .main-content-area {
        padding-bottom: 120px !important;
    }

    .content-area {
        padding-bottom: 80px !important;
    }

    .lg\:hidden {
        display: flex !important;
    }
}

/* ==============================================================
Responsive Layout: หน้าจอ PC / Laptop (ใหญ่กว่า 1366px ขึ้นไป)
============================================================== */
@media (min-width: 1367px) {
    .sidebar-desktop {
        display: flex !important;
    }

    .bottom-nav-mobile {
        display: none !important;
    }

    .content-area {
        padding-bottom: 20px !important;
    }
}

.shelter-filter-btn.active-shelter-btn {
    background-color: #2563eb !important;
    color: white !important;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.trend-btn {
    opacity: 0.6;
    transform: scale(0.95);
}

.active-trend {
    opacity: 1 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.active-trend[onclick*="เพิ่มขึ้น"] {
    border-color: #ef4444 !important;
}

.active-trend[onclick*="คงตัว"] {
    border-color: #eab308 !important;
}

.active-trend[onclick*="ลดลง"] {
    border-color: #22c55e !important;
}

.no-scrollbar-style::-webkit-scrollbar {
    width: 4px;
}

.no-scrollbar-style::-webkit-scrollbar-track {
    background: #f8fafc;
}

.no-scrollbar-style::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

@media (max-width: 1024px) {
    #sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    #sidebar.mobile-open {
        transform: translateX(0);
        width: 280px !important;
    }

    #mainContent {
        margin-left: 0 !important;
        padding-bottom: 80px;
    }

    #bottomNav {
        display: flex !important;
    }
}

#bottomNav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid #f1f5f9;
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
}

.mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.2s;
}

.mobile-nav-btn.active,
.mobile-nav-btn.active-menu-mobile {
    color: #2563eb !important;
}

.mobile-nav-btn i {
    font-size: 22px;
    margin-bottom: 0;
}

/* ==============================================================
   Single Icon Mode: จัดตำแหน่งตรงกลางเมื่อเข้าด้วยสิทธิ์ที่มีไอคอนเดียว
   ============================================================== */
.bottom-nav-mobile.single-nav-mode {
    justify-content: center !important;
}

.bottom-nav-mobile.single-nav-mode .mobile-nav-group {
    flex: none !important;
    width: auto !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
}

.bottom-nav-mobile.single-nav-mode .mobile-nav-btn:not(.hidden):not([style*="display: none"]) {
    width: 52px !important;
    height: 52px !important;
    border-radius: 9999px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f1f5f9;
    color: #2563eb !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
    transition: all 0.2s ease;
}

.bottom-nav-mobile.single-nav-mode .mobile-nav-btn:not(.hidden):not([style*="display: none"]):active {
    transform: scale(0.95);
}

.bottom-nav-mobile.single-nav-mode .mobile-nav-btn[data-page="dashboard"] {
    background: transparent !important;
    box-shadow: none !important;
}

.bottom-nav-mobile .mobile-nav-btn.hidden,
.bottom-nav-mobile .mobile-nav-btn[style*="display: none"] {
    display: none !important;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(220, 38, 38, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.critical-pulse {
    animation: pulse-red 1.5s infinite;
    border-radius: 50%;
}

.custom-flood-marker {
    background: transparent !important;
    border: none !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 1.5rem;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 260px !important;
}

.leaflet-popup-close-button {
    color: white !important;
    opacity: 0.8;
    font-size: 16px !important;
    top: 6px !important;
    right: 6px !important;
    z-index: 99;
}

.leaflet-popup-close-button:hover {
    opacity: 1;
}

.leaflet-popup-tip {
    background: white;
}

.popup-badge {
    font-size: 9px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaflet-draw-toolbar a {
    background-image: url('https://cdnjs.cloudflare.com/ajax/libs/leaflet.draw/1.0.4/images/spritesheet.png') !important;
}

.evac-marker-pulse {
    animation: pulse-red 2s infinite;
}

.marker-pulse {
    animation: pulse-red 2s infinite;
}

#search_results {
    display: block;
    position: absolute;
    background: white;
    width: 100%;
    z-index: 9999 !important;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* --- CSS สำหรับการพิมพ์รายงาน (Print Styles) --- */
@media print {
    body>*:not(#printArea) {
        display: none !important;
    }

    #printArea {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        background-color: white;
    }

    @page {
        size: A4 landscape;
        margin: 1cm;
    }

    .print-page {
        width: 100%;
        height: 100%;
    }

    .report-header {
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 2px solid #334155;
        padding-bottom: 10px;
    }

    .chart-container-print {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .chart-container-print img {
        width: 45%;
        height: auto;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        object-fit: contain;
    }

    .page-break {
        display: block;
        page-break-before: always !important;
        margin-top: 50px;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
        background-color: white;
    }

    .print-table th {
        background-color: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1;
        padding: 10px 5px;
        font-size: 14px;
        -webkit-print-color-adjust: exact;
    }

    .print-table td {
        border: 1px solid #cbd5e1;
        padding: 8px 5px;
        font-size: 12px;
        color: #334155;
        vertical-align: middle;
    }

    .print-footer {
        margin-top: 30px;
        text-align: right;
        font-size: 12px;
        color: #64748b;
    }

    tr {
        page-break-inside: avoid;
    }
}

#printArea.hidden {
    display: none;
}

#weather-forecast-list::-webkit-scrollbar {
    display: none;
}

/* --- Skeleton Loading Styles --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

/* 🎨 Clean Minimal Leaflet Popup Style */
.clean-popup .leaflet-popup-content-wrapper {
    border-radius: 1.25rem !important;
    padding: 0.25rem !important;
    box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1) !important;
    background: #ffffff !important;
    border: 1px solid rgba(241, 245, 249, 1) !important;
}

.clean-popup .leaflet-popup-content {
    margin: 0.35rem !important;
    line-height: 1.5 !important;
}

.clean-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}

.clean-popup .leaflet-popup-tip {
    background: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.1) !important;
}

.clean-popup a.leaflet-popup-close-button {
    top: 10px !important;
    right: 10px !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 9999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #94a3b8 !important;
    background: #f1f5f9 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    border: 1px solid #e2e8f0 !important;
}

.clean-popup a.leaflet-popup-close-button:hover {
    color: #0f172a !important;
    background: #e2e8f0 !important;
    transform: scale(1.05);
}
/* 🏛️ Styling สำหรับพื้นที่นอกเขตเทศบาล (Inverted Mask) */
.municipality-outer-mask {
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
    cursor: not-allowed !important;
}

/* -------------------------------------------------------------
   🔒 สไตล์สำหรับโหมดดูข้อมูลอย่างเดียว (Admin View-Only Mode)
-------------------------------------------------------------- */
body.view-only-mode #riskMapAdminUpload,
body.view-only-mode #btnCreatePeriod,
body.view-only-mode .leaflet-draw,
body.view-only-mode .leaflet-draw-toolbar,
body.view-only-mode form#userForm,
body.view-only-mode button[type="submit"]:not(#loginBtn),
body.view-only-mode .admin-write-only,
body.view-only-mode .btn-action-delete,
body.view-only-mode .btn-action-edit {
    display: none !important;
}

body.view-only-mode input:not(#username):not(#swal_admin_password_input):not([type="search"]):not(.search-input):not(#swal_old_admin_pw):not(#swal_new_admin_pw):not(#swal_confirm_admin_pw),
body.view-only-mode select:not(#periodSelector):not(#tableFilter):not(.filter-select),
body.view-only-mode textarea {
    pointer-events: none !important;
    background-color: #f8fafc !important;
    opacity: 0.8 !important;
}

/* -------------------------------------------------------------
   📱 Responsive Scrollbar & SweetAlert Mobile Enhancements
-------------------------------------------------------------- */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.swal2-title:empty,
.swal2-header:empty {
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
}

.swal2-popup .swal2-html-container {
    margin-top: 0 !important;
}

@media (max-width: 640px) {
    .swal2-container {
        padding: 0.5rem !important;
    }
    .swal2-container.swal2-center > .swal2-popup {
        margin: auto !important;
        max-height: 94vh !important;
    }
    .swal2-popup .swal2-title {
        font-size: 1rem !important;
    }
}


/* ===================================================
   🌊 Water Wave Animations for Hero Water Gauge Card (Seamless Continuous)
   =================================================== */
@keyframes waveFlowFront {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes waveFlowMid {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes waveFlowBack {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.hero-wave-front {
    animation: waveFlowFront 12s linear infinite;
    will-change: transform;
}

.hero-wave-mid {
    animation: waveFlowMid 18s linear infinite;
    will-change: transform;
}

.hero-wave-back {
    animation: waveFlowBack 25s linear infinite;
    will-change: transform;
}

/* ===================================================
   🚨 Citizen Portal: Bottom Navigation Bar & SOS Floating Button
   =================================================== */
.safe-area-pb {
    padding-bottom: calc(0.375rem + env(safe-area-inset-bottom, 0px));
}

@keyframes sosPulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6), 0 10px 25px -5px rgba(225, 29, 72, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(225, 29, 72, 0), 0 10px 25px -5px rgba(225, 29, 72, 0.5);
    }
}

.sos-float-btn {
    animation: sosPulseGlow 2s infinite;
}

/* ===================================================
   📞 Leaflet Popup: หมายเลขโทรศัพท์และปุ่มโทรฉุกเฉินให้เป็นสีขาวชัดเจน 100%
   =================================================== */
.leaflet-popup-content a[href^="tel:"],
.leaflet-popup-content a[href^="tel:"] *,
.leaflet-popup-content .sos-phone-badge,
.leaflet-popup-content .sos-phone-badge * {
    color: #ffffff !important;
}

/* ===================================================
   🌧️ Hero Water Card: Rain Falling into Water Effect
   =================================================== */
.hero-rain-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    transition: opacity 0.8s ease-in-out;
}

@-webkit-keyframes rainDropFall {
    0% {
        -webkit-transform: translate3d(0, -60px, 0) rotate(12deg);
        transform: translate3d(0, -60px, 0) rotate(12deg);
        opacity: 0;
    }
    15% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        -webkit-transform: translate3d(-35px, 340px, 0) rotate(12deg);
        transform: translate3d(-35px, 340px, 0) rotate(12deg);
        opacity: 0.1;
    }
}

@keyframes rainDropFall {
    0% {
        -webkit-transform: translate3d(0, -60px, 0) rotate(12deg);
        transform: translate3d(0, -60px, 0) rotate(12deg);
        opacity: 0;
    }
    15% {
        opacity: 0.85;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        -webkit-transform: translate3d(-35px, 340px, 0) rotate(12deg);
        transform: translate3d(-35px, 340px, 0) rotate(12deg);
        opacity: 0.1;
    }
}

.hero-rain-drop {
    position: absolute;
    top: -20px;
    width: 1.5px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(186, 230, 253, 0.75) 70%, #ffffff 100%);
    border-radius: 999px;
    opacity: 0;
    -webkit-animation: rainDropFall 0.85s linear infinite;
    animation: rainDropFall 0.85s linear infinite;
}

@-webkit-keyframes rainRippleExpand {
    0% {
        -webkit-transform: scale(0.15) rotateX(65deg);
        transform: scale(0.15) rotateX(65deg);
        opacity: 0.9;
        border-width: 1.5px;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        -webkit-transform: scale(2.5) rotateX(65deg);
        transform: scale(2.5) rotateX(65deg);
        opacity: 0;
        border-width: 0.5px;
    }
}

@keyframes rainRippleExpand {
    0% {
        -webkit-transform: scale(0.15) rotateX(65deg);
        transform: scale(0.15) rotateX(65deg);
        opacity: 0.9;
        border-width: 1.5px;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        -webkit-transform: scale(2.5) rotateX(65deg);
        transform: scale(2.5) rotateX(65deg);
        opacity: 0;
        border-width: 0.5px;
    }
}

.hero-rain-ripple {
    position: absolute;
    width: 30px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid rgba(186, 230, 253, 0.75);
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
    opacity: 0;
    -webkit-animation: rainRippleExpand 1.4s ease-out infinite;
    animation: rainRippleExpand 1.4s ease-out infinite;
}

/* บรรยากาศฟ้าครึ้มฝนเมื่อเปิดโหมดฝนตก */
#x73_hero_card.is-raining-weather {
    box-shadow: 0 25px 50px -12px rgba(12, 74, 110, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

#x73_hero_card.is-raining-weather #x73_hero_glow {
    background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, rgba(30, 58, 138, 0.15) 70%, transparent 100%);
}

/* ===================================================
   ☀️ Hero Water Card: Sunny & Clear Sky Vibrant Theme
   =================================================== */
@-webkit-keyframes spinSlow {
    from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes spinSlow {
    from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
    to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
.animate-spin-slow {
    -webkit-animation: spinSlow 15s linear infinite;
    animation: spinSlow 15s linear infinite;
}

@-webkit-keyframes sunGlowPulse {
    0%, 100% {
        opacity: 0.65;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        opacity: 0.95;
        -webkit-transform: scale(1.12);
        transform: scale(1.12);
    }
}

@keyframes sunGlowPulse {
    0%, 100% {
        opacity: 0.65;
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        opacity: 0.95;
        -webkit-transform: scale(1.12);
        transform: scale(1.12);
    }
}

/* ปรับแต่งพื้นหลังการ์ดโทนฟ้าสดใส สว่างตา ประกายแสงแดด */
#x73_hero_card.is-sunny-weather {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 45%, #1e3a8a 100%) !important;
    border-color: rgba(125, 211, 252, 0.5) !important;
    box-shadow: 0 25px 50px -12px rgba(2, 132, 199, 0.45), inset 0 1px 2px 0 rgba(255, 255, 255, 0.35) !important;
}

#x73_hero_card.is-sunny-weather #x73_hero_glow {
    background: radial-gradient(circle, rgba(253, 224, 71, 0.4) 0%, rgba(56, 189, 248, 0.25) 50%, transparent 75%) !important;
    animation: sunGlowPulse 5s ease-in-out infinite;
}

/* คลื่นน้ำโทนสีฟ้าครามสดใสประกายน้ำใส */
#x73_hero_card.is-sunny-weather .hero-wave-back {
    opacity: 0.45;
}
#x73_hero_card.is-sunny-weather .hero-wave-mid {
    opacity: 0.6;
}
#x73_hero_card.is-sunny-weather .hero-wave-front {
    opacity: 0.85;
}


