/* ===================================================================
   HandyHounds Booking Calendar - style.css (Rewritten)
   =================================================================== */

/* ----------------------------------------
   1. Global, Fonts, & Base Styles
---------------------------------------- */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #fff;
    color: #000;
    -webkit-text-size-adjust: 100%; /* Prevents font scaling on mobile */
}
.container {
    padding: 1rem;
    text-align: center;
}
h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.back-button {
    padding: 1rem;
}
.back-button a {
    color: #C4641E;
    text-decoration: none;
    font-weight: bold;
}

/* ----------------------------------------
   2. Calendar Wrapper & Toolbar
---------------------------------------- */
.calendar-wrapper {
    width: calc(100% - 20px); /* Mobile-first width */
    max-width: 1100px; /* Max width for large screens */
    margin: 20px auto;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .calendar-wrapper {
        width: calc(100% - 100px);
        margin: 40px auto;
    }
}
.fc .fc-toolbar-title {
    font-size: 1.25em !important; /* Ensure title is readable on mobile */
}
.fc .fc-toolbar.fc-header-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}
.fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
}

/* ----------------------------------------
   3. Modal Styles (General & Booking Form)
---------------------------------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
}
.modal.show {
    display: flex;
}
.modal-content {
    background: #C4641E;
    color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Kelly Slab', serif;
}
.modal-content .logo {
    max-width: 350px;
    height: auto;
    margin: 3.5px auto 1.5rem auto;
    background-color: transparent;
    padding: 0;
}
.modal-content h2 {
    font-size: 1.5rem;
    margin-top: 0;
}
.close-btn {
    position: absolute; top: 10px; right: 15px; font-size: 2rem; font-weight: bold;
    color: #fff; opacity: 0.8; background: none; border: none; cursor: pointer;
}
#booking-form {
    text-align: left;
    font-family: 'Kelly Slab', serif;
}
#booking-form label, #booking-form legend {
    font-weight: normal;
}
#booking-form input, #booking-form textarea, #booking-form button {
    font-family: 'Kelly Slab', serif;
}
#booking-form input[type="text"], #booking-form input[type="email"],
#booking-form input[type="tel"], #booking-form textarea {
    width: 100%; padding: 0.75rem; border-radius: 4px; box-sizing: border-box;
    margin-top: 0.25rem; background: #fff; color: #333; border: 1px solid #ccc; font-size: 1rem;
}
#booking-form fieldset {
    border: 1px solid rgba(255, 255, 255, 0.5); background: rgba(0,0,0,0.1); padding: 1rem;
    margin: 1rem 0;
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 0.5rem 1rem;
}
@media (min-width: 600px) {
    #booking-form fieldset {
        grid-template-columns: 1fr 1fr; /* Two columns on larger screens */
    }
}
#booking-form fieldset label {
    display: flex; align-items: center; margin-bottom: 0;
}
#booking-form button[type="submit"] {
    width: 100%; background-color: #fff; color: #C4641E; font-weight: bold;
    padding: 0.75rem 1.5rem; border: none; border-radius: 4px; font-size: 1.2rem; cursor: pointer;
}

/* ----------------------------------------
   4. Holiday Alert Modal Styles
---------------------------------------- */
.modal-content.holiday-alert h2 { font-size: 2em; }
.modal-content.holiday-alert p { font-size: 1.2em; line-height: 1.5; margin: 1.5rem 0; }
.holiday-alert-buttons { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 600px) {
    .holiday-alert-buttons { flex-direction: row; }
}
.holiday-alert-buttons button {
    flex: 1; padding: 0.75rem; border-radius: 5px; border: 2px solid #fff;
    font-size: 1.2em; cursor: pointer;
}
#holiday-cancel { background: transparent; color: #fff; }
#holiday-proceed { background: #fff; color: #C4641E; }

/* ===================================================================
   Calendar Day Styling - Rewritten with Simple Priority
   =================================================================== */

/* ----------------------------------------
   5. Day Structure & Number Styling
---------------------------------------- */
.fc-daygrid-day {
    position: relative;
}
.fc-daygrid-day-frame {
    position: relative;
    height: 100%;
    width: 100%;
}
.fc-daygrid-day-number {
    position: absolute;
    top: 0;
    left: 0;
    padding: 5px;
    z-index: 3;
    color: #333;
    font-size: 0.8em;
    font-weight: bold;
}
.fc-daygrid-day-frame::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: pre;
    text-align: center;
    font-size: 0.8em; /* Smaller font for mobile */
    font-weight: bold;
    pointer-events: none;
    z-index: 2;
}
@media (min-width: 768px) {
    .fc-daygrid-day-frame::after {
        font-size: 0.9em; /* Larger font for desktop */
    }
}

/* ----------------------------------------
   6. Day Colors & Labels by Priority
---------------------------------------- */

/* --- AVAILABLE STYLING --- */
.day-is-available {
    background-color: #d4edda !important;
    cursor: pointer;
}
.day-is-available .fc-daygrid-day-frame::after {
    content: "AVAILABLE";
    color: #155724;
}

/* --- OFF DAY STYLING --- */
.day-is-off {
    background-color: #f8d7da !important;
    cursor: not-allowed;
}
.day-is-off .fc-daygrid-day-frame::after {
    content: "UNAVAILABLE";
    color: #721c24;
}

/* --- HOLIDAY STYLING --- */
.day-is-holiday {
    background-color: #d1ecf1 !important;
    cursor: pointer;
}
.day-is-holiday .fc-daygrid-day-frame::after {
    content: "HOLIDAY\nAVAILABLE";
    color: #0c5460;
}

/* --- PAST DAY STYLING (Absolute Final Override) --- */
.day-is-past {
    background-color: #e9ecef !important;
    cursor: not-allowed;
}
.day-is-past .fc-daygrid-day-frame::after {
    content: '' !important;
}
.day-is-past .fc-daygrid-day-frame::before,
.day-is-past .fc-daygrid-day-frame::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #adb5bd;
    z-index: 4;
    transform-origin: center;
}
.day-is-past .fc-daygrid-day-frame::before {
    transform: translate(0, -50%) rotate(45deg);
}
.day-is-past .fc-daygrid-day-frame::after {
    transform: translate(0, -50%) rotate(-45deg);
}

/* --- MOBILE-SPECIFIC STYLES --- */
@media (max-width: 767px) {
    /* Hide text labels on mobile for a cleaner look */
    .day-is-available .fc-daygrid-day-frame::after,
    .day-is-off .fc-daygrid-day-frame::after {
        content: '' !important;
    }
    /* On holidays, just show "HOLIDAY" on mobile */
    .day-is-holiday .fc-daygrid-day-frame::after {
        content: "HOLIDAY" !important;
        line-height: 1;
    }
}
