/* /assets/css/style.css (เวอร์ชันสมบูรณ์ - เพิ่ม Sticky Sidebar) */

/* 1. Import Font & กำหนดค่าสีหลัก */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;700&display=swap');

:root {
    --primary-color: #552A79;
    --primary-color-dark: #442261;
    --background-color: #f4f4f8;
    --text-color: #333;
    --fc-day-header-red: #c62828;
    /* TUI Calendar ยังใช้ตัวแปรนี้ได้ */
}

/* 2. สไตล์พื้นฐานของ Body */
body {
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 14px;
    background-color: var(--background-color);
    color: var(--text-color);
}

/* 3. ส่วน Header (Navbar) */
.navbar-custom {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
    color: #ffffff;
    font-weight: 500;
}

.navbar-custom .nav-link:hover {
    color: #dddddd;
}

.navbar-custom .dropdown-menu {
    font-size: 14px;
}

/* 4. ส่วนปุ่มหลัก (Primary Button) */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

/* 5. สไตล์ของ Card */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

/* 6. สไตล์ของ Footer สำหรับ Mobile */
.mobile-footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #dbdbdb;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.mobile-footer .nav {
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
}

.mobile-footer .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
    font-size: 12px;
    flex: 1;
    text-align: center;
}

.mobile-footer .nav-link i {
    font-size: 22px;
    margin-bottom: 2px;
}

.mobile-footer .nav-link.active {
    color: var(--primary-color);
}

/* --- 7. TUI Calendar Style Overrides --- */
.tui-full-calendar-dayname {
    font-size: 13px !important;
}

.tui-full-calendar-dayname.tui-full-calendar-sunday .tui-full-calendar-dayname-date {
    color: var(--fc-day-header-red) !important;
}

.tui-full-calendar-daygrid-date {
    font-size: 16px !important;
    font-weight: 500;
}

.tui-full-calendar-daygrid-date.tui-full-calendar-today {
    background-color: var(--primary-color) !important;
    border-radius: 50%;
    color: white !important;
}

.tui-full-calendar-time-schedule {
    font-size: 12px !important;
}

.tui-full-calendar-daygrid-schedule-title,
.tui-full-calendar-time-schedule .tui-full-calendar-schedule-title {
    color: #FFFFFF !important;
}

/* --- 8. ส่วนของ Sidebar และ Upcoming Bookings (เพิ่ม Sticky) --- */
.sticky-sidebar {
    position: -webkit-sticky;
    /* For Safari */
    position: sticky;
    top: 1.5rem;
    /* ระยะห่างจากด้านบน */
}

.upcoming-bookings-container {
    max-height: 70vh;
    /* กำหนดความสูงสูงสุดและให้มี scrollbar */
    overflow-y: auto;
}

.booking-card {
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background-color: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.booking-card .booking-title {
    font-weight: 600;
    color: var(--text-color);
}

.booking-card .booking-meta {
    font-size: 0.85em;
    color: #6c757d;
}

.notification-item.read-notification {
    opacity: 0.6;
}

/* --- 9. ส่วน Responsive (Media Queries) --- */
@media (max-width: 991.98px) {

    /* ใช้ .98 เพื่อความแม่นยำ */
    .mobile-footer {
        display: block;
    }

    .main-content {
        padding-bottom: 80px;
    }

    .dropdown-menu[aria-labelledby="notificationDropdown"] .dropdown-item {
        white-space: normal !important;
        overflow-wrap: break-word;
    }

    .dropdown-menu[aria-labelledby="notificationDropdown"] {
        width: 95vw !important;
        max-width: 400px;
    }

    /* --- Upcoming Bookings บน Mobile --- */
    .mobile-upcoming-bookings {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mobile-upcoming-bookings::-webkit-scrollbar {
        display: none;
    }

    .mobile-upcoming-bookings .booking-card {
        flex: 0 0 280px;
        margin-right: 0.75rem;
        margin-bottom: 0;
    }
        /* --- Custom Style for Internal Attendee List --- */
        .attendee-item .form-check-label {
            display: block;
            width: 100%;
        }
    
        .attendee-name {
            font-weight: 500;
            color: var(--text-color);
        }
    
        .attendee-meta {
            display: block;
            font-size: 0.8em;
            color: #6c757d;
            margin-left: 1.5rem;
            /* เยื้องให้ตรงกับ Checkbox */
        }
}