/* ================================================================
 * Parish Booking Manager — Availability Calendar Widget CSS
 * Shortcode: [pbm_availability]
 * Self-contained: no dependency on pbm-public.css
 * ================================================================ */

/* ── Variables ─────────────────────────────────────────────────── */
.pbm-av-wrap {
    --av-primary:    #1a4a7a;
    --av-primary-lt: #e8f0fa;
    --av-gold:       #b8860b;
    --av-green:      #2e7d32;
    --av-orange:     #e65100;
    --av-red:        #c62828;
    --av-grey:       #607d8b;
    --av-border:     #d9e2ef;
    --av-bg:         #f8fafc;
    --av-white:      #ffffff;
    --av-text:       #1a2332;
    --av-muted:      #6b7a8d;
    --av-radius:     10px;
    --av-shadow:     0 2px 16px rgba(26,74,122,.09);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--av-text);
    max-width: 680px;
    margin: 0 auto;
    box-sizing: border-box;
}
.pbm-av-wrap *, .pbm-av-wrap *::before, .pbm-av-wrap *::after {
    box-sizing: border-box;
}

/* ── Heading ───────────────────────────────────────────────────── */
.pbm-av-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--av-primary);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--av-border);
}

/* ── Controls bar ──────────────────────────────────────────────── */
.pbm-av-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.pbm-av-control-group { flex: 1; min-width: 200px; }
.pbm-av-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--av-muted);
    margin-bottom: 7px;
}

/* ── Auditorium tabs ───────────────────────────────────────────── */
.pbm-av-aud-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pbm-av-aud-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 14px;
    background: var(--av-white);
    border: 1.5px solid var(--av-border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--av-muted);
    transition: all .18s;
    line-height: 1.2;
}
.pbm-av-aud-tab small {
    font-size: 10px;
    font-weight: 400;
    color: var(--av-muted);
}
.pbm-av-aud-tab:hover {
    border-color: var(--av-primary);
    color: var(--av-primary);
    background: var(--av-primary-lt);
}
.pbm-av-aud-tab.active {
    background: var(--av-primary);
    border-color: var(--av-primary);
    color: var(--av-white);
    box-shadow: 0 2px 8px rgba(26,74,122,.22);
}
.pbm-av-aud-tab.active small { color: rgba(255,255,255,.75); }

/* ── Month navigation ──────────────────────────────────────────── */
.pbm-av-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pbm-av-nav-btn {
    width: 34px; height: 34px;
    border: 1.5px solid var(--av-border);
    border-radius: 50%;
    background: var(--av-white);
    cursor: pointer;
    font-size: 14px;
    color: var(--av-primary);
    display: flex; align-items: center; justify-content: center;
    transition: all .18s;
    flex-shrink: 0;
}
.pbm-av-nav-btn:hover {
    background: var(--av-primary);
    border-color: var(--av-primary);
    color: var(--av-white);
}
.pbm-av-month-label {
    font-size: 17px;
    font-weight: 700;
    color: var(--av-primary);
    min-width: 160px;
    text-align: center;
}

/* ── Legend ────────────────────────────────────────────────────── */
.pbm-av-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.pbm-av-leg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 12px;
}
.pbm-av-leg::before {
    content: '';
    display: block;
    width: 10px; height: 10px;
    border-radius: 3px;
}
.pbm-av-leg.available { background: #e8f5e9; color: #2e7d32; }
.pbm-av-leg.available::before { background: #4caf50; }
.pbm-av-leg.pending   { background: #fff8e1; color: #e65100; }
.pbm-av-leg.pending::before   { background: #ffb300; }
.pbm-av-leg.confirmed { background: #fce4ec; color: #c62828; }
.pbm-av-leg.confirmed::before { background: #ef5350; }
.pbm-av-leg.blocked   { background: #eceff1; color: #607d8b; }
.pbm-av-leg.blocked::before   { background: #90a4ae; }

/* ── Calendar wrap ─────────────────────────────────────────────── */
.pbm-av-calendar-wrap {
    background: var(--av-white);
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius);
    overflow: hidden;
    box-shadow: var(--av-shadow);
}

/* ── Calendar table ────────────────────────────────────────────── */
.pbm-av-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.pbm-av-table thead th {
    padding: 10px 4px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--av-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    background: var(--av-bg);
    border-bottom: 1px solid var(--av-border);
}
.pbm-av-table tbody td {
    padding: 4px;
    border: 1px solid #edf1f6;
    vertical-align: top;
    min-height: 64px;
}
.pbm-av-cell { background: var(--av-white); }
.pbm-av-empty { background: var(--av-bg); }
.pbm-av-today { background: #fffde7 !important; }

/* ── Day number ────────────────────────────────────────────────── */
.pbm-av-day-num {
    font-size: 13px;
    font-weight: 600;
    color: var(--av-text);
    text-align: center;
    padding: 4px 0 3px;
    line-height: 1;
}
.pbm-av-today-num {
    color: var(--av-white) !important;
    background: var(--av-primary);
    border-radius: 50%;
    width: 22px; height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* ── Slot pills ────────────────────────────────────────────────── */
.pbm-av-slots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 2px;
}
.pbm-av-slot {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 2px;
    border-radius: 4px;
    letter-spacing: .3px;
    text-transform: uppercase;
    line-height: 1.2;
    border: none;
    cursor: default;
    transition: transform .12s, box-shadow .12s;
}
/* Status colours */
.pbm-av-slot-available { background: #c8e6c9; color: #1b5e20; }
.pbm-av-slot-pending   { background: #fff9c4; color: #e65100; }
.pbm-av-slot-confirmed { background: #ffcdd2; color: #b71c1c; }
.pbm-av-slot-blocked   { background: #cfd8dc; color: #455a64; }
.pbm-av-slot-past      { background: #f5f5f5; color: #bdbdbd; }

/* Clickable slots */
.pbm-av-slot-btn {
    cursor: pointer;
    outline: none;
}
.pbm-av-slot-btn:hover {
    transform: scale(1.07);
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
    position: relative;
    z-index: 1;
}
.pbm-av-slot-btn:focus-visible {
    outline: 2px solid var(--av-primary);
    outline-offset: 1px;
}
/* Selected state */
.pbm-av-slot.pbm-av-selected {
    outline: 2px solid var(--av-primary);
    outline-offset: 1px;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(26,74,122,.25);
    position: relative;
    z-index: 2;
}

/* ── Loading spinner ───────────────────────────────────────────── */
.pbm-av-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--av-muted);
    font-size: 14px;
}
.pbm-av-spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--av-border);
    border-top-color: var(--av-primary);
    border-radius: 50%;
    animation: pbm-av-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes pbm-av-spin { to { transform: rotate(360deg); } }

/* ── Info bar ──────────────────────────────────────────────────── */
.pbm-av-info-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--av-primary-lt);
    border: 1px solid #c0d4ef;
    border-left: 4px solid var(--av-primary);
    border-radius: 0 var(--av-radius) var(--av-radius) 0;
    padding: 12px 16px;
    animation: pbm-av-fade-in .2s ease;
}
@keyframes pbm-av-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pbm-av-info-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--av-primary);
    font-weight: 500;
    flex: 1;
}
.pbm-av-info-icon { font-size: 18px; flex-shrink: 0; }

/* ── Book button ───────────────────────────────────────────────── */
.pbm-av-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--av-primary);
    color: var(--av-white) !important;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background .18s;
    flex-shrink: 0;
    white-space: nowrap;
}
.pbm-av-book-btn:hover {
    background: #163d66;
    color: var(--av-white) !important;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .pbm-av-controls  { flex-direction: column; align-items: flex-start; }
    .pbm-av-month-label { min-width: 120px; font-size: 15px; }
    .pbm-av-slot      { font-size: 9px; padding: 2px 1px; }
    .pbm-av-day-num   { font-size: 11px; }
    .pbm-av-table thead th { font-size: 10px; padding: 8px 2px; }
    .pbm-av-info-bar  { flex-direction: column; align-items: flex-start; }
    .pbm-av-book-btn  { width: 100%; justify-content: center; }
}

/* =====================================================================
 * SLOT INFO PANEL — availability-calendar.php
 * ===================================================================== */
.pbm-av-info-panel {
    margin-top: 16px;
    border: 1px solid var(--av-border);
    border-radius: var(--av-radius);
    overflow: hidden;
    box-shadow: var(--av-shadow);
    animation: pbm-av-fade-in .22s ease;
}

/* Date/slot header bar */
.pbm-av-info-header { background: var(--av-bg); padding: 0; }
.pbm-av-info-date {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 18px;
    border-left: 5px solid var(--av-primary);
    background: var(--av-white);
}
.pbm-av-info-slot    { font-size: 15px; font-weight: 700; color: var(--av-primary); }
.pbm-av-info-dateval { font-size: 13px; color: var(--av-muted); }

/* Category buttons (inside info panel) */
.pbm-av-cost-box {
    padding: 18px 18px 0;
    border-bottom: 1px solid var(--av-border);
}
.pbm-av-cost-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--av-primary);
    margin-bottom: 4px;
}
.pbm-av-cost-note {
    font-size: 12px;
    color: var(--av-muted);
    margin-bottom: 12px;
}
.pbm-av-category-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.pbm-av-cat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 2px solid var(--av-border);
    border-radius: 10px;
    background: var(--av-bg);
    cursor: pointer;
    font-size: 12px;
    transition: all .18s;
    text-align: center;
}
.pbm-av-cat-btn:hover  { border-color: var(--av-primary); background: #e8f0fa; }
.pbm-av-cat-btn.active { border-color: var(--av-primary); background: var(--av-primary); color: #fff; }
.pbm-av-cat-btn.active .pbm-av-cat-desc { color: rgba(255,255,255,.75); }
.pbm-av-cat-icon  { font-size: 20px; }
.pbm-av-cat-label { font-weight: 700; font-size: 13px; }
.pbm-av-cat-desc  { font-size: 10px; color: var(--av-muted); line-height: 1.3; }

/* Cost breakdown table */
.pbm-av-cost-breakdown {
    background: #f8fafc;
    border: 1px solid var(--av-border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    animation: pbm-av-fade-in .18s ease;
}
.pbm-av-cost-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pbm-av-cost-table td { padding: 5px 0; }
.pbm-av-cost-table td:last-child { text-align: right; }
.pbm-av-cost-table tr + tr td { border-top: 1px solid #eef1f4; }
.pbm-av-cost-val       { font-weight: 700; }
.pbm-av-cost-advance   { color: #b8860b; font-size: 14px; }
.pbm-av-cost-balance   { color: var(--av-muted); }
.pbm-av-cost-note-row td { padding: 4px 0; }
.pbm-av-cost-advance-row td { background: #fdf6e3; border-radius: 4px; padding: 7px 4px; }
.pbm-av-gst-note {
    font-size: 11px;
    color: var(--av-muted);
    margin-top: 8px;
    line-height: 1.5;
}
.pbm-av-no-price-msg {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: #0d47a1;
    margin-bottom: 12px;
}

/* Office CTA block */
.pbm-av-office-cta {
    padding: 16px 18px 20px;
    background: var(--av-white);
}
.pbm-av-office-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--av-primary);
    margin-bottom: 6px;
}
.pbm-av-office-desc {
    font-size: 13px;
    color: var(--av-muted);
    margin: 0 0 12px;
    line-height: 1.6;
}
.pbm-av-office-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.pbm-av-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all .18s;
}
.pbm-av-contact-phone {
    background: #e8f5e9;
    color: #2e7d32 !important;
    border: 1.5px solid #a5d6a7;
}
.pbm-av-contact-phone:hover { background: #c8e6c9; }
.pbm-av-contact-email {
    background: var(--av-primary-lt, #e8f0fa);
    color: var(--av-primary) !important;
    border: 1.5px solid #c0d4ef;
}
.pbm-av-contact-email:hover { background: #cce0f5; }
.pbm-av-office-hours {
    font-size: 12px;
    color: var(--av-muted);
    margin-top: 4px;
}

/* Unavailable message */
.pbm-av-unavail-msg {
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 600;
    border-left: 5px solid #ccc;
    margin: 12px 18px;
    border-radius: 0 8px 8px 0;
}
.pbm-av-unavail-confirmed { border-left-color: #ef5350; color: #c62828; background: #fce4ec; }
.pbm-av-unavail-blocked   { border-left-color: #90a4ae; color: #546e7a; background: #eceff1; }
.pbm-av-unavail-past      { border-left-color: #bdbdbd; color: #757575; background: #f5f5f5; }

@media (max-width: 480px) {
    .pbm-av-category-grid { grid-template-columns: 1fr 1fr; }
    .pbm-av-office-contacts { flex-direction: column; }
    .pbm-av-contact-btn { width: 100%; justify-content: center; }
}

/* =====================================================================
 * [pbm_availability_book] — Book This Slot CTA
 * ===================================================================== */
.pbm-avb-book-cta {
    padding: 16px 18px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #e8f0fa 100%);
    border-top: 1px solid var(--av-border);
}
.pbm-avb-book-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.pbm-avb-book-cta-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}
.pbm-avb-book-cta-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--av-primary);
}
.pbm-avb-book-cta-text span {
    font-size: 12px;
    color: var(--av-muted);
    line-height: 1.5;
}
.pbm-avb-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--av-primary);
    color: var(--av-white) !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background .18s, transform .12s;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(26,74,122,.25);
}
.pbm-avb-book-btn:hover {
    background: #163d66;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(26,74,122,.35);
}

/* Payment deadline notice (inside cost breakdown) */
.pbm-avb-deadline-notice {
    margin-top: 12px;
    background: #f8fafc;
    border: 1px solid var(--av-border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pbm-avb-deadline-row {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
}
.pbm-avb-deadline-row strong { color: var(--av-primary); }
.pbm-avb-gst-row {
    font-size: 11px;
    color: var(--av-muted);
    border-top: 1px solid var(--av-border);
    padding-top: 6px;
    margin-top: 2px;
}

@media (max-width: 480px) {
    .pbm-avb-book-cta-inner { flex-direction: column; align-items: flex-start; }
    .pbm-avb-book-btn { width: 100%; justify-content: center; }
}

/* =====================================================================
 * AVAILABILITY + BOOK TEMPLATE  [pbm_availability_book]
 * ===================================================================== */

/* Book CTA block */
.pbm-avb-book-cta {
    padding: 16px 18px 20px;
    background: linear-gradient(135deg, #e8f5e9 0%, #e8f0fa 100%);
    border-top: 1px solid var(--av-border);
}
.pbm-avb-book-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.pbm-avb-book-cta-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 160px;
}
.pbm-avb-book-cta-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--av-primary, #1a4a7a);
}
.pbm-avb-book-cta-text span {
    font-size: 12px;
    color: var(--av-muted, #6b7a8d);
    line-height: 1.5;
}
.pbm-avb-book-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    background: var(--av-primary, #1a4a7a);
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .18s, transform .12s, box-shadow .18s;
    box-shadow: 0 3px 10px rgba(26,74,122,.25);
    flex-shrink: 0;
}
.pbm-avb-book-btn:hover {
    background: #163d66;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(26,74,122,.32);
    color: #fff !important;
}

/* Payment deadline notice inside cost box */
.pbm-avb-deadline-notice {
    background: #f8fafc;
    border: 1px solid var(--av-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 12px;
    line-height: 1.8;
    color: #444;
}
.pbm-avb-deadline-row {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    flex-wrap: wrap;
}
.pbm-avb-gst-row {
    color: var(--av-muted, #6b7a8d);
    margin-top: 4px;
}

@media (max-width: 520px) {
    .pbm-avb-book-cta-inner { flex-direction: column; align-items: flex-start; }
    .pbm-avb-book-btn { width: 100%; justify-content: center; }
}
