/* =================================================================== */
/* GLOBAL STYLES
/* =================================================================== */

.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-weight: bold; margin-bottom: 5px; }
.form-row input[type="text"], .form-row input[type="email"], .form-row input[type="tel"], .form-row input[type="number"], .form-row textarea, .form-row select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 3px; box-sizing: border-box; }
.form-row textarea { min-height: 80px; }
.form-row-flex { display: flex; gap: 15px; }
.form-row-flex .form-row { flex: 1; }
.ui-datepicker { z-index: 9999 !important; }

/* =================================================================== */
/* BOOKING FORM STYLES
/* =================================================================== */

#ahb-booking-form-area { display: none; margin-top: 3em; border-top: 2px solid #555; padding-top: 2em; border-radius: 8px; background: #f9f9f9; padding: 20px; }
#ahb-price-preview { background: #3f5347; padding: 10px 15px; border-radius: 4px; margin-bottom: 15px; color:#fff;}
#ahb-price-preview p { margin: 5px 0; }
#ahb-surcharge-line { display: none; }
#ahb-form-message { margin-top: 15px; padding: 10px; border-radius: 3px; display: none; }
#ahb-form-message.success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; display: block; }
#ahb-form-message.error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; display: block; }
#ahb-booking-form button[type="submit"] { background-color: #8b3c03 !important; border-color: #7c3503 !important; color: #fff; border-style: solid; border-width: 1px; padding: 10px 20px; font-size: 16px; cursor: pointer; border-radius: 3px; }
#ahb-booking-form button[type="submit"]:hover { background-color: #7c3503 !important; }

/* =================================================================== */
/* READ-ONLY AVAILABILITY CALENDAR STYLES (DEFINITIVE VERSION)
/* =================================================================== */

.ahb-availability-calendar {
    width: 100%;
    max-width: 350px;
    margin: 1em auto;
}

/* Main calendar container */
.ahb-availability-calendar .ui-datepicker {
    width: 100% !important; 
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    font-family: sans-serif;
}

/* Header: "August 2025" */
.ahb-availability-calendar .ui-datepicker-header {
    background: transparent;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
    margin-bottom: 5px;
    color: #333;
}
.ahb-availability-calendar .ui-datepicker-prev,
.ahb-availability-calendar .ui-datepicker-next {
    border: 1px solid #ccc;
    background: #f5f5f5;
}

/* Day grid table */
.ahb-availability-calendar .ui-datepicker-calendar {
    width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
}

/* Day names: S, M, T, W... */
.ahb-availability-calendar .ui-datepicker-calendar th {
    color: #757575;
    font-weight: bold;
    font-size: 0.8em;
    padding: 0;
}

/* Default state for all day cells */
.ahb-availability-calendar .ui-datepicker-calendar td {
    padding: 0;
}
.ahb-availability-calendar .ui-datepicker-calendar td a,
.ahb-availability-calendar .ui-datepicker-calendar td span {
    text-align: center;
    padding: 0.6em 0;
    display: block;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid transparent;
}

/* AVAILABLE DAY (Default state) */
.ahb-availability-calendar .ui-datepicker-calendar td a {
    background: #ffffff;
    color: #555;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}
.ahb-availability-calendar .ui-datepicker-calendar td a:hover {
    background: #f5f5f5;
    border-color: #ccc;
}
.ahb-availability-calendar .ui-datepicker-other-month .ui-state-default {
    opacity: 0.3;
}

/* CLICKED DAY HIGHLIGHT (Yellow) */
.ahb-availability-calendar .ui-datepicker-calendar td a.ui-state-active {
    background: #ffeb3b !important;
    color: #333 !important;
    border-color: #fbc02d !important;
}

/* --- STYLES FOR BOOKED/CHANGEOVER DAYS (DEFINITIVE FIX) --- */

/* This is a general rule for any disabled/booked day to remove the default gray fade */
.ui-datepicker td.is-checkin-day a,
.ui-datepicker td.is-checkin-day span {
    background-image: linear-gradient(135deg, #ffffff 49%, #8b3c03 51%) !important;
    color: #555 !important;
    border: 1px solid #cccccc !important;
}

.ui-datepicker td.is-middle-day a,
.ui-datepicker td.is-middle-day span {
    background-color: #8b3c03 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid #424242 !important;
}

.ui-datepicker td.is-checkout-day a,
.ui-datepicker td.is-checkout-day span {
    background-image: linear-gradient(135deg, #8b3c03 49%, #ffffff 51%) !important;
    color: #555 !important;
    border: 1px solid #cccccc !important;
}

.ahb-blocked-day a, .ahb-blocked-day span {
    background-color: #8b3c03 !important;
    color: white !important;
    border: 1px solid #424242 !important;
    cursor: default !important;
}

/* =================================================================== */
/* BOOKING LEGEND STYLES
/* =================================================================== */
.ahb-legend { margin-top: 1em; margin-bottom: 2em; display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.9em; color: #e0e0e0; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-color-box { width: 18px; height: 18px; display: inline-block; border: 1px solid #ccc;}
.legend-color-box.available { background-color: #9ba59c; }
.legend-color-box.booked { background-color: #8b3c03; }

/* =================================================================== */
/* ADMIN & OTHER STYLES
/* =================================================================== */
#ahb-manual-booking-modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.ahb-modal-content { background-color: #fefefe; margin: 10% auto; padding: 20px 30px 30px; border: 1px solid #888; width: 80%; max-width: 500px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.ahb-modal-close { color: #aaa; float: right; font-size: 28px; font-weight: bold; position: absolute; top: 5px; right: 15px; cursor: pointer; }
#ahb-manual-booking-form .form-row { margin-bottom: 15px; }
#ahb-manual-booking-form label { display: block; margin-bottom: 5px; font-weight: bold; }
#ahb-manual-booking-form input[type="text"], #ahb-manual-booking-form input[type="date"], #ahb-manual-booking-form select { width: 100%; padding: 8px; box-sizing: border-box; }
#ahb-manual-booking-form .form-row-flex { display: flex; gap: 20px; }
#ahb-manual-booking-form .form-row-flex .form-row { width: 50%; }
.ahb-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 2em 0; }
.ahb-gallery img { width: 100%; height: auto; display: block; border-radius: 4px; }

/* =================================================================== */
/* MOBILE RESPONSIVE STYLES
/* =================================================================== */
@media (max-width: 767px) {
    .form-row-flex { flex-direction: column; gap: 0; }
    #ahb-booking-form-area { padding: 15px; }
    .ahb-availability-calendar .ui-datepicker-calendar { border-spacing: 2px; }
    .ahb-availability-calendar .ui-datepicker-calendar td a, .ahb-availability-calendar .ui-datepicker-calendar td span { font-size: 0.8em; font-weight: normal; }
    .ahb-legend { justify-content: center; }
}

/* Remove fade/opacity for booked days */
.ui-datepicker td.is-checkin-day,
.ui-datepicker td.is-middle-day,
.ui-datepicker td.is-checkout-day {
    opacity: 1 !important;
}

/* Remove opacity on other-month dates (if any booked days appear in other months) */
.ui-datepicker-other-month .ui-state-default {
    opacity: 1 !important;
}

/* Swap diagonal gradients for checkout calendar */

.checkout-datepicker td.is-checkin-day a,
.checkout-datepicker td.is-checkin-day span {
    /* Reverse gradient */
    background-image: linear-gradient(135deg, #8b3c03 49%, #ffffff 51%) !important;
    color: #555 !important;
    border: 1px solid #cccccc !important;
}

.checkout-datepicker td.is-checkout-day a,
.checkout-datepicker td.is-checkout-day span {
    background-image: linear-gradient(135deg, #ffffff 49%, #8b3c03 51%) !important;
    color: #555 !important;
    border: 1px solid #cccccc !important;
}

/* =================================================================== */
/* TOAST NOTIFICATION STYLES
/* =================================================================== */
#ahb-toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #3f5347 0%, #2d3d32 100%);
    color: #ffffff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#ahb-toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#ahb-toast-notification .toast-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

#ahb-toast-notification .toast-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

#ahb-toast-notification .toast-message {
    font-size: 15px;
    line-height: 1.5;
    opacity: 0.95;
}

@media (max-width: 767px) {
    #ahb-toast-notification {
        min-width: auto;
        width: 90%;
        padding: 18px 20px;
    }

    #ahb-toast-notification .toast-icon {
        font-size: 36px;
    }

    #ahb-toast-notification .toast-title {
        font-size: 18px;
    }

    #ahb-toast-notification .toast-message {
        font-size: 14px;
    }
}
