/* ==========================================================
   1. BOOKING APP CONTAINER (Clean & Centered)
   ========================================================== */
#phil-booking-app {
    position: relative; 
    width: 100%;
    max-width: 1200px;
    margin: 0 auto; /* Naturally centers the app */
    background-color: transparent; /* Lets the new body color show through! */
    display: flex;
    justify-content: center; 
    padding-top: 20px; 
    min-height: 85vh; 
    box-sizing: border-box;
}

.booking-split-view {
    display: flex; flex-direction: row;
    width: 100%; min-height: 85vh;
    background: transparent;
}

/* ==========================================================
   2. CALENDAR & TIME SLOTS UI
   ========================================================== */
/* ==========================================================
   2. CALENDAR & TIME SLOTS UI
   ========================================================== */
.booking-calendar-side {
    flex: 1; 
    padding: 60px 40px 40px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.booking-calendar-side h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem; margin: 0 0 30px 0; text-align: center;
}

.flatpickr-calendar.inline {
    width: 100% !important; max-width: 400px;
    box-shadow: none !important; border: none !important;
    background: transparent !important;
}

.flatpickr-innerContainer { display: flex !important; justify-content: center !important; width: 100% !important; }
.flatpickr-rContainer { display: block !important; margin: 0 auto !important; }
.flatpickr-months, .flatpickr-month, .flatpickr-weekdays, .flatpickr-weekday, .flatpickr-days, .dayContainer { background: transparent !important; }
.flatpickr-day.selected { background: #1a1a1a !important; border-color: #1a1a1a !important; color: #fff !important; }
.flatpickr-day { position: relative; }
.flatpickr-day::after { content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; }
.flatpickr-day.status-green::after { background-color: #46b450; }
.flatpickr-day.status-orange::after { background-color: #ffb900; }
.flatpickr-day.status-red::after { background-color: #dc3232; }
.flatpickr-day.selected::after { display: none; }

.calendar-legend {
    margin-top: 30px; display: flex; gap: 20px;
    font-family: 'Helvetica Neue', sans-serif; font-size: 0.8rem; color: #666; justify-content: center;
}
.calendar-legend .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; }
.green-dot { background-color: #46b450; }
.orange-dot { background-color: #ffb900; }
.red-dot { background-color: #dc3232; }

/* --- THE EXPANDED TIME SLOTS SIDE --- */
.booking-time-side {
    flex: 1.3; /* NEW: Physically widens the div */
    padding: 60px 20px 40px 40px; /* NEW: Reduces the massive right margin */
    display: flex; flex-direction: column; justify-content: flex-start;
}

.booking-time-side h2 {
    font-family: 'Helvetica Neue', sans-serif; font-size: 1.2rem;
    font-weight: 400; margin: 0 0 40px 0; color: #666; text-align: center;
}

/* Groups the hour rows vertically without an internal scrollbar */
.time-slots-grid {
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    
    /* NEW: Height auto and no overflow lets it grow naturally down the page */
    height: auto; 
    width: 100%;
}

/* NEW: Forces exactly 4 slots in a row for each hour */
.hour-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    width: 100%;
}

.time-slot-btn {
    width: 100%; /* Ensures they fill the grid evenly */
    background: transparent; border: 1px solid #1a1a1a; color: #1a1a1a;
    padding: 12px 5px; font-size: 1rem; font-family: 'Helvetica Neue', sans-serif;
    cursor: pointer; transition: all 0.2s ease; border-radius: 4px;
}
.time-slot-btn:hover { background: #1a1a1a; color: #ffffff; }
.no-slots { grid-column: 1 / -1; text-align: center; color: #888; font-style: italic; }

/* Bottom Action Links */
.bottom-action-link { 
    margin-top: auto; 
    padding-top: 50px; 
    width: 100%; 
    text-align: center; 
    font-family: 'Helvetica Neue', sans-serif; 
    font-size: 0.85rem;
    color: #666; 
}

.bottom-action-link a {
    display: inline; /* NEW: Forces the link to flow perfectly in the same sentence */
    white-space: nowrap; /* NEW: Guarantees "Contact us!" never gets split onto two lines */
    font-family: 'Helvetica Neue', sans-serif; 
    font-size: 0.85rem;
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    color: #1a1a1a;
    text-decoration: none; 
    border-bottom: 1px solid #1a1a1a; 
    padding-bottom: 2px;
    background: transparent; 
    transition: opacity 0.3s ease;
    margin-left: 5px; 
}

.bottom-action-link a:hover { 
    opacity: 0.5; 
}

/* ==========================================================
   3. MODAL POPUP & FORM STYLES
   ========================================================== */
.phil-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(252,246,229,0.9); backdrop-filter: blur(8px);
    z-index: 100000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease;
}
.phil-modal-overlay.active { opacity: 1; visibility: visible; }

.phil-modal-content {
    background: #ffffff; width: 100%; max-width: 650px; max-height: 90vh;
    overflow-y: auto; padding: 50px; box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    position: relative; transform: translateY(20px); transition: transform 0.3s ease;
    border-radius: 12px;
}
.phil-modal-overlay.active .phil-modal-content { transform: translateY(0); }

/* --- THE NEW MOBILE-FRIENDLY EXIT BUTTON --- */
.close-modal {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    background: #f0f0f0; 
    border: none;
    width: 44px; 
    height: 44px; 
    border-radius: 50%;
    font-size: 1.8rem; 
    cursor: pointer; 
    color: #1a1a1a;
    display: flex; 
    align-items: center; 
    justify-content: center;
    z-index: 10; 
    transition: background 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.close-modal:hover { background: #e0e0e0; }

.modal-header h3 { font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; margin: 0 0 5px 0; }
.modal-header p { font-family: 'Helvetica Neue', sans-serif; color: #666; margin-bottom: 30px; font-weight: bold; }

.editorial-form { display: flex; flex-direction: column; gap: 20px; }
.form-row { display: flex; gap: 20px; }
.form-group { display: flex; flex-direction: column; flex: 1; }

.editorial-form label {
    font-family: 'Helvetica Neue', sans-serif; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px;
}
.editorial-form input, .editorial-form textarea {
    padding: 12px; border: 1px solid #ccc; background: transparent;
    font-size: 1rem; border-radius: 0; outline: none; transition: border-color 0.3s ease;
}
.editorial-form input:focus, .editorial-form textarea:focus { border-color: #1a1a1a; }
.optional-section h4 { border-bottom: 1px solid #eaeaea; padding-bottom: 10px; margin-bottom: 15px; }

.editorial-btn.block-btn {
    width: 100%; background: #1a1a1a; color: #fff; padding: 18px;
    font-size: 1rem; text-transform: uppercase; letter-spacing: 2px;
    border: none; cursor: pointer; transition: background 0.3s ease; border-radius: 4px;
}
.editorial-btn.block-btn:hover { background: #333; }

/* ==========================================================
   4. MOBILE COMPATIBILITY
   ========================================================== */
@media (max-width: 768px) {
    .booking-split-view { flex-direction: column; }
    .booking-calendar-side { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.05); padding: 40px 20px; }
    
    /* Rebalances padding for mobile */
    .booking-time-side { padding: 40px 20px; }
    
    .bottom-action-link { padding-top: 30px; }
    
    .phil-modal-overlay { align-items: flex-start !important; overflow-y: auto; }
    .phil-modal-content { height: auto; min-height: 100vh; padding: 30px 20px 80px; padding-top: 70px; box-shadow: none; border-radius: 0; }
    .close-modal { position: fixed !important; top: 15px !important; right: 15px !important; background: #ffffff !important; box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important; z-index: 999999 !important; }
    .form-row { flex-direction: column; gap: 20px; }

    /* NEW: Safely collapses the hour rows into a 2x2 grid on small screens */
    .hour-row {
        grid-template-columns: repeat(2, 1fr);
    }
}