/* pac-loader.css — หน้าโหลด "รอซักครู่" กลางของ Site-PAC (ต้นแบบ: Desktop/Loading_PAC)
   ใช้คู่กับ assets/js/pac-loader.js (สคริปต์สร้างกล่องหน้าโหลดให้เอง ไม่ต้องวาง <div> ใน HTML)
   ชื่อคลาส/แอนิเมชันขึ้นต้นด้วย pacl- ทั้งหมด กันตีกับสไตล์ของแต่ละหน้า */

/* ฟอนต์ของหน้าโหลดเอง (ชื่อแยก ไม่ไปทับฟอนต์ของหน้าที่ใช้) */
@font-face{font-family:'PACL Plex Thai';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/plexthai-600-thai.woff2) format('woff2');unicode-range:U+02D7,U+0303,U+0331,U+0E01-0E5B,U+200C-200D,U+25CC}
@font-face{font-family:'PACL Plex Thai';font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/plexthai-600-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

#pac-loading,
#pac-loading * {
    box-sizing: border-box;
    margin: 0;
}

#pac-loading {
    background: radial-gradient(circle at center, #12304A 0%, #0F1B2D 100%);
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'PACL Plex Thai', 'IBM Plex Sans Thai', system-ui, sans-serif;
    overflow: hidden;
    z-index: 2147483000;
    color: white;
    transition: opacity 0.5s ease;
}

#pac-loading.pacl-done {
    opacity: 0;
    pointer-events: none;
}

/* ล็อกไม่ให้หน้าเลื่อนระหว่างโหลด */
html.pacl-lock,
html.pacl-lock body {
    overflow: hidden;
}

/* การ์ดกระจก */
.pacl-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px;
    position: relative;
    z-index: 1;
    padding: 60px 80px;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* โลโก้ + วงแหวน */
.pacl-logo-box {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: pacl-float 4s ease-in-out infinite;
}

.pacl-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, transparent 60%, rgba(45, 180, 170, 0.9) 100%);
    animation: pacl-spin 1.5s linear infinite;
    filter: drop-shadow(0 0 20px rgba(45, 180, 170, 0.6));
}

.pacl-ring::before {
    content: '';
    position: absolute;
    inset: 4px;
    background: #141c2f;
    border-radius: 50%;
}

.pacl-logo {
    position: relative;
    width: 90px;
    height: auto;
    z-index: 10;
    animation: pacl-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

/* ตัวอักษรเป็นคลื่น */
.pacl-text {
    display: flex;
    gap: 6px;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 5px;
    color: rgba(255, 255, 255, 0.4);
}

.pacl-text span {
    display: inline-block;
    animation: pacl-wave 1.5s ease-in-out infinite;
}

/* แถบวิ่ง */
.pacl-bar-box {
    width: 220px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.pacl-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    background: linear-gradient(90deg, #2DB4AA, #0B5D5D);
    border-radius: 10px;
    animation: pacl-progress 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 15px rgba(45, 180, 170, 0.8);
}

/* แสงลอยด้านหลัง */
#pac-loading::before,
#pac-loading::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 180, 170, 0.08) 0%, transparent 70%);
    z-index: 0;
    animation: pacl-drift 15s ease-in-out infinite alternate;
}

#pac-loading::before {
    top: -150px;
    left: -150px;
}

#pac-loading::after {
    bottom: -150px;
    right: -150px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 70%);
    animation-direction: alternate-reverse;
}

/* จอมือถือ: การ์ดแคบลงไม่ล้นจอ */
@media (max-width: 420px) {
    .pacl-card {
        padding: 48px 40px;
    }
}

@keyframes pacl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pacl-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.4)); }
}

@keyframes pacl-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes pacl-wave {
    0%, 100% { transform: translateY(0); color: rgba(255, 255, 255, 0.3); }
    50% { transform: translateY(-8px); color: #fff; text-shadow: 0 0 12px rgba(255, 255, 255, 0.6); }
}

@keyframes pacl-progress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

@keyframes pacl-drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(80px, 80px) scale(1.2); }
}
