/* ==========================================================
   GLOBAL LOADING OVERLAY - ULTRA GLASSMORPHISM THEME
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800&family=Prompt:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand: #FF8C00;
    --brand-dark: #4A0C46;
    --brand-gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    --loader-font: 'Kanit', 'Prompt', sans-serif;
}

/* 1. ฉากหลังโปร่งแสงบางเบา มองเห็นเนื้อหาเว็บด้านหลังชัดเจน */
.loading-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.12) !important; /* ลดความมืดลงเหลือเพียง 12% เพื่อความเคลียร์ใส */
    backdrop-filter: blur(5px) saturate(120%) !important; /* ปรับลด Blur ให้ฉากหลังคมชัดขึ้น */
    -webkit-backdrop-filter: blur(5px) saturate(120%) !important;
    z-index: 999999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all !important;
    user-select: none;
    font-family: var(--loader-font) !important;
}

.loading-overlay.d-none {
    display: none !important;
}

/* 2. กล่องการ์ดกระจก (ทึบขึ้นชัดเจน + ขอบสะท้อนแสงทองส้มพรีเมียม) */
.loading-center-card {
    position: relative;
    /* เพิ่มความทึบของเนื้อขาวขุ่นเป็น 68% - 50% ให้ตัดกับพื้นหลังชัดเจน ไม่กลืนหาย */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.68) 0%, rgba(255, 248, 240, 0.50) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    
    /* เส้นขอบสีขาวผสมเหลือบทองส้ม สะท้อนแสงชัดเจน */
    border: 1.5px solid rgba(255, 255, 255, 0.85) !important;
    border-radius: 26px 8px 26px 8px !important;
    padding: 2rem 2.8rem !important;
    min-width: 245px;
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* มิติแสงสะท้อนทองส้มรอบกรอบ (Golden-Orange Rim Glow) + เงาลอย */
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12),
                0 0 0 1px rgba(255, 165, 0, 0.35),
                0 0 24px rgba(255, 140, 0, 0.22) !important;
    animation: loader-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes loader-pop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 3. กล่อง Spinner ควบคุมตำแหน่งไอคอน */
.loading-spinner-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* วงแหวนสีส้ม-ม่วง */
.glass-spinner {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(255, 140, 0, 0.15) !important;
    border-top: 4px solid #FF8C00 !important;
    border-right: 4px solid #4A0C46 !important;
    animation: spin-loop 0.85s cubic-bezier(0.5, 0.15, 0.5, 0.85) infinite;
}

@keyframes spin-loop {
    to { transform: rotate(360deg); }
}

/* ไอคอนตรงกลางวงแหวน */
.spinner-center-icon {
    font-size: 1.6rem !important;
    background: linear-gradient(135deg, #FF8C00 0%, #4A0C46 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% { transform: scale(0.96); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; }
}

/* 4. ปรับขนาดและน้ำหนักฟอนต์ชื่อแบรนด์ */
.text-logo-zone {
    text-align: center;
    font-family: var(--loader-font) !important;
}

.logo-main-text {
    font-family: var(--loader-font) !important;
    font-weight: 800 !important;
    font-size: 1.15rem !important;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #FF8C00 0%, #4A0C46 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    line-height: 1.2;
}

.logo-sub-text {
    font-family: var(--loader-font) !important;
    font-size: 0.72rem !important;
    color: #888888 !important;
    font-weight: 500 !important;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* 5. ข้อความสถานะด้านล่าง */
.loading-status-text {
    font-family: var(--loader-font) !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #444444 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.2px;
}

.animated-dots::after {
    content: '';
    display: inline-block;
    animation: dots-step 1.5s infinite steps(4, end);
    width: 14px;
    text-align: left;
}

@keyframes dots-step {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}



/* จัดการ Stacking Context ของ Grid และ Card ไม่ให้การ์ดถัดไปบัง Dropdown */
.ont-card-col {
    position: relative;
    z-index: 1;
}

.ont-card-col:focus-within,
.ont-card-col:has(.dropdown-menu.show),
.ont-card-col.is-active-dropdown {
    z-index: 1055 !important;
}

.ont-bind-card {
    overflow: visible !important;
    position: relative;
}

/* ล้างกรอบซ้อน 2 ชั้นของ dselect ให้เหลือกรอบเดียว สวยเนียน */
.ont-bind-card .dselect-wrapper {
    position: relative;
    width: 100%;
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.ont-bind-card .dselect-wrapper .form-select,
.ont-bind-card .dselect-wrapper button.form-select {
    width: 100% !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    padding: 0.375rem 0.75rem !important;
    background-color: #fff !important;
    box-shadow: none !important;
}

.ont-bind-card .dselect-wrapper .dropdown-menu {
    z-index: 1060 !important;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.25) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
}



/* สไตล์ Server360 Text Switch (On/Off ในราง) */
.server360-text-switch {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 26px;
  vertical-align: middle;
}
.server360-text-switch .s360-switch-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.server360-text-switch .s360-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #adb5bd; /* สีตอนปิด (Off / Inactive) */
  transition: .3s;
  border-radius: 30px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}
/* ตัวหนังสือในราง */
.server360-text-switch .s360-switch-slider:before {
  content: "OFF";
  position: absolute;
  right: 8px;
  top: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  font-family: inherit;
  line-height: 1.6;
}
/* ปุ่มกลมสีขาว */
.server360-text-switch .s360-switch-slider:after {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
/* ตอนเปิดสวิตช์ (Checked / Active) */
.server360-text-switch .s360-switch-input:checked + .s360-switch-slider {
  background-color: #50b5ff; /* สีฟ้า-ม่วง ตามธีม Server360 Primary หรือใช้ #00ca00 สำหรับ Success */
}
.server360-text-switch .s360-switch-input:checked + .s360-switch-slider:before {
  content: "ON";
  left: 9px;
  right: auto;
}
.server360-text-switch .s360-switch-input:checked + .s360-switch-slider:after {
  transform: translateX(32px);
}


              /* ปรับขนาดสวิตช์ Server360 ให้เล็กลงกะทัดรัดพอดีการ์ด (Compact Mini Switch) */
              .s360-switch-mini {
                transform: scale(0.82);
                transform-origin: left center;
                display: inline-block;
                margin-bottom: 0;
              }






/* ==========================================================================
   ✨ BRAND RESPONSIVE FONT SCALING (text-brand-1 ถึง text-brand-7)
   คำนวณการย่อ-ขยายขนาดอักษรตามสัดส่วนจออัตโนมัติ (Responsive Font Clamp)
   ========================================================================== */

/* text-brand-1 (ใหญ่ที่สุดเทียบเท่า fs-1) */
.text-brand-1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem) !important; 
    line-height: 1.2 !important; 
}

/* text-brand-2 (เทียบเท่า fs-2) */
.text-brand-2 {
    font-size: clamp(1.5rem, 4vw, 2rem) !important; 
    line-height: 1.25 !important; 
}

/* text-brand-3 (เทียบเท่า fs-3) */
.text-brand-3 {
    font-size: clamp(1.25rem, 3.5vw, 1.75rem) !important; 
    line-height: 1.3 !important; 
}

/* text-brand-4 (เทียบเท่า fs-4) */
.text-brand-4 {
    font-size: clamp(1.1rem, 3vw, 1.5rem) !important; 
    line-height: 1.35 !important; 
}

/* text-brand-5 (เทียบเท่า fs-5) */
.text-brand-5 {
    font-size: clamp(0.95rem, 2.5vw, 1.25rem) !important; 
    line-height: 1.4 !important; 
}

/* text-brand-6 (เทียบเท่า fs-6) */
.text-brand-6 {
    font-size: clamp(0.85rem, 2vw, 1rem) !important; 
    line-height: 1.4 !important; 
}

/* text-brand-7 (เล็กลงสำหรับข้อความเสริม/ความยาวจำกัด เทียบเท่า fs-7) */
.text-brand-7 {
    font-size: clamp(0.72rem, 1.8vw, 0.875rem) !important; 
    line-height: 1.4 !important; 
}

/* text-brand-8 (เล็กกว่าระดับ 7 สำหรับข้อความกำόบ/หมายเหตุย่อย) */
.text-brand-8 {
    font-size: clamp(0.65rem, 1.5vw, 0.775rem) !important; 
    line-height: 1.35 !important; 
}

/* text-brand-9 (เล็กที่สุด สำหรับป้ายกำกับพิเศษ/ตัวอักษรเงื่อนไข) */
.text-brand-9 {
    font-size: clamp(0.55rem, 1.2vw, 0.675rem) !important; 
    line-height: 1.3 !important; 
}

.transition-icon {
  transition: transform 0.2s ease-in-out;
}
.rotate-180 {
  transform: rotate(180deg);
}