/* footer ส่วนหลัก: ส่วนท้าย, เบอร์ภายใน, ตัวนับผู้เข้าชม, ปุ่มลอย, คุกกี้
 * โหลดก่อนแชตบอต/ปุ่มแปลภาษา (CSS ของสองตัวนั้นอยู่ในไฟล์ include ของมันเอง) — ลำดับหมวดคงตามโค้ดเดิม */

/* Footer Wave */
.footer-wave {
    background: transparent;
    margin-bottom: -2px;
}

.footer-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

/* Footer Enhanced */
.footer-enhanced {
    background: linear-gradient(180deg, #0a1628 0%, #05101f 100%);
    color: white;
}

/* Footer Links */
.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 0;
}

.footer-links a::before {
    content: '→';
    position: absolute;
    left: -20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: #ffd700;
    padding-left: 20px;
}

.footer-links a:hover::before {
    opacity: 1;
    left: 0;
}

/* Contact Items */
.contact-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #ffd700;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.contact-item:hover .contact-icon {
    background: #ffd700;
    color: #0a1628;
    transform: scale(1.1);
}

.contact-item:hover span {
    color: #ffd700;
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 10px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.social-icon.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #0d65d9 100%);
}

.social-icon.messenger {
    background: linear-gradient(135deg, #00b2ff 0%, #a033ff 60%, #ff5c87 100%);
}

.social-icon.line {
    background: linear-gradient(135deg, #00b900 0%, #009900 100%);
}

.social-icon.youtube {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}

.social-icon.admin {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.social-icon:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    color: white;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Remove old styles */
.hover-opacity-100:hover {
    opacity: 1 !important;
}

/* ═══════════════════════════════════════════ */
/* ✦ Visitor Counter Styles ✦ */
/* ═══════════════════════════════════════════ */
.visitor-counter-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.visitor-counter-wrapper {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 215, 0, 0.03) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.visitor-counter-wrapper::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Compact Layout */
.vc-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

/* Online Badge */
.vc-online-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 50px;
    padding: 8px 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.vc-online-badge:hover {
    background: rgba(34, 197, 94, 0.15);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.15);
}

.vc-online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
}

.vc-online-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 16px;
    height: 16px;
    background: rgba(34, 197, 94, 0.4);
    border-radius: 50%;
    animation: vcPulse 2s ease-in-out infinite;
}

@keyframes vcPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.vc-online-text {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    white-space: nowrap;
}

.vc-online-text strong {
    color: #4ade80;
    font-weight: 700;
    font-size: 1rem;
}

/* Divider */
.vc-divider {
    width: 1px;
    height: 32px;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    flex-shrink: 0;
}

/* Total Block */
.vc-total-block {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.vc-total-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ffd700 0%, #f59e0b 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #003366;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
}

.vc-total-block:hover .vc-total-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
}

.vc-total-info {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.vc-total-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
}

.vc-total-value {
    font-family: 'Inter', 'Prompt', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.vc-total-unit {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
}

/* คลิกเพื่อเปิดสถิติรายเดือน */
#vcOpenStats {
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#vcOpenStats:hover {
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 6px 24px rgba(255, 215, 0, 0.08);
}

#vcOpenStats:focus-visible {
    outline: 3px solid #ffd700;
    outline-offset: 3px;
}

.vc-stats-hint {
    font-size: 0.78rem;
    color: rgba(255, 215, 0, 0.75);
    border: 1px dashed rgba(255, 215, 0, 0.3);
    border-radius: 50px;
    padding: 4px 12px;
    white-space: nowrap;
}

#vcOpenStats:hover .vc-stats-hint {
    color: #ffd700;
    border-style: solid;
}

/* Monthly Stats Modal */
.vs-card {
    width: 560px;
}

.vs-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.vs-summary-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
    text-align: center;
}

.vs-summary-item small {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
}

.vs-summary-item strong {
    color: #ffd700;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
}

.vs-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 170px;
    padding: 22px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    overflow-x: auto;
}

.vs-bar-col {
    flex: 1 0 34px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.vs-bar {
    width: 100%;
    max-width: 44px;
    min-height: 2px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #ffd700 0%, rgba(245, 158, 11, 0.55) 100%);
    transform-origin: bottom;
    animation: vsGrow 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.vs-bar-col.is-current .vs-bar {
    background: linear-gradient(180deg, #4ade80 0%, rgba(34, 197, 94, 0.5) 100%);
}

@keyframes vsGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

.vs-bar-val {
    font-family: 'Inter', sans-serif;
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
    white-space: nowrap;
}

.vs-labels {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.vs-labels span {
    flex: 1 0 34px;
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.vs-table-wrap {
    max-height: 220px;
    overflow-y: auto;
    margin-top: 16px;
}

.vs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.vs-table th,
.vs-table td {
    padding: 8px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.8);
}

.vs-table th {
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    background: #13212f;
}

.vs-table td.num,
.vs-table th.num {
    text-align: right;
    font-family: 'Inter', sans-serif;
}

.vs-table td.num strong {
    color: #ffd700;
}

.vs-up { color: #4ade80 !important; }
.vs-down { color: #f87171 !important; }

.vs-status {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 576px) {
    .visitor-counter-wrapper {
        padding: 14px 18px;
    }

    .vs-summary {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .vs-summary-item {
        padding: 8px 6px;
    }

    .vs-summary-item strong {
        font-size: 0.95rem;
    }

    .vc-compact {
        gap: 16px;
    }

    .vc-divider {
        width: 40px;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    }

    .vc-total-value {
        font-size: 1.3rem;
    }
}

/* =====================================================================
   Footer ธีมอวกาศ (2026-09-29) — ชุดเดียวกับหน้าแรก: ฟ้าดาว + เส้นเรืองแสงทอง/ฟ้า + กระจกขอบทอง
   ชี้เมาส์ = เปลี่ยนสี/เรืองแสงเท่านั้น ไม่เด้ง
   ===================================================================== */
.footer-wave svg path { fill: #050c22; }
.footer-enhanced {
    position: relative;
    overflow: hidden;
    color: #e8eeff;
    /* ทุกหน้าใช้แบบเดียวกับหน้าแรก (โหมดอวกาศ): ชั้นโปร่งแสง — หน้าแรกจะเห็นโลก/ดาวด้านหลัง */
    background: linear-gradient(180deg, rgba(3, 8, 26, .72) 0%, rgba(2, 5, 16, .94) 100%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
/* หน้าแรกซ่อนคลื่นเหนือ footer — ให้ทุกหน้าเหมือนกัน */
.footer-wave { display: none; }
.footer-enhanced::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 213, 74, .7), rgba(79, 195, 247, .7), transparent);
    box-shadow: 0 0 18px rgba(255, 196, 64, .45);
}
.footer-enhanced > .container { position: relative; }
/* โลโก้/ชื่อหน่วยงาน */
.footer-enhanced img[alt="NPU Logo"] { filter: drop-shadow(0 0 10px rgba(255, 196, 64, .35)); }
.footer-enhanced h5.text-warning { color: #ffd54a !important; text-shadow: 0 0 18px rgba(255, 196, 64, .3); }
.footer-enhanced .text-white-50 { color: rgba(232, 238, 255, .62) !important; }
/* หัวข้อคอลัมน์: ไอคอนในวงกลมเรืองแสง + เส้นใต้ไล่สี */
.footer-enhanced h6.text-warning {
    color: #ffe28a !important;
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-bottom: 10px;
    letter-spacing: .02em;
}
.footer-enhanced h6.text-warning i {
    width: 28px; height: 28px; margin-right: 10px !important;
    display: inline-grid; place-items: center; border-radius: 50%;
    font-size: .78rem; color: #ffd54a;
    background: radial-gradient(circle at 35% 30%, rgba(255, 226, 138, .28), rgba(255, 171, 64, .06) 70%);
    border: 1px solid rgba(255, 213, 74, .45);
    box-shadow: 0 0 10px rgba(255, 196, 64, .25);
}
.footer-enhanced h6.text-warning::after {
    content: ''; position: absolute; left: 0; bottom: 0; width: 56px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #ffd54a, rgba(79, 195, 247, .7), transparent);
}
/* ลิงก์: สีจาง → ทอง, ลูกศรเลื่อนเข้ามาเบา ๆ */
.footer-links a { color: rgba(232, 238, 255, .66); transition: color .2s ease, padding-left .2s ease; }
.footer-links a::before { content: '›'; color: #ffd54a; font-weight: 700; left: -14px; transition: opacity .2s ease, left .2s ease; }
.footer-links a:hover { color: #ffe28a; padding-left: 14px; }
.footer-links a:hover::before { left: 0; }
.footer-links a i { color: #4fc3f7; }
/* ติดต่อ */
.contact-icon {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 213, 74, .4);
    color: #ffd54a;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.contact-item:hover .contact-icon { background: linear-gradient(135deg, #ffe28a, #ffab40); color: #1a1300; transform: none; box-shadow: 0 0 14px rgba(255, 171, 64, .45); }
.contact-item:hover span { color: #ffe28a; }
/* โซเชียล: วงกลมกระจก → ชี้แล้วเติมสีแบรนด์ + เรืองแสง */
.social-icon {
    background: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(160, 190, 255, .28);
    color: #e8eeff;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.social-icon:hover { transform: none; color: #fff; border-color: transparent; }
.social-icon.facebook:hover { background: #1877f2 !important; box-shadow: 0 0 16px rgba(24, 119, 242, .6); }
.social-icon.messenger:hover { background: linear-gradient(135deg, #00b2ff 0%, #a033ff 60%, #ff5c87 100%) !important; box-shadow: 0 0 16px rgba(160, 51, 255, .55); }
.social-icon.line:hover { background: #06c755 !important; box-shadow: 0 0 16px rgba(6, 199, 85, .55); }
.social-icon.youtube:hover { background: #ff0000 !important; box-shadow: 0 0 16px rgba(255, 0, 0, .5); }
.social-icon.admin:hover { background: linear-gradient(135deg, #ffe28a, #ffab40) !important; color: #1a1300; box-shadow: 0 0 16px rgba(255, 171, 64, .55); }
/* ตัวนับผู้เข้าชม: การ์ดกระจกขอบทอง */
.visitor-counter-section { border-top-color: rgba(160, 190, 255, .1); }
.visitor-counter-wrapper {
    background: linear-gradient(160deg, rgba(20, 38, 90, .55), rgba(6, 12, 34, .6));
    border: 1px solid rgba(255, 213, 74, .3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .06);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.visitor-counter-wrapper:hover { border-color: rgba(255, 213, 74, .6); box-shadow: 0 12px 30px rgba(0, 0, 0, .35), 0 0 18px rgba(255, 196, 64, .18); }
.vc-total-value {
    background: linear-gradient(135deg, #fff 0%, #ffe28a 45%, #ffab40 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent !important;
}
/* แถวลิขสิทธิ์ */
.footer-bottom { border-top: 0; position: relative; }
.footer-bottom::before {
    content: ''; position: absolute; inset: 0 10% auto 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(160, 190, 255, .25), transparent);
}
.footer-bottom .text-warning { color: #ffd54a !important; }
/* เบอร์ภายในแต่ละแผนก: การ์ดกระจก เลขภายในเป็นป้ายทอง */
.footer-ext {
    padding: 18px 20px 20px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(20, 38, 90, .45), rgba(6, 12, 34, .5));
    border: 1px solid rgba(160, 190, 255, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.footer-ext-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.footer-ext-title { color: #ffe28a; font-weight: 700; font-size: 1rem; display: inline-flex; align-items: center; }
.footer-ext-title i {
    width: 28px; height: 28px; margin-right: 10px; display: inline-grid; place-items: center; border-radius: 50%;
    font-size: .78rem; color: #ffd54a; border: 1px solid rgba(255, 213, 74, .45);
    background: radial-gradient(circle at 35% 30%, rgba(255, 226, 138, .28), rgba(255, 171, 64, .06) 70%);
}
.footer-ext-main { color: rgba(232, 238, 255, .7); font-size: .88rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.footer-ext-main a { color: #fff; font-weight: 800; font-size: 1.05rem; text-decoration: none; letter-spacing: .02em; }
.footer-ext-main a:hover { color: #ffe28a; }
.footer-ext-place { color: rgba(232, 238, 255, .55); font-size: .8rem; }
.footer-ext-place i { color: #4fc3f7; margin-right: 6px; }
.footer-ext-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.footer-ext-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; text-decoration: none;
    background: rgba(255, 255, 255, .04); border: 1px solid rgba(160, 190, 255, .14);
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.footer-ext-item:hover { border-color: rgba(255, 213, 74, .55); background: rgba(255, 255, 255, .07); box-shadow: 0 0 16px rgba(255, 196, 64, .15); }
.footer-ext-no {
    flex-shrink: 0; min-width: 54px; padding: 6px 8px; border-radius: 10px; text-align: center;
    background: linear-gradient(135deg, #ffe28a, #ffab40); color: #1a1300; font-weight: 800; font-size: 1.05rem; line-height: 1.05;
    box-shadow: 0 3px 10px rgba(255, 171, 64, .25);
}
.footer-ext-no small { display: block; font-size: .58rem; font-weight: 700; opacity: .75; letter-spacing: .04em; }
.footer-ext-name { color: rgba(232, 238, 255, .88); font-size: .84rem; line-height: 1.35; }
.footer-ext-name i { color: #4fc3f7; font-size: .8rem; margin-right: 7px; width: 14px; text-align: center; }
.footer-ext-item:hover .footer-ext-name { color: #fff; }
@media (max-width: 991px) { .footer-ext-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .footer-ext-grid { grid-template-columns: 1fr; } .footer-ext { padding: 14px; } }
/* Modal เบอร์ภายใน (<dialog>) */
.footer-ext-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    margin: auto;
    padding: 26px 24px 18px;
    color: #e8eeff;
    background: linear-gradient(160deg, rgba(16, 30, 72, .97), rgba(5, 11, 32, .98));
    border: 1px solid rgba(255, 213, 74, .4);
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 4px rgba(255, 213, 74, .06);
}
.footer-ext-dialog::backdrop { background: rgba(2, 6, 20, .65); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.footer-ext-dialog[open] { animation: extIn .25s ease-out; }
@keyframes extIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.footer-ext-dialog .footer-ext-head { padding-right: 40px; }
.footer-ext-close {
    position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(160, 190, 255, .3); background: rgba(255, 255, 255, .06); color: #e8eeff; cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}
.footer-ext-close:hover { background: rgba(255, 213, 74, .18); border-color: rgba(255, 213, 74, .6); color: #ffe28a; }
.footer-ext-close:focus-visible, .footer-ext-open:focus-visible, .footer-ext-item:focus-visible { outline: 2px solid #ffd54a; outline-offset: 2px; }
.footer-ext-note { margin: 12px 0 0; font-size: .74rem; color: rgba(232, 238, 255, .5); text-align: center; }
/* ปุ่มเปิดในคอลัมน์ "ติดต่อเรา" */
.footer-ext-open {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
    font: inherit; font-size: .82rem; font-weight: 600; color: #ffe28a;
    background: rgba(255, 213, 74, .08); border: 1px solid rgba(255, 213, 74, .45);
    transition: background-color .2s ease, box-shadow .2s ease;
}
.footer-ext-open:hover { background: rgba(255, 213, 74, .18); box-shadow: 0 0 14px rgba(255, 196, 64, .25); }
@media (prefers-reduced-motion: reduce) { .footer-ext-dialog[open] { animation: none; } }

/* ══ ป๊อปอัปสถิติรายเดือน / ปุ่มลอย ══════════════════════════ */
/* ==============================
   Premium FAB + Theme controls
   ============================== */
#fabMainIcon { display: block !important; }
#fabMainCloseIcon { display: none !important; }
#fabMain.active #fabMainIcon { display: none !important; }
#fabMain.active #fabMainCloseIcon { display: block !important; }

/* ---------- Dark mode ---------- */
html.theme-dark,
body.dark-mode {
    color-scheme: dark;
}
body.dark-mode {
    background-color: #0b1220 !important;
    color: #e5e7eb !important;
}
body.dark-mode main,
body.dark-mode .main-content,
body.dark-mode .content,
body.dark-mode .page-content,
body.dark-mode .container-fluid,
body.dark-mode section {
    color: #e5e7eb;
}
body.dark-mode .card,
body.dark-mode .modal-content,
body.dark-mode .dropdown-menu,
body.dark-mode .list-group-item,
body.dark-mode .table,
body.dark-mode .accordion-item {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: rgba(255,255,255,.10) !important;
}
body.dark-mode .card-header,
body.dark-mode .card-footer {
    background-color: rgba(255,255,255,.04) !important;
    color: #f9fafb !important;
    border-color: rgba(255,255,255,.08) !important;
}
body.dark-mode .text-dark { color: #e5e7eb !important; }
body.dark-mode .text-muted { color: #9ca3af !important; }
body.dark-mode .bg-light { background-color: #111827 !important; color: #e5e7eb !important; }
body.dark-mode .bg-white { background-color: #111827 !important; color: #e5e7eb !important; }
body.dark-mode .table { --bs-table-bg: #111827; --bs-table-color: #e5e7eb; }
body.dark-mode .table > :not(caption) > * > * {
    background-color: #111827 !important;
    color: #e5e7eb !important;
    border-color: rgba(255,255,255,.08) !important;
}
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: #0f172a !important;
    color: #f3f4f6 !important;
    border-color: #334155 !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: #94a3b8 !important; }
body.dark-mode a:not(.fab-btn) { color: #93c5fd; }

/* ---------- แถบปุ่มลอยขวาล่าง: กระจกน้ำเงินเข้มขอบทอง (ชุดเดียวกับปุ่มภาษา/น้องนภา) ---------- */
.premium-fab-dock {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 7px !important;
    background: linear-gradient(160deg, rgba(10, 22, 58, .9), rgba(20, 40, 92, .86)) !important;
    border: 1px solid rgba(255, 213, 74, .45) !important;
    box-shadow: 0 10px 28px rgba(0, 10, 40, .35), 0 0 0 3px rgba(255, 213, 74, .06) !important;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.premium-fab-dock .fab-btn::after { display: none; } /* ปิดแสงวาบเดิม */
.premium-fab-dock .fab-btn:hover { transform: none; }
/* ปุ่มกลางวัน/กลางคืน */
.fab-daynight {
    position: relative; width: 46px; height: 46px; overflow: visible !important;
    color: #ffd54a; font-size: 1.15rem; cursor: pointer; user-select: none; -webkit-user-select: none;
    background: radial-gradient(circle at 35% 30%, rgba(255, 226, 138, .3), rgba(255, 171, 64, .06) 70%), rgba(255, 255, 255, .04) !important;
    border: 1px solid rgba(255, 213, 74, .55) !important;
    box-shadow: 0 0 12px rgba(255, 196, 64, .25) !important;
    transition: box-shadow .2s ease, background-color .2s ease;
}
.fab-daynight:hover { box-shadow: 0 0 18px rgba(255, 196, 64, .5) !important; }
.fab-daynight:focus-visible { outline: 2px solid #ffd54a; outline-offset: 3px; }
.fab-daynight i { pointer-events: none; }
.fab-daynight[data-mode="day"] { color: #ffb020; background: radial-gradient(circle at 35% 30%, rgba(255, 240, 180, .55), rgba(255, 176, 32, .15) 70%) !important; }
.fab-daynight[data-mode="night"] { color: #cfe0ff; background: radial-gradient(circle at 35% 30%, rgba(160, 190, 255, .3), rgba(30, 50, 110, .2) 70%) !important; border-color: rgba(160, 190, 255, .55) !important; box-shadow: 0 0 12px rgba(120, 160, 255, .3) !important; }
.fab-daynight.is-switching i { animation: fabDnSwap .45s ease; }
@keyframes fabDnSwap { from { transform: rotate(-120deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.fab-dn-badge {
    position: absolute; top: -4px; right: -4px; width: 17px; height: 17px; border-radius: 50%;
    background: linear-gradient(135deg, #ffe28a, #ffab40); color: #1a1300; font-size: 9.5px; font-weight: 800; line-height: 17px; text-align: center;
    box-shadow: 0 0 0 2px rgba(10, 22, 58, .95); pointer-events: none;
}
.fab-daynight:not([data-mode="auto"]) .fab-dn-badge { display: none; }
.fab-dn-label {
    position: absolute; right: -8px; bottom: calc(100% + 14px); /* เหนือปุ่ม — ไม่ชนปุ่มลอยอื่นที่เรียงแถวล่าง */
    white-space: nowrap; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: rgba(10, 22, 58, .95); color: #fff; border: 1px solid rgba(255, 213, 74, .45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.premium-fab-dock .fab-dn-label { transition: opacity .2s ease !important; }
.premium-fab-dock .fab-daynight .fab-dn-label.show { opacity: 1 !important; }
/* ปุ่มกลับขึ้นด้านบน ให้เข้าชุด */
.premium-fab-dock .fab-top { background: rgba(255, 255, 255, .06) !important; color: #ffd54a !important; border: 1px solid rgba(255, 213, 74, .3) !important; }
.premium-fab-dock .fab-top.show { width: 46px; height: 46px; }
.premium-fab-dock .fab-top:hover { background: rgba(255, 213, 74, .16) !important; color: #ffe28a !important; transform: none; }
@media (prefers-reduced-motion: reduce) { .fab-daynight.is-switching i { animation: none; } }

/* ══ แถบคุกกี้ ═══════════════════════════════════════════ */
.cookie-consent-banner.show {
    transform: translateY(0) !important;
}

.cookie-text a:hover {
    color: #fff !important;
}
