/* =====================================================================
   WARZ SIAM - assets/css/scrollbar.css
   สไตล์ Scrollbar แบบ Tactical Grunge ให้เข้ากับธีมสีแดง-ดำของเว็บ
   โทนหลัก: SOLID BLACK (ดำสนิท) - แถบเลื่อนสีดำล้วน ไม่มีไล่สี
   ใช้ร่วมกับทุกหน้า (โหลดจาก components/head.php)
   ===================================================================== */

/* ---------------------------------------------------------------------
   1) พื้นฐาน: การเลื่อนแบบนุ่มนวล
   - body เป็นตัวเลื่อนจริงของหน้า (เพราะ body มี overflow-x-hidden)
     จึงต้องกำหนด scroll-behavior ทั้ง html และ body
   --------------------------------------------------------------------- */
html {
    scroll-behavior: smooth;
    /* เว้นพื้นที่ให้ส่วนที่ถูก anchor อยู่ใต้ navbar (sticky) */
    scroll-padding-top: 88px;
}

body {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
    html,
    body {
        scroll-behavior: auto;
    }
}

/* ---------------------------------------------------------------------
   2) Firefox (standards-based scrollbar)
   --------------------------------------------------------------------- */
html {
    scrollbar-width: thin;
    scrollbar-color: #000000 #000000;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #000000 #000000;
}

/* ---------------------------------------------------------------------
   3) WebKit / Chromium (::-webkit-scrollbar)
   --------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

::-webkit-scrollbar-track {
    background-color: #000000;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

/* แถบเลื่อนหลัก - ดำสนิท (ไม่มีไล่สี) */
::-webkit-scrollbar-thumb {
    background-color: #000000;
    border-radius: 2px;
    border: 2px solid #000000;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

::-webkit-scrollbar-thumb:hover {
    background-color: #000000;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 0 10px rgba(0, 0, 0, 0.9);
}

::-webkit-scrollbar-thumb:active {
    background-color: #000000;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.48),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 0 14px rgba(0, 0, 0, 1);
}

/* ปุ่มลูกศรบน/ล่างของ scrollbar */
::-webkit-scrollbar-button:single-button {
    background-color: #000000;
    background-image: linear-gradient(180deg, #141414 0%, #000000 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: 16px;
    width: 11px;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image:
        linear-gradient(45deg, transparent 50%, #9a9a9a 50%),
        linear-gradient(135deg, #9a9a9a 50%, transparent 50%);
    background-position: center 6px;
    background-size: 5px 5px;
}

::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image:
        linear-gradient(45deg, #9a9a9a 50%, transparent 50%),
        linear-gradient(135deg, transparent 50%, #9a9a9a 50%);
    background-position: center 6px;
    background-size: 5px 5px;
}

::-webkit-scrollbar-button:single-button:hover {
    background-color: #000000;
    background-image: linear-gradient(180deg, #1e1e1e 0%, #000000 100%);
    filter: brightness(1.4);
}

/* มุมระหว่างแถบเลื่อนแนวตั้งกับแนวนอน */
::-webkit-scrollbar-corner {
    background-color: #000000;
}

/* ---------------------------------------------------------------------
   4) กล่องเลื่อนภายใน (เช่น modal, dropdown, textarea)
   --------------------------------------------------------------------- */
*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

*::-webkit-scrollbar-track {
    background-color: #000000;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

*::-webkit-scrollbar-thumb {
    background-color: #000000;
    border-radius: 2px;
    border: 1px solid #000000;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

*::-webkit-scrollbar-thumb:hover {
    background-color: #000000;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 0 8px rgba(0, 0, 0, 0.9);
}
