/**
 * SVC Badbelegung — Resource Widget Styles
 * Extends front.css for [svc_ressource] shortcode.
 */

/* Single-unit status pill */
.svc-bb-resource-status-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1em;
    margin: 8px 0;
    border: 2px solid transparent;
    transition: background 0.3s, border-color 0.3s;
}

.svc-bb-resource-status-pill.is-free {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}

.svc-bb-resource-status-pill.is-booked {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

.svc-bb-resource-status-pill.is-closed {
    background: #F3F4F6;
    border-color: #D1D5DB;
    color: #6B7280;
}

.svc-bb-resource-status-muted {
    opacity: 0.75;
    font-size: 1em;
}

.svc-bb-resource-status-pill .svc-bb-status-icon {
    font-size: 1.3em;
    line-height: 1;
}

.svc-bb-resource-status-pill .svc-bb-status-act {
    font-size: 1em;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 4px;
}

/* ── Resource Plan: shared wrapper ──────────────────────────────── */
.svc-bb-res-plan {
    font-family: inherit;
}
.svc-bb-res-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.svc-bb-res-plan-title {
    margin: 0;
    font-size: 1.15em;
}

/* ── Week view navigation ───────────────────────────────────────── */
.svc-bb-res-plan-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.svc-bb-res-plan-nav-label {
    font-weight: 600;
    font-size: 1em;
}

/* ── Week grid ──────────────────────────────────────────────────── */
.svc-bb-res-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    overflow-x: auto;
}
@media (max-width: 700px) {
    .svc-bb-res-week-grid {
        grid-template-columns: repeat(4, minmax(80px, 1fr));
    }
}
@media (max-width: 440px) {
    .svc-bb-res-week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.svc-bb-res-week-col {
    min-width: 0;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}
.svc-bb-res-week-col.is-today {
    border-color: #93C5FD;
}
.svc-bb-res-week-col-hdr {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    gap: 2px;
}
.svc-bb-res-week-col.is-today .svc-bb-res-week-col-hdr {
    background: #EFF6FF;
    border-bottom-color: #93C5FD;
}
.svc-bb-res-week-col-day {
    font-size: 1em;
    color: #6B7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.svc-bb-res-week-col-num {
    font-size: 1em;
    font-weight: 700;
    color: #374151;
    line-height: 1;
}
.svc-bb-res-week-col-num.is-today {
    color: #2563EB;
}
.svc-bb-res-week-col-events {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 48px;
}
.svc-bb-res-no-event {
    color: #D1D5DB;
    font-size: 1em;
    text-align: center;
    padding: 8px 0;
}
.svc-bb-res-event-card {
    border-left: 3px solid transparent;
    border-radius: 5px;
    padding: 5px 7px;
    font-size: 1em;
    line-height: 1.3;
}
.svc-bb-res-event-time {
    font-size: 1em;
    opacity: 0.75;
    margin-bottom: 2px;
}
.svc-bb-res-event-label {
    font-weight: 600;
}
.svc-bb-res-event-slots {
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

/* ── List view ──────────────────────────────────────────────────── */
.svc-bb-res-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.svc-bb-res-list-group {}
.svc-bb-res-list-date-hdr {
    font-weight: 700;
    font-size: 1em;
    color: #374151;
    padding-bottom: 6px;
    border-bottom: 2px solid #E5E7EB;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.svc-bb-res-list-group.is-today .svc-bb-res-list-date-hdr {
    border-bottom-color: #93C5FD;
    color: #1D4ED8;
}
.svc-bb-res-list-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-left: 4px solid transparent;
    border-radius: 0 6px 6px 0;
    background: #F9FAFB;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.svc-bb-res-list-time {
    font-size: 1em;
    color: #6B7280;
    white-space: nowrap;
    min-width: 90px;
}
.svc-bb-res-list-label {
    font-weight: 600;
    flex: 1;
    min-width: 100px;
}
.svc-bb-res-list-activity {
    font-weight: 400;
    color: #6B7280;
    margin-left: 4px;
}
.svc-bb-res-list-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

/* ── List view: continuation rows & conflict ────────────────────── */
.svc-bb-res-list-row.is-continuation {
    background: #FAFAFA;
    opacity: 0.82;
    border-left-style: dashed;
}
.svc-bb-res-list-cont-icon {
    color: #9CA3AF;
    margin-right: 3px;
}
.svc-bb-res-conflict-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    padding: 1px 8px;
    margin-left: 4px;
}

/* ── Month grid ──────────────────────────────────────────────────── */
.svc-bb-res-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}
.svc-bb-res-month-day-hdr {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
    border-right: 1px solid #E5E7EB;
    text-align: center;
    font-size: 1em;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 5px 2px;
}
.svc-bb-res-month-day-hdr:last-child {
    border-right: none;
}
.svc-bb-res-month-cell {
    min-height: 80px;
    padding: 4px;
    background: #fff;
    border-right: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    vertical-align: top;
    overflow: hidden;
}
/* Remove right border on last column of each row */
.svc-bb-res-month-cell:nth-child(7n) {
    border-right: none;
}
.svc-bb-res-month-cell.is-other-month {
    background: #F9FAFB;
}
.svc-bb-res-month-cell.is-today {
    background: #EFF6FF;
}
.svc-bb-res-month-cell-num {
    font-size: 1em;
    font-weight: 700;
    color: #374151;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1.2;
}
.svc-bb-res-month-cell-num.is-today {
    color: #2563EB;
}
.svc-bb-res-month-conflict {
    font-size: 1em;
    color: #D97706;
}

/* Event pills inside month cells */
.svc-bb-res-month-pill {
    display: block;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.2;
    padding: 2px 5px;
    margin-bottom: 2px;
    border: 1px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}
.svc-bb-res-month-pill.is-solo {
    border-radius: 4px;
}
/* Multi-day: start/middle/end use negative horizontal margins to
   visually connect across the cell padding, forming a continuous bar */
.svc-bb-res-month-pill.is-start {
    border-radius: 4px 0 0 4px;
    margin-right: -5px;
    padding-right: 0;
}
.svc-bb-res-month-pill.is-middle {
    border-radius: 0;
    margin-left: -5px;
    margin-right: -5px;
    padding-left: 2px;
    padding-right: 0;
    opacity: 0.85;
}
.svc-bb-res-month-pill.is-end {
    border-radius: 0 4px 4px 0;
    margin-left: -5px;
    padding-left: 2px;
    opacity: 0.85;
}
.svc-bb-res-month-more {
    font-size: 1em;
    color: #6B7280;
    padding: 1px 3px;
}

@media (max-width: 560px) {
    .svc-bb-res-month-cell {
        min-height: 56px;
        padding: 2px;
    }
    .svc-bb-res-month-pill {
        font-size: 0;  /* hide text on very small screens, keep color bar */
        padding: 4px 2px;
        margin-right: 0 !important;
        margin-left:  0 !important;
        border-radius: 3px !important;
    }
    .svc-bb-res-month-cell-num {
        font-size: 1em;
    }
}

/* Admin: opening hours table — closed row styling */
.svc-bb-oh-table tr.svc-bb-oh-closed td {
    opacity: 0.4;
}
.svc-bb-oh-table tr.svc-bb-oh-closed td:first-child {
    opacity: 1; /* Day name always readable */
    color: #9CA3AF;
}
.svc-bb-oh-table tr.svc-bb-oh-closed input[type="time"] {
    background: #F3F4F6;
    color: #9CA3AF;
    cursor: not-allowed;
}

/* Admin: opening hours table */
.svc-bb-oh-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 480px;
}
.svc-bb-oh-table th,
.svc-bb-oh-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #E5E7EB;
}
.svc-bb-oh-table th {
    font-weight: 600;
    font-size: 1em;
    color: #6B7280;
}
.svc-bb-oh-table input[type="time"] {
    padding: 3px 6px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
}
