﻿/* ขยายให้ Modal Body ขยายเต็มพื้นที่ความสูง */
@import url('https://fonts.googleapis.com/css2?family=Mitr:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');

body {
    font-family: 'Mitr', sans-serif !important;
}
#modalPDFReview .modal-body {
    position: relative;
    padding: 0;
    height: 80vh; /* ให้สูง 80% ของความสูงหน้าจอ */
    overflow: hidden;
}

/* ให้ iframe ขยายเต็มพื้นที่ modal-body ทั้งกว้างและยาว */
#pdfViewerFrame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.protocol-summary-box {
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-row-top {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

@media (min-width: 768px) {
    .summary-row-top {
        flex-direction: row;
        align-items: center;
    }
}

.meta-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.meta-value-code {
    font-size: 1.5rem !important;
    font-weight: 600;
    color: #334155;
}

.btn-view-file {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #9333ea;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease;
}

    .btn-view-file:hover {
        background-color: #7e22ce;
    }

.divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
}

.title-th {
    color: #581c87;
    font-weight: 500;
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .title-th {
        font-size: 1rem;
    }
}

.title-en {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.125rem;
    font-style: italic;
}

@media (min-width: 768px) {
    .title-en {
        font-size: 0.875rem;
    }
}

.pi-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
}

.cookie-popup {
    border-radius: 16px;
    padding: 20px;
}

.swal2-confirm.btn-primary {
    background-color: #9871CC !important;
    border: none !important;
}

    .swal2-confirm.btn-primary:hover {
        background-color: #7c5bb0 !important;
    }

.notify {
    position: fixed;
    top: 20px;
    right: 40px;
    width: 420px;
    background: rgba(var(--bs-primary-rgb), .85);
    color: white;
    z-index: 1400;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 .25rem 1rem rgba(var(--bs-primary-rgb), .4);
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notify-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 34px;
    height: 34px;
    background: #e74f6a;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.notify-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 10px;
}

    .notify-header .icon {
        margin-right: 10px;
    }

    .notify-header .title {
        font-size: 18px;
    }

    .notify-header .time {
        margin-left: auto;
        font-size: 14px;
        opacity: .9;
    }

.notify-body {
    font-size: 16px;
    line-height: 1.5;
}

.notify.hide {
    animation: slideOut .4s ease forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.chat-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
    display: none;
}

.chat-header {
    padding: 12px;
    background: #1877f2;
    color: white;
    border-radius: 12px 12px 0 0;
}

.badge-blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.badge-notifications {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.ck-editor__editable_inline {
    min-height: 200px;
}

.goog-te-combo {
    font-family: 'Mitr', sans-serif !important;
    font-size: 14px;
    margin-left: 4px !important;
    margin-top: 10px !important;
    vertical-align: baseline !important;
}

.gt_black_overlay {
    display: none;
    position: fixed;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    background-color: #90979e !important;
    z-index: 10000;
    opacity: .80;
}

.white-space.nowrap {
    display: none !important;
}

div.goog-te-gadget {
    color: transparent !important;
}

.VIpgJd-ZVi9od-l4eHX-hSRGPd {
    display: none !important;
}

#google_translate_element select {
    border: none;
    font-weight: bold;
    border-radius: 3px;
    padding: 6px 12px;
}

body > .skiptranslate, .goog-logo-link, .gskiptranslate, .goog-te-gadget span, .goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame, div#goog-gt- {
    display: none !important;
}

.goog-te-gadget {
    color: transparent !important;
    font-size: 0px;
}

.gt_white_content.notranslate {
    border: var(--bs-modal-border-width) solid var(--bs-modal-border-color) !important;
    border-radius: var(--bs-modal-border-radius) !important;
    outline: 0 !important;
}

/* สีเขียว LINE */
.btn-line-scan {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #06C755;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background 0.3s, transform 0.1s;
}


/* ปุ่มปิด Modal (X) */
.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

    .close-btn:hover {
        color: #000;
    }

.modal-dialog-bottom-end {
    position: fixed;
    bottom: 20px;
    right: 20px;
    margin: 0 !important;
    max-width: calc(100vw - 40px) !important;
    z-index: 1055;
}

.chat-modal-content {
    width: 760px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
}

.chat-modal-body {
    height: 520px;
    max-height: calc(100vh - 40px);
}

.chat-body-bg {
    background-color: #f5f5f9;
    min-height: 0;
}

.chat-sidebar-list::-webkit-scrollbar,
#modalChatMessages::-webkit-scrollbar {
    width: 4px;
}

.chat-sidebar-list::-webkit-scrollbar-thumb,
#modalChatMessages::-webkit-scrollbar-thumb {
    background-color: rgba(67, 89, 113, 0.15);
    border-radius: 10px;
}

.chat-sidebar-list .list-group-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

    .chat-sidebar-list .list-group-item:hover {
        background-color: rgba(105, 108, 255, 0.04) !important;
    }

    .chat-sidebar-list .list-group-item.active {
        border-left-color: #696cff !important;
        background-color: rgba(105, 108, 255, 0.08) !important;
    }

.shadow-xs {
    box-shadow: 0 0.125rem 0.25rem rgba(161, 172, 184, 0.15) !important;
}

@media (max-width: 767.98px) {
    .modal-dialog-bottom-end {
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-width: calc(100vw - 20px) !important;
    }

    .chat-modal-body {
        height: 80vh;
    }
}

/* ==========================================
   1. Floating Action Button (FAB) & Pulse
   ========================================== */
.fab-pulse-btn {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .fab-pulse-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 50%;
        background-color: var(--bs-primary);
        z-index: -1;
        animation: fab-glow 2s infinite;
    }

    .fab-pulse-btn:hover {
        transform: scale(1.1) translateY(-3px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25) !important;
    }

    .fab-pulse-btn:active {
        transform: scale(0.95);
    }

    /* เมื่อ Hover ปุ่มแชต ให้รูป Avatar ขยายขึ้นเล็กน้อย */
    .fab-pulse-btn:hover .chat-sender-avatar-badge {
        transform: translateX(-50%) scale(1.1);
    }

@keyframes fab-glow {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.4);
        opacity: 0;
    }

    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}


/* ==========================================
   2. Button Shake / Wiggle Effects
   ========================================== */
.fab-shake {
    animation: fab-wiggle 0.5s ease-in-out;
}

@keyframes fab-wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(-15deg);
    }

    40% {
        transform: rotate(15deg);
    }

    60% {
        transform: rotate(-10deg);
    }

    80% {
        transform: rotate(10deg);
    }
}

.chat-btn-pulse {
    animation: chatButtonShake 0.6s ease-in-out infinite alternate;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7) !important;
}

@keyframes chatButtonShake {
    0% {
        transform: scale(1) rotate(0deg);
    }

    20% {
        transform: scale(1.1) rotate(-12deg);
    }

    40% {
        transform: scale(1.1) rotate(12deg);
    }

    60% {
        transform: scale(1.1) rotate(-12deg);
    }

    80% {
        transform: scale(1.1) rotate(12deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}


/* ==========================================
   3. Top Floating Label (ป้ายข้อความด้านบน)
   ========================================== */
.fab-label-top {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    white-space: nowrap;
    animation: fab-float 2.5s infinite ease-in-out;
}

    .fab-label-top::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border-width: 5px;
        border-style: solid;
        border-color: #212529 transparent transparent transparent;
    }

@keyframes fab-float {
    0%, 100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, -6px);
    }
}


/* ==========================================
   4. Unread Badge & Avatar Animations
   ========================================== */
/* กรอบรูป Avatar */
.chat-sender-avatar-badge {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    top: -5px !important;
    left: 70% !important;
    transform: translateX(-50%);
    transition: transform 0.2s ease;
}

/* เอฟเฟกต์ Pop-in เด้งเปิดตัว + Pulse ต่อเนื่อง */
.avatar-pop-in {
    animation: avatarPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, avatarPulse 2s infinite 0.5s ease-in-out;
}

@keyframes avatarPop {
    0% {
        transform: translateX(-50%) scale(0) rotate(-20deg);
        opacity: 0;
    }

    70% {
        transform: translateX(-50%) scale(1.2) rotate(10deg);
        opacity: 1;
    }

    100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes avatarPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.8), 0 4px 10px rgba(0,0,0,0.3);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0), 0 6px 14px rgba(0,0,0,0.4);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0), 0 4px 10px rgba(0,0,0,0.3);
    }
}

/* จุดจุดสีแดงเดิม (Badge Pulse) */
.badge-pulse-animation {
    animation: badgePulse 1.5s infinite;
}

@keyframes badgePulse {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    70% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 0 8px rgba(220, 53, 69, 0);
    }

    100% {
        transform: translate(-50%, -50%) scale(0.9);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}


/* ==========================================
   5. Online Status Indicator (จุดสีเขียว)
   ========================================== */
.online-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 13px;
    height: 13px;
    background-color: #28a745;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.9);
    z-index: 2;
}

    .online-status-indicator::after {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 2px solid #28a745;
        animation: online-pulse 1.6s infinite ease-in-out;
    }

@keyframes online-pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}


/* ==========================================
   6. General Helpers
   ========================================== */
.btn-top-right {
    position: absolute;
    top: 35px;
    right: 30px;
}


/* Container วางเหนือปุ่ม FAB จัดเรียงรูปซ้อนขึ้นด้านบน */
.avatar-stack-container {
    position: absolute;
    bottom: 100%;
    right: 5px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column-reverse; /* รูปใหม่สุดจะอยู่ล่างสุดใกล้ปุ่ม */
    align-items: center;
    pointer-events: none;
}

/* กรอบรูปภาพแต่ละคน */
.avatar-stack-item {
    position: relative;
    width: 38px;
    height: 38px;
    margin-bottom: -12px; /* ให้รูปเกยซ้อนเหลื่อมกัน */
    border-radius: 50%;
}

/* Animation เด้งเปิดตัวพร้อม Pulse */
.avatar-pop-in {
    animation: avatarPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, avatarPulse 2.5s infinite 0.4s ease-in-out;
}

@keyframes avatarPop {
    0% {
        transform: translateY(15px) scale(0);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes avatarPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
}

/* จุดสถานะ Online สีเขียว */
.online-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    background-color: #28a745;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.9);
    z-index: 2;
}
/* ปรับแต่งพื้นที่แชตสำหรับจอมือถือ (< 768px) */
@media (max-width: 767.98px) {
    /* ให้ความสูงของกล่องข้อความปรับพอดีกับหน้าจอมือถือ */
    .chat-main-area {
        height: 100% !important;
        min-height: -webkit-fill-available;
    }

    /* ปรับขนาด Bubble ข้อความในมือถือไม่ให้กว้างเกินไป */
    #modalChatMessages .d-flex > div {
        max-width: 90% !important;
    }

    /* ปรับขนาดตัวอักษรในข้อความแชตให้พอดีบนจอมือถือ */
    #modalChatMessages p {
        font-size: 13px !important;
    }

    /* สไตล์ปุ่มจบการสนทนาขนาดเล็กสำหรับมือถือ */
    .btn-xs {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        line-height: 1.2;
    }
}

/* ป้องกันปัญหา Safari / iOS Chrome แถบ Browser บังส่วนล่าง */
.chat-body-bg {
    background-color: #f8f9fa;
    -webkit-overflow-scrolling: touch; /* เพิ่มความลื่นในการ Scroll บน iOS */
}
 
/* กำหนดสไตล์แชท */
.chat-modal-body {
    display: flex;
    flex-direction: column;
}

#modalChatMessages {
    min-height: 0; /* ป้องกัน Flex Child ไม่ยอมคุม Scrollbar */
}

/* 📱 จอมือถือ (< 768px): ขยายเต็มหน้าจอ */
@media (max-width: 767.98px) {
    #liveChatModal .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        height: 100% !important;
    }

    #liveChatModal .modal-content {
        height: 100vh !important;
        border-radius: 0 !important;
    }

    #liveChatModal .chat-modal-body {
        height: 100vh !important;
        max-height: 100vh !important;
    }
}
/* 1. บังคับ Column หลักให้ใช้ Flexbox แนวตั้งที่สมบูรณ์ */
#chatMainArea {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important; /* ป้องกันเนื้อหาทะลุออกนอกกล่องใหญ่ */
}

/* 2. บังคับกล่องข้อความแชทไม่ให้ดันช่องพิมพ์ตกขอบ */
#modalChatMessages {
    flex: 1 1 auto !important;
    height: 0 !important; /* 🎯 จุดสำคัญ: บังคับให้คิดความสูงจาก Flex parent เท่านั้น */
    min-height: 0 !important; /* 🎯 จุดสำคัญ: ป้องกัน Flex child ยืดตามเนื้อหาภายใน */
    overflow-y: auto !important; /* ให้เกิด Scrollbar เฉพาะด้านในนี้ */
}

/* 3. ล็อกช่องพิมพ์ข้อความให้อยู่ติดขอบล่างเสมอ */
.chat-input-footer {
    flex-shrink: 0 !important; /* ห้ามโดนบีบขนาด */
    margin-top: auto !important; /* ดันลงชิดขอบล่างสุด */
}
/* ==========================================
   1. Nav Tab Container (Mobile Scrollable)
   ========================================== */
.nav-tabs {
    border-bottom: 1px solid #e9ecef;
    display: flex;
    flex-wrap: nowrap; /* ป้องกันการขึ้นบรรทัดใหม่บนมือถือ */
    overflow-x: auto; /* เปิดให้เลื่อนซ้าย-ขวาได้เมื่อเมนูล้นจอ */
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* ให้การรูดจอแนวนอนบน iOS ลื่นไหล */
    padding-bottom: 0.25rem;
    gap: 0.25rem;
}

    /* ซ่อน Scrollbar ของ Container เพื่อความสะอาดสวยงาม */
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

.nav-tabs {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

    .nav-tabs .nav-item {
        flex: 0 0 auto; /* ให้แต่ละ Item ขนาดพอดีคำ ไม่โดนบีบย่อ */
        margin-bottom: -1px;
    }

    /* ==========================================
   2. Tab Button Styles
   ========================================== */
    .nav-tabs .nav-link {
        color: #6c757d;
        font-weight: 500;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid transparent;
        border-radius: 0.5rem;
        background-color: transparent;
        transition: all 0.2s ease-in-out;
    }

        /* Hover & Active States */
        .nav-tabs .nav-link:hover {
            color: #0d6efd;
            background-color: #f8f9fa;
        }

        .nav-tabs .nav-link.active {
            color: #0d6efd;
            font-weight: 600;
            background-color: #ffffff;
            border-color: #dee2e6 #dee2e6 #ffffff;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        }

            .nav-tabs .nav-link.active i {
                color: #0d6efd !important;
            }

/* ==========================================
   3. Badge Styling (Responsive Design)
   ========================================== */
/* ปรับระยะห่างไอคอนและจัด Center */
.nav-link .position-relative {
    line-height: 1;
}

/* Badge ลอยติดมุมขวาบนของไอคอน */
.badge-count {
    font-size: 0.65rem !important;
    font-weight: 700;
    padding: 0.25em 0.45em !important;
    border-radius: 50rem !important; /* ทรงกลม Pill */
    line-height: 1;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc3545; /* สีแดง Notification */
    color: #ffffff;
    border: 2px solid #ffffff; /* ขอบสีขาวตัดกับไอคอน */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* เมื่อเปลี่ยนเป็น Active State สามารถปรับสี Badge ให้เด่นขึ้นได้ */
.nav-link.active .badge-count {
    background-color: #0d6efd; /* เปลี่ยนเป็นสีน้ำเงินเมื่อเลือก Tab */
    border-color: #ffffff;
}

/* ซ่อน Badge อัตโนมัติถ้าไม่มีข้อมูลนับค้างไว้ */
.badge-count:empty {
    display: none !important;
}

/* ==========================================
   4. Responsive Breakpoints (Mobile Tweaks)
   ========================================== */

/* บนหน้าจอขนาดเล็ก (มือถือ < 576px) */
@media (max-width: 575.98px) {
    .nav-tabs .nav-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }

        .nav-tabs .nav-link i {
            font-size: 1.1rem; /* ขยายไอคอนให้แตะง่ายขึ้นบนมือถือ */
        }

    /* ปรับตำแหน่ง Badge บนมือถือให้อยู่มุมขวาบนเล็กน้อย */
    .badge-count {
        font-size: 0.65rem;
        padding: 0.15em 0.4em;
        margin-left: 0.2rem !important;
    }
}

/* บนหน้าจอ Desktop (>= 576px) */
@media (min-width: 576px) {
    .nav-tabs .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}
 

/* ==========================================
   2. Responsive Behavior Strategy
   ========================================== */

/* 📱 บนมือถือ (< 768px): ให้ใช้วิธี Scroll แนวนอนเหมือนเดิม ไม่ให้กินพื้นที่แนวตั้ง */
@media (max-width: 767.98px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

        .nav-tabs::-webkit-scrollbar {
            display: none; /* Chrome/Safari */
        }
}

/* 💻 บนหน้าจอใหญ่ (>= 768px): ตัดขึ้นแถวใหม่ (Wrap Rows) เมื่อ Roles เกินพื้นที่ */
@media (min-width: 768px) {
    .nav-tabs {
        flex-wrap: wrap; /* เปิดให้ขึ้นบรรทัดใหม่เมื่อเกิน 4 หรือล้นจอ */
        overflow-x: visible;
    }

        /* สไตล์ปุ่มเมื่อขึ้นบรรทัดใหม่ */
        .nav-tabs .nav-link {
            padding: 0.55rem 1rem;
            border: 1px solid #e9ecef; /* เพิ่มเส้นขอบเบาๆ เพื่อให้ดูแยกเป็นสัดส่วน */
            border-radius: 0.5rem;
            background-color: #f8f9fa;
        }

            .nav-tabs .nav-link:hover {
                background-color: #e9ecef;
                border-color: #ced4da;
            }

            .nav-tabs .nav-link.active {
                background-color: #ffffff;
                border-color: #0d6efd; /* เส้นขอบสีน้ำเงินเน้นปุ่มที่ Active */
                box-shadow: 0 2px 8px rgba(13, 110, 253, 0.12);
            }
}
/* ==========================================
   Multi-row Navigation (Left-aligned)
   ========================================== */

/* ปรับเปลี่ยนจาก Grid เป็น Flexbox เพื่อให้ Item เรียงต่อกันและชิดซ้าย */
ul.nav-tabs.multi-row-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important; /* 🟢 จัดชิดซ้าย */
    gap: 0.5rem !important;
    border-bottom: none !important;
    width: 100%;
}

    /* ให้ขนาดแต่ละ Item ปรับตามความกว้างของเนื้อหา */
    ul.nav-tabs.multi-row-nav .nav-item {
        width: auto !important; /* 🟢 ไม่ยืดเต็มคอลัมน์ */
        margin: 0 !important;
    }

    /* ปรับแต่งปุ่ม Nav Link ให้ข้อความและไอคอนชิดซ้าย */
    ul.nav-tabs.multi-row-nav .nav-link {
        width: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important; /* 🟢 ชิดซ้าย */
        text-align: left !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 0.5rem !important;
        background-color: #f8f9fa;
        padding: 0.6rem 1rem !important; /* เพิ่มระยะระยะขอบข้างเพื่อความสวยงาม */
        transition: all 0.2s ease-in-out;
    }

        ul.nav-tabs.multi-row-nav .nav-link:hover {
            background-color: #e9ecef;
            border-color: #adb5bd !important;
        }

        ul.nav-tabs.multi-row-nav .nav-link.active {
            background-color: #ffffff !important;
            border-color: #0d6efd !important;
            color: #0d6efd !important;
            box-shadow: 0 3px 8px rgba(13, 110, 253, 0.15) !important;
        }

/* ==========================================
   Role Segmented Switch & Scroll Container
   ========================================== */

/* Container Switch ปรับเป็น inline-flex เพื่อหดตามเนื้อหาและชิดซ้าย */
.role-segmented-switch {
    display: inline-flex !important;
    justify-content: flex-start !important; /* 🟢 ชิดซ้าย */
    gap: 4px;
    /*background-color: #f1f5f9;*/
    padding: 4px;
    max-width: 100%;
}

/* รองรับ Horizontal Scroll บนจอแคบโดยเรียงจากซ้ายไปขวา */
.role-scroll-container {
     
    justify-content: flex-start !important; /* 🟢 ชิดซ้าย */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* ซ่อน scrollbar ใน Firefox */
}

    .role-scroll-container::-webkit-scrollbar {
        display: none; /* ซ่อน scrollbar ใน Chrome/Safari */
    }

/* ปุ่ม Switch จัดเนื้อหาภายในชิดซ้าย */
.role-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start !important; /* 🟢 ชิดซ้าย */
    text-align: left !important;
    border: none !important;
    font-size: 0.85rem;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    user-select: none;
}

    .role-switch-btn:hover:not(.active) {
        background-color: rgba(0, 0, 0, 0.04);
        color: var(--bs-primary) !important;
    }

    .role-switch-btn.active {
        background-color: var(--bs-primary) !important;
        color: #ffffff !important;
    }

/* Custom Responsive Style สำหรับมือถือ (< 575.98px) */
@media (max-width: 575.98px) {
    .role-segmented-switch {
        width: auto;
        display: inline-flex;
        justify-content: flex-start !important; /* 🟢 ปรับให้ชิดซ้ายบนจอมือถือ */
    }

    .role-switch-btn {
        flex: 0 0 auto !important; /* 🟢 ยกเลิก flex-growth ให้ขนาดเท่าเนื้อหาจริง */
        justify-content: flex-start !important;
        padding-top;
    }
}
/* เอฟเฟกต์กระพือ (Pulse) ดึงดูดสายตา */
@keyframes ctaPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(105, 108, 255, 0.4);
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 12px rgba(105, 108, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(105, 108, 255, 0);
    }
}

/* แสงวิ่งผ่านปุ่ม (Shine Effect) */
@keyframes btnShine {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.btn-cta-pulse {
    animation: ctaPulse 2.5s infinite ease-in-out;
    border-radius: 14px !important;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

    .btn-cta-pulse:hover {
        transform: translateY(-3px) scale(1.05);
        box-shadow: 0 12px 25px rgba(105, 108, 255, 0.45) !important;
        animation: none; /* หยุดพัก pulse ตอนเอาเมาส์ชี้ เพื่อให้เด่นที่ Hover แทน */
    }

    /* สร้างแสงวิ่งบนปุ่ม */
    .btn-cta-pulse::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient( 120deg, transparent, rgba(255, 255, 255, 0.35), transparent );
        animation: btnShine 4s infinite linear;
    }
/* เอฟเฟกต์โลโก้ขยายเข้า-ออกเบาๆ */
@keyframes logoPulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.06);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

.loader-logo-pulse {
    animation: logoPulse 1.8s infinite ease-in-out;
}

/* เอฟเฟกต์แสงวิ่งบน Progress Bar */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.loader-shimmer-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}
.menu .app-brand .app-brand-text {
    color: #ffffff !important;
}


/* เอฟเฟกต์โลโก้ขยายเข้า-ออกเบาๆ */
@keyframes logoPulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.06);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

.loader-logo-pulse {
    animation: logoPulse 1.8s infinite ease-in-out;
}

/* เอฟเฟกต์แสงวิ่งบน Progress Bar */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.loader-shimmer-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}