@import url('https://fonts.googleapis.com/css2?family=Bai+Jamjuree:wght@300;400;500;600;700&family=Chakra+Petch:wght@300;400;600;700&family=Charm:wght@400;700&family=Kanit:wght@300;400;500;600;700&family=Mitr:wght@300;400;500;600&family=Noto+Sans+Thai:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --surface: #ffffff;
    --bg-admin: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-lg: 20px;
    --radius-md: 10px;
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   ส่วนหน้าบ้าน (Welcome Splash Page)
   ========================================================= */
.welcome-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    margin: 0;
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(circle at 50% 20%, #171b38 0%, #0c0f1d 60%, #060810 100%);
    color: #f8fafc;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* แถบ Navbar สไตล์ตามภาพต้นฉบับ (Edge-to-edge Luxury Minimalist) */
.welcome-navbar {
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    z-index: 20;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .welcome-navbar {
        padding: 1.25rem 1.5rem;
    }
}

.welcome-navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #f8fafc;
}

.welcome-navbar-logo {
    max-height: 34px;
    max-width: 120px;
    object-fit: contain;
}

.welcome-navbar-icon {
    font-size: 1.25rem;
    color: #ec4899;
    display: flex;
    align-items: center;
}

.welcome-navbar-title {
    font-weight: 500;
    font-size: 0.95rem;
    color: #f1f5f9;
    letter-spacing: -0.01em;
}

.welcome-navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ปุ่มสลับภาษา (TH / EN Pill Switcher) สไตล์ตามภาพต้นฉบับ */
.lang-switcher-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 3px;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.lang-btn {
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: transparent;
}

.lang-btn.active {
    background: #e11d48;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
}

.lang-btn:hover:not(.active) {
    color: #ffffff;
}

/* แถบ Footer สไตล์ตามภาพต้นฉบับ (Edge-to-edge Minimalist with Border-Top) */
.welcome-footer {
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    z-index: 20;
    font-size: 0.82rem;
    color: #64748b;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .welcome-footer {
        padding: 1.25rem 1.5rem;
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

.welcome-footer-copyright {
    color: #64748b;
    font-size: 0.82rem;
}

.welcome-footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.welcome-footer-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s ease;
}

.welcome-footer-link:hover {
    color: #cbd5e1;
}

/* ข้อความนับเวลาถอยหลังแบบฝังใต้ปุ่ม (Countdown under Button) */
.countdown-inline-text {
    margin-top: 0.85rem;
    font-size: 0.84rem;
    color: #94a3b8;
    opacity: 0.85;
}

/* สไตล์ Container กลาง */
.welcome-container {
    width: 100%;
    max-width: 1200px;
    padding: 1rem 1.5rem;
    margin: auto;
    text-align: center;
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* เลเยอร์รูปภาพพื้นหลัง พร้อมปรับความเข้ม/โปร่งใส */
.welcome-bg-image-layer {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Canvas สำหรับเอฟเฟกต์อนุภาค (หิมะ, ประกายดาว, ซากุระ) */
#particleCanvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 3;
}

.welcome-body.size-full {
    padding: 0;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

/* Container ขนาดต่างๆ */
.welcome-container {
    width: 100%;
    text-align: center;
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.welcome-container.size-standard {
    max-width: 960px;
}

.welcome-container.size-large {
    max-width: 1280px;
}

.welcome-container.size-full {
    max-width: 100vw;
    height: 100vh;
    justify-content: center;
    position: relative;
}

/* กล่องสไลด์โชว์ Banner */
.welcome-slider {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 2rem;
}

.size-standard .welcome-slider {
    height: clamp(320px, 46vw, 540px);
}

.size-large .welcome-slider {
    height: clamp(380px, 58vw, 700px);
}

.size-full .welcome-slider {
    position: absolute;
    inset: 0;
    height: 100vh;
    width: 100vw;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
}

/* สไลด์แต่ละภาพ */
.slide-track {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slide-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

/* =========================================================
   เอฟเฟกต์การแสดงผล (Slide Effects)
   ========================================================= */
.effect-fade .slide-item {
    transition: opacity 0.9s ease-in-out;
}
.effect-fade .slide-item.active {
    opacity: 1;
}

.effect-slide .slide-item {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.75s ease;
}
.effect-slide .slide-item.active {
    transform: translateX(0);
    opacity: 1;
}
.effect-slide .slide-item.prev {
    transform: translateX(-100%);
    opacity: 0;
}

.effect-zoom .slide-item {
    transition: opacity 1s ease-in-out;
}
.effect-zoom .slide-item img {
    transform: scale(1.18);
    transition: transform 6s cubic-bezier(0.25, 1, 0.5, 1);
}
.effect-zoom .slide-item.active {
    opacity: 1;
}
.effect-zoom .slide-item.active img {
    transform: scale(1);
}

.effect-blur .slide-item {
    filter: blur(12px);
    transition: filter 0.8s ease, opacity 0.8s ease;
}
.effect-blur .slide-item.active {
    opacity: 1;
    filter: blur(0);
}

/* ปุ่มควบคุมสไลด์ Next / Prev */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    font-size: 1.25rem;
}

.slider-btn:hover {
    background: rgba(15, 23, 42, 0.9);
    transform: translateY(-50%) scale(1.08);
}

.slider-btn.prev {
    left: 18px;
}

.slider-btn.next {
    right: 18px;
}

/* จุดบ่งชี้ Dots */
.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 6px 14px;
    border-radius: 999px;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.slider-dot.active {
    background: #ffffff;
    width: 28px;
    border-radius: 10px;
}

/* โอเวอร์เลย์เมื่อแสดงผลแบบ Fullscreen */
.size-full .welcome-content-overlay {
    position: relative;
    z-index: 10;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2.5rem 3rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    max-width: 840px;
    margin: 1.5rem;
}

/* ส่วนข้อความ */
.welcome-text-group {
    margin-bottom: 1.5rem;
}

.welcome-title {
    font-size: clamp(1.8rem, 3.8vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.welcome-subtitle {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    white-space: pre-line;
}

.welcome-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    z-index: 10;
}

/* ปุ่มหลักเข้าสู่เว็บไซต์ */
.btn-enter-site {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.95rem 2.8rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    border-radius: 9999px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
}

.btn-enter-site:hover {
    transform: translateY(-3px) scale(1.02);
    filter: brightness(1.12);
    box-shadow: 0 18px 36px -5px rgba(0, 0, 0, 0.5);
}

/* ปุ่มรอง (Secondary Action Button) */
.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.95rem 2rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    border-radius: 9999px;
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.btn-secondary-action:hover {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

/* แถบนับถอยหลัง & ปุ่มข้าม (Countdown Bar & Skip) */
.countdown-floating-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 50;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
    font-size: 0.88rem;
    color: #f8fafc;
}

.countdown-seconds-badge {
    background: #3b82f6;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.84rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-skip-link {
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 0.75rem;
}

.btn-skip-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ปุ่มเปิด-ปิดเสียงเพลง (Audio Floating Button) */
.audio-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.audio-toggle-btn:hover {
    transform: scale(1.08);
    background: rgba(30, 41, 59, 0.95);
}

.audio-toggle-btn.playing {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* กล่องตัวเลือก "ไม่ต้องแสดงอีกใน 24 ชั่วโมง" */
.dont-show-again-wrapper {
    margin-top: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    opacity: 0.85;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    user-select: none;
    transition: opacity 0.2s;
}

.dont-show-again-wrapper:hover {
    opacity: 1;
}

.preview-ribbon {
    position: fixed;
    top: 76px;
    right: 20px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    color: #fbbf24;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(251, 191, 36, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.preview-ribbon a {
    color: #ffffff;
    text-decoration: underline;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   ส่วนหลังบ้าน (Admin Panel, Analytics & Drag-and-Drop)
   ========================================================= */
.admin-body {
    background-color: var(--bg-admin);
    color: var(--text-main);
    min-height: 100vh;
}

.admin-navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 30;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
    text-decoration: none;
}

.admin-brand i {
    color: var(--primary);
    font-size: 1.35rem;
}

.admin-brand-badge {
    background: #dbeafe;
    color: var(--primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

.admin-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-container {
    max-width: 1360px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* การ์ดสถิติผู้เข้าชม (Analytics Summary Cards) */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 15px -3px rgba(15, 23, 42, 0.05);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.views {
    background: #eff6ff;
    color: #2563eb;
}

.stat-icon.clicks {
    background: #ecfdf5;
    color: #059669;
}

.stat-icon.ctr {
    background: #faf5ff;
    color: #9333ea;
}

.stat-info .stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-info .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    margin-top: 0.15rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    align-items: start;
}

/* ยุบคอลัมน์เฉพาะบนจอมือถือเล็กมาก (< 640px) เพื่อให้จอที่แบ่งครึ่งหรือเปิด DevTools ยังคงเห็นตัวอย่างสดเคียงข้างกัน */
@media (max-width: 640px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* ปุ่มลอยบันทึกด่วนและดูตัวอย่าง (Admin Floating Bar) */
.admin-floating-bar {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.75);
    padding: 0.45rem 0.6rem;
    border-radius: 50px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInFloating 0.3s ease-out;
}

@keyframes fadeInFloating {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title i {
    color: var(--primary);
    font-size: 1.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    font-size: 0.92rem;
    margin-bottom: 0.45rem;
    color: #334155;
}

.form-hint {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.68rem 0.9rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-range-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
}

.form-range {
    flex: 1;
    cursor: pointer;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    accent-color: var(--primary);
}

.range-badge {
    font-family: monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    background: #dbeafe;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    min-width: 52px;
    text-align: center;
}

textarea.form-control {
    min-height: 95px;
    resize: vertical;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 0.35rem 0.65rem;
    background: #ffffff;
}

.color-picker-input {
    width: 36px;
    height: 36px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
}

.color-hex-text {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-main);
    border: none;
    width: 100%;
    outline: none;
}

/* Toggle Switch Box */
.toggle-switch-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.25s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--success);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* รายการสไลด์ปัจจุบันใน Admin (Drag-and-Drop Slide Gallery) */
.slide-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}

.slide-gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-color);
    aspect-ratio: 16 / 9;
    background: #0f172a;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    user-select: none;
}

.slide-gallery-item:active {
    cursor: grabbing;
}

.slide-gallery-item.dragging {
    opacity: 0.4;
    border-color: var(--primary);
    transform: scale(0.96);
}

.slide-gallery-item.drag-over {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.slide-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.slide-gallery-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.72rem;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 600;
}

.slide-drag-handle {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.68rem 1.3rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-danger-outline {
    background: #ffffff;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.btn-danger-outline:hover {
    background: #fef2f2;
}

/* Alert Messages */
.alert {
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Live Preview Card in Admin */
.live-preview-box {
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.live-preview-bg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.live-preview-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pill.active {
    background: #d1fae5;
    color: #065f46;
}

.status-pill.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Login Box */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    box-shadow: var(--shadow-xl);
}
