#appointment-calendar{
    margin: 0 auto;
    width: 100%;
}

.ac-hidden {
    display: none !important;
}

.ac-visually-hidden {
    display: none;
}

.appointment-container{
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 3px;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
    width: 100%;
    height: 100%;
    padding: 20px;
}


#appointment-calendar .row {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap; /* responsive */
    margin: 0 -10px; /* fix spacing system */
}

/* ALL COLUMNS SAME SPACING */
#appointment-calendar [class*="col-"] {
    padding: 10px;
    display: flex;
}

/* ============================= */
/* CARD BASE (ALL 3 SAME STYLE) */
/* ============================= */
.calendar-card,
#timeslotbar,
#form-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

/* ============================= */
/* HEADERS (ALL SAME) */
/* ============================= */
.calendar-header,
#times-list-header,
#form-header {
    border: 1px solid #eee;
    background: #f5f5f5;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    margin: 0;
    border-radius: 3px;
    box-sizing: border-box;
}

.calendar-header p,
#times-list-header p,
#form-header p {
    margin: 0;
    text-align: center;
    color: #000;
}

/* ============================= */
/* CALENDAR */
/* ============================= */
#calendar-container {
    display: flex;
    z-index: 3;
    position: relative;
}

.calendar-body {
    padding: 10px;
}

/* ============================= */
/* TIMESLOT BAR */
/* ============================= */

/* wrapper */
#times-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#timeslotbar {
    z-index: 2;
    position: relative;
}

/* list container */
#times-list-container {
    padding: 10px;
    margin-top: 10px;
    flex: 1;
    max-height: 350px;
    overflow-y: scroll; /* ALWAYS show scrollbar */
    scrollbar-gutter: stable;
}

/* list */
#times-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#times-list li {
    width: 100%;
}

/* times */
.time-slot {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: #f6f6f6;
    color: var(--g5-color-heading);
    border-radius: 6px;
    text-align: center;
    cursor: pointer !important;
    border: 1px solid var(--g5-color-border);
    transition: 0.2s ease;
}

.time-slot:hover {
    background: var(--g5-color-accent);
    color: var(--g5-color-secondary-foreground);
}

.time-slot.selected {
    background: var(--g5-color-primary);
    color: var(--g5-color-primary-foreground);
}

/* ============================= */
/* FORM */
/* ============================= */
#form-container {
    padding: .2em;
    z-index: 1;
    position: relative;
}

#appointment-booking-panel,
#appointment-form,
.appointment-booking-panel {
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.booking-form {
    padding: 10px;
}

.resource-info {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-left: 4px solid #dfdfdf;
    border-radius: 4px;
}

.resource-info-title {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #666;
}

.resource-status-message {
    margin: 0 0 8px 0;
    font-weight: 700;
    color: #000;
}

.resource-row {
    margin-bottom: 8px;
}

.resource-label {
    display: block;
    color: #666;
    margin-bottom: 4px;
}

.resource-value-total {
    color: #222;
}

.resource-value-available {
    color: #28a745;
}

.resource-value-used {
    color: #dc3545;
}

.booking-success-msg {
    padding: 20px;
    text-align: center;
}

.booking-success-icon {
    font-size: 48px;
}

.booking-success-title {
    color: #28a745;
    margin: 10px 0;
}

#booking-new-btn {
    margin-top: 10px;
}

.booking-error-msg {
    color: #dc3545;
    margin-top: 10px;
    padding: 10px;
    background: #fde8e8;
    border-radius: 4px;
}

.ac-my-bookings-notice {
    margin: 12px 0;
    padding: 10px;
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
}

.ac-my-bookings-table {
    width: 100%;
    border-collapse: collapse;
}

.ac-my-bookings-cancel-form {
    margin: 0;
}

.blocked-date a {
    background-color: #f2dede !important;
    color: #a94442 !important;
    cursor: not-allowed !important;
}

.no-slots a {
    background-color: #ffd3cd !important;
    color: #856404 !important;
    cursor: not-allowed !important;
}

/* inputs */
#appointment-booking-panel input,
#appointment-booking-panel select,
#appointment-form input,
#appointment-form select,
.appointment-booking-panel input,
.appointment-booking-panel select {
    width: 100%;
    padding: 10px;
    margin: 0 0 10px 0;
    background: var(--g5-color-background-input);
    color: var(--g5-color-text-input);
    border: 1px solid var(--g5-color-border-input);
    border-radius: 3px;
}

/* focus */
#appointment-booking-panel input:focus,
#appointment-booking-panel select:focus,
#appointment-form input:focus,
#appointment-form select:focus,
.appointment-booking-panel input:focus,
.appointment-booking-panel select:focus {
    border-color: var(--g5-color-border-input-forcus);
    outline: none;
}

/* submit button FULL WIDTH */
#appointment-booking-panel button,
#appointment-booking-panel input[type="submit"],
#appointment-form button,
#appointment-form input[type="submit"],
.appointment-booking-panel button,
.appointment-booking-panel input[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--g5-color-accent);
    color: var(--g5-color-primary-foreground);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: 0.2s ease;
}

#appointment-booking-panel button:hover,
#appointment-booking-panel input[type="submit"]:hover,
#appointment-form button:hover,
#appointment-form input[type="submit"]:hover,
.appointment-booking-panel button:hover,
.appointment-booking-panel input[type="submit"]:hover {
    background:  var(--g5-color-primary);
}

/* ============================= */
/* DATEPICKER */
/* ============================= */
.ui-widget.ui-widget-content {
    border: 1px solid #eeeeee00 !important;
}

.ui-datepicker {
    width: auto !important;
    background: var(--g5-color-light);
    border: 1px solid var(--g5-color-border);
    padding: .2em !important;
}

/* header */
.ui-datepicker-header {
    background: var(--g5-color-primary);
    color: var(--g5-color-primary-foreground);
    height: 40px;
    line-height: 40px !important;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
}

/* nav */
.ui-datepicker-prev,
.ui-datepicker-next {
    width: 40px;
    font-size: 1.125em;
    font-weight: bold;
    padding: 0 10px;
    cursor: pointer;
    color: var(--g5-color-primary-foreground);
}

/* table */
.ui-datepicker-calendar {
    width: 100%;
    border-top: 1px solid var(--g5-color-border);
    border-collapse: collapse;
}

.ui-datepicker-calendar th {
    color: var(--g5-color-muted);
    line-height: 30px !important;
}

.ui-datepicker-calendar td {
    width: 14.28%;
    border-left: 1px solid var(--g5-color-border);
    text-align: center;
    height: 30px;
}

.ui-datepicker-calendar td:first-child {
    border-left: none;
}

.ui-datepicker td a {
    display: block;
    padding: 1em !important;
    text-decoration: none;
    color: var(--g5-color-heading);
    text-align: center !important;
}

/* states */
.ui-datepicker-calendar td a.ui-state-active {
    background: var(--g5-color-accent);
    color: var(--g5-color-accent-foreground) !important;
}

.ui-datepicker-calendar td a.ui-state-highlight {
    background: var(--g5-color-light-brightness);
}

.ui-datepicker-calendar td a.ui-state-disabled {
    background-color: var(--g5-color-danger-brightness) !important;
    color: var(--g5-color-danger-foreground) !important;
}

/* ============================= */
/* RESPONSIVE */
/* ============================= */
@media (max-width: 992px) {
    #appointment-calendar .row {
        flex-direction: column;
    }
}
/* ============================= */
/* STATES */
/* ============================= */

/* TODAY */
.ui-datepicker-calendar td a.ui-state-highlight {
    background: var(--g5-color-light-brightness);
    border: 1px solid var(--g5-color-border) !important;
    color: var(--g5-color-heading) !important;
    display: block !important;
}

/* DISABLED */
.ui-datepicker-calendar td a.ui-state-disabled {
    background-color: var(--g5-color-danger-brightness) !important;
    color: var(--g5-color-danger-foreground) !important;
    cursor: not-allowed !important;
    display: block !important;
}

/* ACTIVE (SELECTED DATE) */
.ui-datepicker-calendar td a.ui-state-active {
    background: var(--g5-color-accent);
    color: var(--g5-color-accent-foreground) !important;
    border: 1px solid var(--g5-color-accent) !important;
}

/* WEEKEND */
.ui-datepicker-calendar tbody .ui-datepicker-week-end .ui-state-default {
    color: var(--g5-color-muted);
    font-weight: 700;
}

/* NORMAL DAYS */
.ui-datepicker-calendar tbody .ui-state-default {
    color: var(--g5-color-heading);
    font-weight: 700;
}

/* UNSELECTABLE */
.ui-datepicker-calendar tbody .ui-datepicker-unselectable.ui-state-disabled .ui-state-default {
    color: var(--g5-color-muted);
    opacity: 0.5;
    text-align: center;
    padding: 1em;
    font-weight: 700;
}