﻿/* --- Global Styles --- */
body {
    font-family: 'Kanit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    margin: 0;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 600px;
    margin: 20px auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    width: 90%; /* Responsive for mobile */
}

/* --- Header --- */
.header {
    text-align: center;
    padding: 30px 20px 20px 20px;
}

    .header img {
        width: 50px;
        height: auto;
        margin-bottom: 15px;
    }

.header-title {
    display: block;
    font-size: 1.5em;
    font-weight: 600;
    color: #000;
}

/* --- Notice Box --- */
.notice-box {
    background-color: #f0f8ff;
    padding: 20px;
    font-size: 0.9em;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

/* --- Content Areas --- */
.form-content, .booking-card, .status-section {
    padding: 30px;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.95em;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-control {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 12px;
    font-size: 1em;
    font-family: inherit;
    color: #333;
    background-color: #fff;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    box-sizing: border-box; /* Important */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* --- Buttons --- */
.btn {
    display: block;
    width: 100%;
    height: 50px;
    font-size: 1.05em;
    font-weight: 500;
    font-family: inherit;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary {
    background-color: #007aff;
}

    .btn-primary:hover {
        background-color: #005ecb;
    }

.btn-danger {
    background-color: #ff3b30;
    margin-top: 15px;
}

    .btn-danger:hover {
        background-color: #d92c23;
    }

/* --- Status Table (Quota) --- */
.status-title {
    font-size: 1.1em;
    font-weight: 500;
    color: #007aff;
    margin-bottom: 15px;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    text-align: left;
    margin-bottom: 15px;
}

    .status-table th, .status-table td {
        padding: 12px 10px;
        border-bottom: 1px solid #f0f0f0;
        text-align: center;
    }

    .status-table th {
        font-weight: 600;
        background-color: #f9f9f9;
        color: #1d1d1f;
        white-space: nowrap;
    }

.slot-available {
    background-color: #e6f9f0 !important;
    font-weight: 600;
    color: #006422;
}

.slot-full {
    background-color: #ffebee !important;
}

.status-message {
    font-size: 0.95em;
    line-height: 1.6;
    margin-top: 20px;
    text-align: center;
}

/* --- Booking Card (Success) --- */
.booking-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #007aff;
    margin-bottom: 15px;
}

.booking-details {
    font-size: 1em;
    color: #333;
    line-height: 1.7;
    margin-bottom: 25px;
    text-align: left;
    padding: 0 10px;
}

    .booking-details span {
        display: block;
        margin-bottom: 5px;
    }

/* --- Footer --- */
.footer {
    text-align: center;
    font-size: 0.75em;
    color: #8a8a8e;
    padding: 20px;
}

/* --- UpdateProgress Loader --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-box {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* --- [เพิ่มใหม่] Calendar Styles --- */

/* ทำให้ปฏิทินเต็มความกว้าง */
.calendar-container table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 2px;
}

/* หัวข้อ (จ อ พ พฤ ศ ส อา) */
.calendar-container th {
    background-color: #f9f9f9;
    font-weight: 500;
    padding: 10px;
    text-align: center;
    font-size: 0.9em;
}

/* Header ( < เดือน ปี > ) */
.calendar-container .calendar-header {
    background-color: #007aff;
    color: white;
    height: 50px;
    font-weight: 600;
    font-size: 1.1em;
}

    .calendar-container .calendar-header a {
        color: white !important;
        text-decoration: none;
        font-weight: bold;
        padding: 0 15px;
    }

/* วันที่ทั่วไป (ในเดือน) */
.calendar-container .calendar-day {
    padding: 15px;
    text-align: center;
    background-color: #fdfdfd;
    border: 1px solid #f0f0f0;
    font-size: 0.95em;
    vertical-align: middle;
    height: 60px; /* กำหนดความสูงให้เท่ากัน */
}

/* วันที่ที่ถูกเลือก */
.calendar-container .calendar-selected {
    background-color: #007aff !important;
    color: white !important;
    font-weight: 600;
    border: 1px solid #005ecb;
}

/* --- [สำคัญ] สไตล์สำหรับสถานะคิว --- */

/* วันที่จองได้ (สีเขียว) */
.calendar-container .day-available {
    background-color: #e6f9f0;
    color: #006422;
    font-weight: 600;
    cursor: pointer;
}

    .calendar-container .day-available:hover {
        background-color: #c8f0d8;
    }

/* วันที่คิวเต็ม (สีแดง) */
.calendar-container .day-full {
    background-color: #ffebee;
    color: #b71c1c;
    text-decoration: line-through;
    cursor: not-allowed;
}

/* วันที่ปิด (เสาร์-อาทิตย์, วันหยุด, อดีต, เดือนอื่น) */
.calendar-container .day-disabled {
    background-color: #f5f5f5;
    color: #cccccc;
    cursor: not-allowed;
}
