/* ===================================================
   Chalice Reservation Frontend Styles (Isolated)
   Fully scoped inside .cr-reservation-container
   Bootstrap 5 look-alike without dependency
   =================================================== */

/* Container & overall layout */
.cr-reservation-container {
    max-width: 650px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
}

/* Card layout */
.cr-reservation-container .card {
    background: #fff;
    border-radius: 0.25rem; /* 4px like Bootstrap */
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    overflow: hidden;
    margin-bottom: 20px;
}

.cr-reservation-container .card-body {
    padding: 1rem; /* 16px */
}

/* Headings */
.cr-reservation-container h3 {
    text-align: center;
    margin-bottom: 1.5rem; /* 24px */
    font-size: 1.5rem;
}

/* ============================
   Form layout using Bootstrap-style classes
   ============================ */
.cr-form {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Form group spacing */
.cr-form-group {
    margin-bottom: 1rem; /* Bootstrap mb-3 */
}

/* Labels */
.cr-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #212529;
}

/* Inputs, select, textarea */
.cr-form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem; /* 6px 12px */
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Focus effect like Bootstrap */
.cr-form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.25);
}

/* Disabled/readonly states */
.cr-form-control:disabled,
.cr-form-control[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Select specific fix */
.cr-form-control[type="select"],
select.cr-form-control {
    height: calc(2.25rem + 2px);
    line-height: 1.5;
    appearance: none;
}

/* Textarea resizing */
.cr-form-control[type="textarea"],
textarea.cr-form-control {
    resize: vertical;
}

/* ============================
   Button styling (primary)
   ============================ */
.cr-btn-submit {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: color 0.15s ease-in-out,
                background-color 0.15s ease-in-out,
                border-color 0.15s ease-in-out,
                box-shadow 0.15s ease-in-out;
    width: 100%;
}

/* Hover state */
.cr-btn-submit:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

/* Focus/active state */
.cr-btn-submit:focus,
.cr-btn-submit:active {
    background-color: #0a58ca;
    border-color: #084298;
    box-shadow: 0 0 0 0.2rem rgba(13,110,253,.5);
}

/* ============================
   Message display
   ============================ */
#crMessage {
    margin-top: 1rem;
    font-weight: 600;
}

/* ============================
   Flatpickr calendar highlights
   ============================ */
.cr-reservation-container .flatpickr-day.reserved-day {
    background-color: #ffd966 !important;
    color: #333 !important;
    font-weight: bold;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.9;
}

.cr-reservation-container .flatpickr-day.partial-day {
    background: #fff3cd !important;
    color: #856404 !important;
}

.cr-reservation-container .flatpickr-day.reserved-day:first-child {
    border-radius: 50% 0 0 50% !important;
}

.cr-reservation-container .flatpickr-day.reserved-day:last-child {
    border-radius: 0 50% 50% 0 !important;
}

.cr-reservation-container .flatpickr-day.reserved-day:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

/* ============================
   Responsive adjustments
   ============================ */
@media (max-width: 600px) {
    .cr-reservation-container {
        padding: 15px;
    }

    .cr-form-control {
        font-size: 0.875rem;
        padding: 0.35rem 0.65rem;
    }

    .cr-btn-submit {
        font-size: 0.875rem;
        padding: 0.35rem 0.65rem;
    }
}
