/* --- Global Body & Background --- */
body {
    background-image: linear-gradient(to bottom, #FFF2F4, #FFFFFF);
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Top Menu --- */
.top-menu {
    background-color: #333;
    padding: 10px 20px;
    width: 100%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.logo {
    color: #fff;
    font-size: 2rem;
    text-decoration: none;
    font-weight: bold;
}

.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    flex-grow: 1;
}

.menu-list li {
    margin: 0 10px;
}

.menu-list a {
    text-decoration: none;
    color: #fff;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.menu-list a:hover {
    background-color: #555;
    transform: translateY(-2px);
}

/* --- Main Content Section --- */
.content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    flex-grow: 1;
    padding: 20px;
}

.main-container {
    text-align: center;
    background-color: transparent;
    padding: 30px;
    border-radius: 10px;
    box-shadow: none;
}

.main-container h1 {
    color: #2D0014;
    font-size: 3rem;
    text-shadow: none;
    margin-top: 0;
}

/* Updated 'Show slots' button to match the color scheme */
#bookAppointmentBtn {
    background-color: #FFDEE6; /* Light Pink */
    color: #2D0014;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s;
}

#bookAppointmentBtn:hover {
    background-color: #FF66A3; /* Darker Pink on hover */
}

/* --- Calendar Popup and Overlay --- */
.calendar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.calendar-popup {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 600px;
    width: 90%;
}

.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: transparent;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #888;
    z-index: 10;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 20px;
    position: relative;
    z-index: 5;
}

.day-view-nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.day-view-nav {
    display: flex;
    gap: 10px;
}

.month-view-bottom-nav,
.day-view-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 10px;
}

.day-view-bottom-nav.center-back {
    justify-content: center;
}

#currentMonthYear {
    font-size: 1.5em;
    color: #333;
}

#selectedDate,
#formSelectedSlot {
    color: #FF66A3;
    font-size: 1.2em;
    white-space: nowrap;
}

#prevBtn,
#nextBtn,
#prevDayBtn,
#nextDayBtn,
#todayBtnDayView,
#todayBtnMonthView,
#backToMonthBtn,
#backToTodayBtn {
    background-color: #FFDEE6;
    color: #2D0014;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    text-align: center;
}

.day-header {
    font-weight: bold;
    color: #666;
    padding-bottom: 5px;
}

.day {
    padding: 15px;
    background-color: #FFF2F4;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.day:hover {
    background-color: #FFDEE6;
}

.day.today {
    border: 2px solid #FF66A3;
}

/* Updated: Filled days are now greyed out */
.day.has-event {
    background-color: #E0E0E0; /* Light gray */
    color: #666;
    cursor: not-allowed;
}

.day.disabled {
    color: #aaa;
    background-color: #F8F8F8;
    cursor: not-allowed;
}

.day-view {
    padding-top: 20px;
}

.time-slots-container {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 15px;
}

/* New CSS for day-view time slots to create a grid */
#timeSlots {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

#timeSlots li {
    background-color: #FFF2F4;
    padding: 10px;
    border-radius: 5px;
    list-style-type: none;
    cursor: pointer;
    text-align: center;
}

/* Updated: Booked slots are now greyed out */
#timeSlots li.booked {
    background-color: #CCCCCC; /* Darker gray */
    color: #555555;
    cursor: not-allowed;
}

#timeSlots li.booked:hover {
    background-color: #CCCCCC; /* Keep the same color on hover */
}

#timeSlots li.available:hover {
    background-color: #FFDEE6;
}

#selectedSlotInfo {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* --- Booking Form Styles --- */
.booking-form-view {
    padding-top: 20px;
}

#bookingForm label {
    display: block;
    text-align: left;
    margin-top: 10px;
    font-weight: bold;
}

.required {
    color: #FF66A3;
    font-size: 1.2em;
    margin-left: 2px;
}

#bookingForm input,
#bookingForm textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    box-sizing: border-box;
}

#bookingForm input.error {
    border: 2px solid #FF66A3;
}

.error-message {
    color: #FF66A3;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Style for the 'Back' button */
#backToSlots {
    background-color: #FFDEE6;
    color: #2D0014;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#backToSlots:hover {
    background-color: #FFC9D6;
}

/* Style for the 'Book' button - 2-3 shades darker than the back button */
#submitBookingBtn {
    background-color: #FF66A3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

/* On hover, the 'Book' button will now have LGBTQ+ flag colors (gradient animation) */
#submitBookingBtn:hover {
    background: linear-gradient(to right, #E40303, #FF8C00, #FFED00, #008026, #004DFF, #750787); /* LGBTQ+ flag colors */
    background-size: 400% auto; /* Make the gradient much wider */
    color: white; /* Keep text white */
    animation: gradientShift 2s linear infinite; /* Apply animation, adjusted duration */
}

/* Keyframes for the gradient animation */
@keyframes gradientShift {
    0% { background-position: 0% center; }
    100% { background-position: 400% center; } /* Adjusted to match background-size */
}

/* --- New Confirmation View Styles --- */
.booking-confirmation-view {
    text-align: center;
    padding: 20px;
}

.confirmation-header {
    color: #2D0014;
    font-size: 2.2em;
    margin-bottom: 20px;
}

.confirmation-details {
    text-align: left;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.confirmation-details p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #333;
}

.confirmation-details strong {
    color: #FF66A3;
}

.confirmation-footer p {
    color: #666;
    margin-bottom: 15px;
}

.confirm-btn {
    background-color: #FF66A3;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.confirm-btn:hover {
    background-color: #FF8C94;
}

/* --- Footer Section --- */
.social-footer {
    background-color: #222;
    color: white;
    text-align: center;
    padding: 10px 0;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    z-index: 1000;
}

.social-footer a {
    color: white;
    font-size: 1.5rem;
    margin: 0 15px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-footer a:hover {
    color: #0077b5;
}

.social-footer .github:hover {
    color: #6e5494;
}

/* New class for the time section to prevent breaking */
.time-section {
    white-space: nowrap;
}

/* --- Media Queries for Responsiveness --- */
/* For screens smaller than 768px (tablets and smaller) */
@media (max-width: 768px) {
    .main-container h1 {
        font-size: 2.5rem;
    }

    .calendar-popup {
        max-width: 95%;
        padding: 15px;
    }

    #bookAppointmentBtn {
        font-size: 1.1em;
        padding: 12px 25px;
    }
}

/* For screens smaller than 480px (mobile phones) */
@media (max-width: 480px) {
    .top-menu {
        flex-direction: row;
    }

    .menu-list {
        flex-wrap: nowrap;
        justify-content: center;
        width: 100%;
    }

    .menu-list a {
        padding: 10px 5px; /* Smaller padding for mobile */
        font-size: 0.9rem;
    }

    .main-container h1 {
        font-size: 2rem;
    }

    .booking-form-bottom-nav,
    .day-view-nav {
        flex-direction: column;
        gap: 15px;
    }

    #bookAppointmentBtn,
    #submitBookingBtn,
    #backToSlots {
        width: 100%;
        box-sizing: border-box;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
    }
    
    .day, #timeSlots li {
        font-size: 0.9em;
        padding: 10px;
    }

    #timeSlots {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Fix: Force the entire time section to a new line */
    #formSelectedSlot {
        display: block; /* The parent container acts as a block */
        white-space: normal;
    }

    .time-section {
        display: block; /* The time section itself also becomes a block to move to a new line */
    }
}