/* ==========================================================================
   book.css - 案内THAI 予約フォーム専用スタイルシート (完全一新版)
   ========================================================================== */

/* --- 1. โครงสร้างหลักและการจัดกึ่งกลางหน้าจอ (Layout & Centering) --- */
.content-body {
    width: 100%;
    min-height: 80vh;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start;
    padding: 20px 10px 60px 10px;
    background-color: #f4f7f9;
    box-sizing: border-box;
}

/* แถบ Breadcrumbs */
.breadcrumbs-bar { 
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
    padding: 10px 15px; 
    background-color: #89e8d7; 
    font-size: 13px; 
    border-radius: 6px;
    box-sizing: border-box;
}
.breadcrumbs-bar a { 
    color: #0B3C5D;
    font-weight: bold;
    text-decoration: none;
}
.breadcrumbs-bar span { 
    color: #777; 
    margin: 0 8px; 
}

/* กล่องระบบจองหลัก (คุมให้อยู่กึ่งกลางจอคอมพิวเตอร์พอดี) */
.booking-box {
    width: 100%;
    max-width: 800px;
    margin: 0 auto !important;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
    float: none !important;
}

.main-title {
    text-align: center;
    font-size: 24px;
    color: #0B3C5D;
    margin-bottom: 25px;
    font-weight: 600;
}

/* --- 2. ส่วนควบคุมปฏิทิน (Calendar Header) --- */
.calendar-container {
    background-color: var(--jp-bg);
    width: 100%;
    max-width: 450px;
    border-top: 8px solid var(--jp-red);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 24px;
    box-sizing: border-box;
}

.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
}
  #monthYearTitle {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
    min-width: 160px;
    text-align: center;
} 
/* ปุ่มเลือกเดือน */
.nav-btn {
    background-color: #0B3C5D;
    color: #22216e;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
} 
.nav-btn:hover {
    background-color: #124b73;
}

/* --- 3. ตารางปฏิทิน (Calendar Grid & Days) --- */
.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 8px;
    margin-bottom: 25px;
    background-color: #fff;
}
.day-label {
    text-align: center;
    font-weight: bold;
    padding: 10px 0;
    color: #555;
    border-bottom: 2px solid #eef2f5;
    font-size: 14px;
}

/* ช่องวันที่แต่ละวัน */
.calendar-day {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 4px;
    min-height: 60px;
    background-color: #ffffff;
    border: 1px solid #eef2f5;
    border-radius: 6px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.day-num {
    font-weight: 600;
    font-size: 16px;
    color: #333333;
}

.day-status {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    width: 85%;
}

/* --- 4. การจัดการสถานะสีของวัน (Calendar Statuses) --- */

/* วันในอนาคตที่มีรถว่าง (空く) */
.available-day {
    cursor: pointer;
    background-color: #fff;
}
.available-day:hover {
    background-color: #e6f7f9;
    border-color: #89e8d7;
}
.status-ok {
    color: #2e7d32 !important;
    background-color: #e8f5e9;
}

/* วันที่รถเต็ม (満車) */
.full-day {
    background-color: #fafafa !important;
    border-color: #f1f1f1;
    pointer-events: none !important; /* บล็อกห้ามคลิก */
    opacity: 0.6;
}
.status-full {
    color: #c62828 !important;
    background-color: #ffebee;
}

/* วันในอดีต (過去) */
.past-day {
    background-color: #fcfcfc !important;
    pointer-events: none !important; /* บล็อกห้ามคลิก */
}
.status-past {
    color: #757575 !important;
    background-color: #eeeeee;
}

/* วันปัจจุบัน */
.today-current {
    border: 2px solid #89e8d7 !important;
}

/* ==========================================================================
   จุดแก้ไข: วันที่ถูกคลิกเลือก (Selected Day) - บังคับสีข้อความให้เป็นสีขาวชัดเจน
   ========================================================================== */
.calendar-day.selected {
    background-color: #0B3C5D !important;
    border-color: #0B3C5D !important;
}
.calendar-day.selected .day-num {
    color: #ffffff !important; /* เปลี่ยนตัวเลขเป็นสีขาว */
    font-weight: bold !important;
}
.calendar-day.selected .day-status {
    color: #ffffff !important; /* เปลี่ยนตัวหนังสือสถานะเป็นสีขาว */
    background-color: transparent !important; /* ล้างพื้นหลังเดิมออกเพื่อไม่ให้ซ้อนกัน */
}

/* --- 5. โครงสร้างฟอร์มกรอกข้อมูล (Booking Form Section) --- */
.booking-form-section {
    max-width: 600px;
    margin: 0 auto;
    padding-top: 25px;
    border-top: 1px solid #eef2f5;
}

/* กล่องแจ้งเตือนวันที่ถูกเลือก */
.selected-date-alert {
    text-align: center;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-weight: 500;
    font-size: 15px;
    border: 1px solid #d9d9d9;
    background-color: #fafafa;
    color: #555;
    transition: all 0.3s ease;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    box-sizing: border-box;
    background-color: #fff;
    color: #333;
}
.form-control:disabled {
    background-color: #f5f5f5;
    color: #bfbfbf;
    cursor: not-allowed;
}

.price-display {
    font-size: 16px;
    font-weight: bold;
    color: #d9534f;
    margin-top: 6px;
}

/* ==========================================================================
   จุดแก้ไข: ปุ่มส่งข้อมูล (Submit Button) - บังคับไม่ให้หายไปเด็ดขาดด้วย !important
   ========================================================================== */
.book-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    background-color: #0B3C5D !important;
    color: #ffffff !important;
    padding: 14px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    margin-top: 25px !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease;
}

/* ปุ่มสถานะโดนล็อก (ขณะยังไม่ได้เลือกวัน) */
.book-btn:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* ปุ่มสถานะเปิดให้กดจองได้ */
.book-btn:not(:disabled):hover {
    background-color: #124b73 !important;
    transform: translateY(-1px);
}

/* --- 6. Responsive ลุยหน้าจอมือถือ (Mobile Responsive) --- */
@media (max-width: 768px) {
    .booking-box {
        padding: 15px;
        border-radius: 8px;
    }
    .calendar-grid {
        gap: 4px; /* ลดช่องว่างบนมือถือป้องกันปฏิทินล้น */
    }
    .calendar-day {
        min-height: 52px;
        padding: 4px 2px;
    }
    .day-num {
        font-size: 14px;
    }
    .day-status {
        font-size: 9px;
        padding: 1px 2px;
        width: 90%;
    }
    #monthYearTitle {
        font-size: 18px;
        min-width: 120px;
    }
    .calendar-header {
        gap: 20px;
    }
}
