/*  6. File Name :\mu-plugins\njoy\assets\style.css   */
/* ============================================================
   1. CORE EASY APPOINTMENTS (Dependencies)
   ============================================================ */
/* EA Core Info Styling */
#ea-class-info { margin-top: 10px; }
#ea-class-info h3 { margin-bottom: 10px; }
#ea-class-info strong { color: #333; }
#ea-class-info ul { margin: 0; padding-left: 18px; }
#ea-class-info ul li {
    background: #e8f5e9;
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    border-left: 4px solid #4caf50;
    font-size: 14px;
}
#ea-class-info .time { font-size: 20px; font-weight: 600; color: #0d47a1; }

/* Slot Style */
.slot-full { background: #ccc !important; cursor: not-allowed; }

/* EA Time Slots Grid */
.ea-bootstrap .time {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    align-items: center;
}
.ea-bootstrap .time a[data-val] {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 80px !important;
    height: 40px;
    text-align: center !important;
    padding: 0 !important;
    white-space: nowrap !important;
    border-radius: 6px;
}
.ea-bootstrap .time a[data-val] span { display: inline !important; }

/* ============================================================
   2. HIDE & CUSTOMIZE BOOKING FLOW (Suppression)
   ============================================================ */
/* Suppress personal info & specific headers unless in debug mode */
body:not(.njoy-debug) .ea-bootstrap .step.final .form-group:has(input),
body:not(.njoy-debug) .ea-bootstrap .step.final .form-group:has(textarea),
body:not(.njoy-debug) .ea-bootstrap .step.final h3:first-of-type,
body:not(.njoy-debug) .ea-bootstrap .step.final small,
.ea-bootstrap .step.final table,
.ea-bootstrap .step.final #booking-overview-header {
    display: none !important;
}

/* ============================================================
   3. GLOBAL BUTTONS & ACTIONS (Fixed Alignment & Width)
   ============================================================ */
/* Global Action Group Layout */
.ea-actions-group {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px;
    margin-top: 20px;       /* เพิ่มระยะห่างจากส่วนบนให้ดูสบายตาขึ้น */
    margin-left: 0 !important; /* 💥 FIX: ปรับเป็น 0 เพื่อให้ตรงแนวเดียวกับปฏิทินและ Slot Info เป๊ะๆ */
    padding-left: 0 !important;
}

/* Action Buttons Base & Equal Width Constraint */
.ea-actions-group button, 
.ea-actions-group .ea-submit,
.ea-actions-group .ea-cancel,
#njoy-cancel-booking,
#njoy-walkin-booking {
    height: 40px !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center !important; /* จัดตัวหนังสือให้อยู่ตรงกลางปุ่ม */
    font-size: 14px;
    border-radius: 6px;
    box-sizing: border-box !important;
}

/* 💥 บังคับให้ 3 ปุ่มหลักมีความกว้างเท่ากัน 100% ในแนวระนาบเดียวกัน */
.ea-actions-group .ea-submit,
.ea-actions-group .ea-cancel,
#njoy-walkin-booking {
    width: 150px !important; /* ปรับเพิ่มเป็น 150px เพื่อรองรับข้อความ "Back to Home" ไม่ให้แตกแถว */
    min-width: 150px !important; /* 💥 FIX: บังคับ min-width กันปลั๊กอินเดิมแอบเขียนทับ */
    max-width: 150px !important;
}

/* LINE Button Style */
#btn-line { 
    background-color: #06C755 !important; 
    color: #fff !important; 
    border: none !important; 
    font-weight: 600; 
}
#btn-line:hover { 
    background-color: #05b24c !important; 
}

/* Button Rows for Booking Form */
#njoy-row-top, 
#njoy-row-bottom,
#njoy-row-walkin { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    width: 100%;
}
#njoy-msg { 
    color: red; 
    margin-left: 5px; 
}

/* Walk-In Visibility Control */
#njoy-walkin-booking.njoy-walkin-hidden {
    display: none !important;
}

/* สไตล์เสริมสำหรับปุ่ม Cancel Booking (สีแดง) */
#njoy-cancel-booking {
    min-width: 130px; 
}

/* ============================================================
   4. USER BAR & ACCESS CONTROL
   ============================================================ */
#njoy-username { display: block !important; visibility: visible !important; font-size: 18px; }
#njoy-username a { color: #1e293b; font-weight: 600; text-decoration: none; }
#njoy-username a:hover { color: #0f172a; }

/* Menu Visibility Logic */
body:not(.logged-in) .show-user, 
body.logged-in .show-guest { display: none !important; }
.show-all { display: inline-block !important; }

/* Nav Spacing (Elementor) */
.elementor-nav-menu--layout-horizontal .elementor-item { padding: 0 6px !important; }
.elementor-nav-menu--layout-horizontal { gap: 4px !important; }

/* ============================================================
   5. PROFILE & BOOKING CARD (Simplified v3)
   ============================================================ */
.njoy-profile { max-width: 600px; margin: auto; }
.njoy-profile h3 { margin: 16px 0 8px; font-size: 16px; }

/* Final Booking Card Structure */
.njoy-booking-item {
    display: flex;
    align-items: center;
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 12px;
    margin-bottom: 12px;
    background: #fff;
    transition: 0.2s;
}
.njoy-booking-item:hover { background: #fafafa; }
.njoy-booking-item.active { border: 1px solid #e91e63; background: #fff5f8; }

/* Highlight first item */
.njoy-booking-item:first-child { background: linear-gradient(135deg, #ffe4ec, #fff); border: 1px solid #f8cdd8; }

/* Booking Card Content */
.booking-main { display: flex; align-items: center; gap: 20px; }
.booking-info { line-height: 1.4; }
.booking-time { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.booking-meta { font-size: 13px; color: #666; }

/* ============================================================
   6. STATUS & CREDITS UI
   ============================================================ */
/* Status Badges */
.booking-status {
    margin-left: auto;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    color: #fff;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
    white-space: nowrap;
}

/* Status Colors */
.status.pending { background: #4caf50; }
.status.confirmed { background: #e91e63; }
.status.completed { background: #2196f3; }
.status.cancelled { background: #9e9e9e; }

/* Credit Indicators */
.amount-positive { color: #2e7d32; font-weight: 600; }
.amount-negative { color: #c62828; font-weight: 600; }

.njoy-credits {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px;
    border: 1px solid #f3c3d3;
    border-radius: 12px;
    background: #fff;
}

/* ============================================================
   7. TABS UI
   ============================================================ */
.njoy-tabs { display: flex; gap: 6px; margin: 12px 0; }
.njoy-tabs button {
    flex: 1; padding: 8px; border: none; border-radius: 8px;
    background: #f1f1f1; color: #666; font-weight: 500; cursor: pointer;
}
.njoy-tabs button.active { background: #e91e63; color: #ffffff; }
.njoy-tabs button:not(.active):hover { background: #f8dbe6; }

.njoy-tab-content { display: none; }
.njoy-tab-content.active { display: block; }

/* ============================================================
   8. MODALS & OVERLAYS (Professional Version)
   ============================================================ */
/* พื้นหลังมืดด้านหลัง */
.login-overlay {
    position: fixed; inset: 0; 
    background: rgba(15, 23, 42, 0.7); /* สีน้ำเงินเข้มโปร่งแสง */
    backdrop-filter: blur(4px); /* เพิ่มความเบลอให้ดูพรีเมียม */
    display: flex; align-items: center; justify-content: center; 
    z-index: 99999;
}

.login-overlay.hidden { display: none; }

/* ตัวกล่อง Modal */
.login-modal {
    background: #fff; 
    padding: 32px 24px; 
    border-radius: 20px; 
    width: 90%; /* ยืดหยุ่นตามมือถือ */
    max-width: 380px; 
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
    position: relative;
    border: 1px solid #f1f5f9;
}

/* ปุ่มปิด (X) */
.close-btn {
    position: absolute; right: 16px; top: 12px; 
    font-size: 22px; color: #94a3b8; cursor: pointer;
    line-height: 1; padding: 5px;
}
.close-btn:hover { color: #64748b; }

/* หัวข้อ Login */
.login-modal h2 {
    margin: 0 0 24px 0; font-size: 24px; font-weight: 700;
    color: #1e293b; text-align: center;
}

/* ปรับแต่ง Input Field */
.login-modal input {
    width: 100% !important; 
    box-sizing: border-box;
    margin-bottom: 16px; 
    padding: 12px 16px !important;
    border-radius: 12px; 
    border: 1px solid #e2e8f0;
    font-size: 16px;
    background: #f8fafc;
    transition: 0.2s;
}
.login-modal input:focus {
    border-color: #e91e63;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

/* เส้นแบ่ง "or" */
.login-modal .separator {
    text-align: center; margin: 12px 0; color: #94a3b8;
    position: relative; font-size: 14px;
}
/* (เลือกใส่เพิ่มถ้ามี Tag <div class="separator">or</div>) */

/* ปรับแต่งปุ่มทั้งหมดใน Modal */
.login-modal button, 
.login-modal .btn-login, 
.login-modal .btn-line, 
.login-modal .btn-create {
    width: 100% !important; 
    height: 48px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; transition: 0.2s;
    margin-bottom: 12px;
}

/* ปุ่ม Login ปกติ */
.login-modal .btn-login {
    background: #1e293b; color: #fff;
}
.login-modal .btn-login:hover { background: #0f172a; }

/* ปุ่ม LINE Login (สไตล์ข้อ 3) */
#btn-line {
    background: #06C755 !important; color: #fff !important;
    margin-top: 5px;
}

/* ปุ่ม Create Account */
.login-modal .btn-create {
    background: #f1f5f9; color: #475569;
    margin-top: 4px;
}
.login-modal .btn-create:hover { background: #e2e8f0; }

/* ปรับปรุงหน้าจอมือถือ */
@media (max-width: 480px) {
    .login-modal { padding: 28px 20px; }
    .login-modal h2 { font-size: 20px; }
}


/* ============================================================
   9. PACKAGE CARDS & RESET
   ============================================================ */
.njoy-ui-reset, .njoy-ui-reset * { box-sizing: border-box; }
.njoy-ui-reset h3, .njoy-ui-reset p { margin: 0; padding: 0; line-height: 1.3; }

.njoy-packages-wrap { margin: 30px 0; }
.njoy-packages-desktop { display: flex; gap: 24px; justify-content: center; align-items: stretch; }

.njoy-package-card {
    background: white; border-radius: 20px; padding: 28px; width: 280px;
    text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    border: 1px solid #f4d7e4; position: relative; transition: 0.3s;
}
.njoy-package-card:hover { transform: translateY(-8px); }
.njoy-package-card h3 { font-size: 24px; }
.njoy-package-card .price { font-size: 34px; font-weight: 700; color: #e91e63; margin: 16px 0; }
.njoy-package-card a {
    display: inline-block; padding: 12px 24px; border-radius: 999px;
    background: #e91e63; color: white; text-decoration: none; font-weight: 600;
}
.njoy-package-card.featured { transform: scale(1.05); border: 2px solid #e91e63; }

/* ============================================================
   10. RESPONSIVE & MOBILE
   ============================================================ */

/* --- สำหรับหน้าจอ Desktop (ใหญ่กว่า 768px) --- */
@media (min-width: 769px) {
    /* ซ่อนเวอร์ชัน Mobile Pills เสมอเมื่ออยู่บนจอคอม */
    .njoy-packages-mobile { 
        display: none !important; 
    }
}

/* --- สำหรับหน้าจอ Mobile (เล็กกว่าหรือเท่ากับ 768px) --- */
@media (max-width: 768px) {
    /* ซ่อนเวอร์ชัน Desktop Cards ทันทีเมื่ออยู่บนมือถือ */
    .njoy-packages-desktop { 
        display: none !important; 
    }

    /* แสดงเวอร์ชัน Mobile Pills */
    .njoy-packages-mobile { 
        display: flex !important; 
        flex-direction: column; 
        gap: 12px; 
    }

    .njoy-pill {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 16px 20px;
        background: #fff;
        border: 1px solid #f3d7df;
        border-radius: 18px;
        text-decoration: none !important;
        color: #14213d !important;
        font-weight: 700;
        font-size: 22px;
        box-shadow: 0 6px 18px rgba(0,0,0,0.05);
    }
/*    .njoy-pill.featured {
        background: linear-gradient(135deg, #ec167f, #ff2d92);
        color: #fff !important;
    } */
    .njoy-pill.featured {
        border: 3px solid #ec167f;
        background: linear-gradient(135deg, #fff7fb, #ffeef7);
        color: #ec167f !important;
    }


    /* ปรับแต่งสไตล์ Loading สำหรับ Mobile */
    #njoy-loading-overlay { background: rgba(0,0,0,0.18); }
    .njoy-spinner { width: 22px; height: 22px; border-width: 2.5px; }
}

/* --- สำหรับหน้าจอเล็กพิเศษ (Small Mobile) --- */
@media (max-width: 480px) {
    .njoy-booking-item { padding: 12px; }
    .booking-time { font-size: 15px; }
    .booking-main { gap: 10px; }
}

/* =========================================
   FLOATING HELP BUTTON
========================================= */
.njoy-floating-help {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #2563eb;
    color: #ffffff !important;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow:
        0 10px 24px rgba(0,0,0,0.15);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.njoy-floating-help:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 28px rgba(0,0,0,0.18);
}
.njoy-floating-help .help-icon {
    font-size: 16px;
    line-height: 1;
}
@media (max-width: 768px) {
    .njoy-floating-help {
        right: 16px;
        bottom: 16px;
        padding: 12px;
        border-radius: 50%;
    }
    .njoy-floating-help .help-label {
        display: none;
    }
}

/* =========================================
   NJOY PACKAGE CARDS - PROFESSIONAL
========================================= */
.njoy-packages-wrap {
    margin: 40px 0;
}

.njoy-packages-desktop {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 24px;
}

.njoy-package-card {
    position: relative;
    background: #fff;
    border: 1px solid #f3d7df;
    border-radius: 24px;
    padding: 36px 28px 32px;
    text-align: center;
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow:
        0 8px 24px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}

.njoy-package-desc {
    margin: 18px 0 28px !important;
    padding: 12px 16px !important;

    font-size: 15px !important;
    line-height: 1.5 !important;
    font-weight: 600 !important;

    color: #4a5568 !important;
    text-align: center !important;

    background: #fff7fb;
    border: 1px solid #f8d6e7;
    border-radius: 14px;

    min-height: 58px;

    display: flex !important;
    align-items: center;
    justify-content: center;

    box-sizing: border-box;
}

.njoy-package-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 18px 40px rgba(0,0,0,0.10);
}
/* FEATURED */
.njoy-package-card.featured {
    border: 2px solid #ec167f;
    transform: scale(1.03);
    box-shadow:
        0 16px 36px rgba(236,22,127,0.14);
}
.njoy-package-card.featured:hover {
    transform: scale(1.03) translateY(-6px);
}
/* BADGE */
.njoy-package-card .badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ec167f, #ff4ca5);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 999px;
    box-shadow:
        0 6px 16px rgba(236,22,127,0.35);
    white-space: nowrap;
}
/* TITLE */
.njoy-package-card h3 {
    margin: 10px 0 20px;
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
    color: #14213d;
}
.njoy-package-card h3 span {
    display: block;
    font-size: 18px;
    font-weight: 600;
    margin-top: 6px;
}
/* PRICE */
.njoy-package-card .price {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    line-height: 1;
    color: #ec167f;
    margin-bottom: 22px;
    white-space: nowrap;
}
.njoy-package-card .woocommerce-Price-currencySymbol {
    font-size: 0.55em;
    vertical-align: top;
}

.njoy-package-card .price .woocommerce-Price-currencySymbol {
    font-size: 28px;
    vertical-align: top;
}
/* DESCRIPTION */
.njoy-package-card p {
    font-size: 16px;
    line-height: 1.5;
    color: #5f6b7a;
    margin: 0 0 28px;
    min-height: 48px;
}
/* BUTTON */
.njoy-package-card a {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ec167f, #ff2d92);
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    padding: 14px 28px;
    border-radius: 999px;
    min-width: 150px;
    transition: all 0.2s ease;
    box-shadow:
        0 10px 22px rgba(236,22,127,0.22);
}
.njoy-package-card a:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 28px rgba(236,22,127,0.32);
}
/* MOBILE PILLS */
.njoy-packages-mobile {
    display: none;
}
/* TABLET */
@media (max-width: 1024px) {
    .njoy-packages-desktop {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* MOBILE */
@media (max-width: 768px) {
    .njoy-packages-desktop {
        display: none;
    }
    .njoy-packages-mobile {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .njoy-pill {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        background: #fff;
        border: 1px solid #f3d7df;
        border-radius: 16px;
        text-decoration: none;
        color: #14213d;
        font-weight: 700;
        box-shadow:
            0 6px 18px rgba(0,0,0,0.05);
    }
    .njoy-pill.featured {
        border: 2px solid #ec167f;
        background: #fff8fc;
    }
}
.njoy-pay-btn:hover{
    transform:translateY(-2px);
}
/* =========================
 * BUTTON ROW
 * ========================= */
.njoy-btn-row{
    display:flex;
    gap:12px;
}

.njoy-btn-row > *{
    flex:1;
}

/* =========================
 * DOWNLOAD BUTTON
 * ========================= */
.njoy-download-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:18px;
    border-radius:18px;
    background:linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );
    color:#fff !important;
    text-decoration:none !important;
    font-size:18px;
    font-weight:700;
    box-shadow:
        0 10px 24px rgba(
            37,
            99,
            235,
            .25
        );
}

.njoy-download-btn:hover{
    color:#fff !important;
    text-decoration:none !important;
    transform:translateY(-2px);
}

/* inline form */
.njoy-pay-form-inline{
    margin:0;
}

.njoy-pay-form-inline .njoy-pay-btn{
    width:100%;
    height:100%;
}
@media (max-width:768px){

    .njoy-btn-row{
        flex-direction:column;
    }
    .njoy-btn-row > *{
        width:100%;
    }
    .njoy-download-btn{
        width:100%;
    }
    .njoy-pay-form-inline{
        width:100%;
    }

}
/* =========================
 * BACK HOME
 * ========================= */
.njoy-back-row{
    margin-top:14px;
}
.njoy-back-btn{
    display:block;
    width:100%;
    text-align:center;
    padding:16px;
    border-radius:18px;
    background:#22c55e;
    color:#fff !important;
    text-decoration:none !important;
    font-size:16px;
    font-weight:700;
}
.njoy-back-btn:hover{
    color:#fff !important;
    text-decoration:none !important;
}

/* จัดโครงสร้าง wrapper ของแต่ละฟิลด์ให้เป็น relative */
.njoy-form-group {
  position: relative;
  margin-bottom: 12px;
  width: 100%;
}

/* ปรับให้อินพุตขยายเต็มพื้นที่ตามปกติ */
.njoy-form-group input {
  width: 100%;
  padding-right: 25px; /* เว้นช่องไฟด้านขวาไม่ให้ตัวหนังสือที่พิมพ์ไปทับกับดอกจัน */
  box-sizing: border-box;
}

/* ดึงดอกจันให้ลอยไปอยู่ด้านขวาในแถวเดียวกับช่องอินพุต */
.njoy-form-group .required-asterisk {
  position: absolute;
  right: -15px;      /* ดันออกไปทางขวาของช่องอินพุต (ปรับระยะได้ตามชอบ) */
  top: 50%;
  transform: translateY(-50%); /* จัดให้กึ่งกลางแนวตั้งพอดี */
  color: #e74c3c;    /* สีแดง */
  font-weight: bold;
  font-size: 16px;
}
/* OVERLAY */
/* ============================================================
   🔥 [AMENDED MASTER CONTROL] FORCE GLOBAL LOADING VISIBILITY
   ============================================================ */
/* 🌟 เมื่อมีการเพิ่มคลาสให้กับ body บังคับให้ฉากมืดเด้งขึ้นมาโชว์ทันที */


#njoy-loading-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100vh !important;
    background: rgba(15, 23, 42, 0.8) !important; /* ฉากมืดน้ำเงินเข้ม */
    backdrop-filter: blur(4px) !important;
    display: none !important; /* ซ่อนไว้ก่อนในเวลาปกติ */
    align-items: center !important; justify-content: center !important;
    z-index: 999999999 !important; /* บังคับอยู่เหนือเลเยอร์เมนูทุกตัวบนโลกเว็บไซต์ */
}
body.njoy-loading-active #njoy-loading-overlay {
    display: flex !important; /* เด้งขึ้นมาทันทีเมื่อร่างกายแอปติดคลาส active */
}
body.njoy-loading-active {
    overflow: hidden !important;
    pointer-events: none !important; /* 🔥 หัวใจสำคัญ: ล็อกตายหน้าจอ ห้ามลูกค้ากดย้ำรัว ๆ เด็ดขาด */
}

.njoy-spinner {
    width: 55px !important;
    height: 55px !important;
    border: 5px solid #f1f5f9 !important;
    border-top: 5px solid #ec167f !important; /* หัวหมุนสีชมพู NJOY */
    border-radius: 50% !important;
    animation: njoyMasterSpinEffect 1s linear infinite !important;
}
@keyframes njoyMasterSpinEffect {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
