/* Business Hours Component Styles */
/* Shared styles for business hours forms across all modals */

/* Compact form styling */
.business-hours-modal .compact-floating .form-floating > label {
    padding: 0.625rem 0.75rem;
}

.business-hours-modal .compact-floating .form-floating > .form-control,
.business-hours-modal .compact-floating .form-floating > .form-select {
    padding: 1rem 0.75rem 0.25rem;
}

/* Collection container styling (holidays/vacation) */
.collection-container [data-enhanced-collection-target="container"] {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.collection-container [data-enhanced-collection-target="entry"] + button {
    display: none; /* Hide default remove button since we move it inline */
}

.collection-flex-row {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.collection-flex-row .flex-grow-1 {
    flex: 1 1 auto;
}

.collection-container .btn-outline-danger {
    min-width: 32px;
}

/* Collection table styling */
.collection-container .compact-table table {
    font-size: 0.9rem;
    width: 100%;
}

.collection-container .compact-table thead th {
    background: #f8fafc;
    padding: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.collection-container .compact-table tbody td {
    padding: 6px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.collection-container .compact-table .form-control {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.collection-container .compact-table input[type="date"] {
    width: auto;
    min-width: 140px;
}

.collection-container .compact-table input[type="text"] {
    width: 100%;
    min-width: 150px;
}

/* Collection item styling */
.collection-container [data-enhanced-collection-target="entries"] > div {
    display: table-row;
}

.collection-container [data-enhanced-collection-target="entry"] {
    display: table-row;
    white-space: nowrap;
}

.collection-container [data-enhanced-collection-target="entry"] > div {
    display: inline-block;
    padding: 6px 4px;
    vertical-align: middle;
}

.collection-container tr td:first-child {
    width: 100%;
}

/* Business hours specific styling */
.business-hours-form .time-input {
    font-size: 0.875rem;
}

.business-hours-form .day-toggle {
    margin-top: 0.5rem;
}

/* Quick action buttons */
.business-hours-modal .btn-outline-primary:hover,
.business-hours-modal .btn-outline-info:hover,
.business-hours-modal .btn-outline-success:hover,
.business-hours-modal .btn-outline-danger:hover {
    color: #fff;
}

/* Card styling adjustments */
.business-hours-modal .card-header h6 {
    margin: 0;
}

/* Modal width for business hours forms */
@media (min-width: 992px) {
    .business-hours-modal .modal-dialog {
        max-width: 1100px;
    }
}

/* Specific container classes */
.holidays-container {
    /* Inherits from collection-container */
}

.vacation-container {
    /* Inherits from collection-container */
}

/* Business hours widget (form/business_hours.html.twig) */
/* Kept in the global stylesheet so it applies inside Turbo Stream modals */
/* FROSTED + COMPRESSED (2026-07): glass surfaces on the tinted modal card,
   tight day rows, per-day slider scale labels hidden (master keeps them),
   icon-only [+] next to each day's hours badge. */
.business-hours-widget .master-control {
    background: rgba(255, 255, 255, .45) !important;
    border: 1px solid rgba(255, 255, 255, .65) !important;
    border-radius: 12px !important;
    padding: 6px 12px !important;
    margin-bottom: 10px !important;
}

.business-hours-widget .day-row {
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 11px;
    padding: 3px 10px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, .45);
    transition: background .15s ease;
}
.business-hours-widget .day-row:hover {
    background: rgba(255, 255, 255, .6);
}

.business-hours-widget .day-row.day-off {
    background: rgba(255, 255, 255, .2);
    opacity: 0.65;
}

.business-hours-widget .day-name {
    font-weight: 700;
    color: #12233b;
    font-size: 13px;
    min-width: 40px;
}

/* hours total → soft badge (badge-soft b-blue look), reads as a label not a button.
   HARD width: the value re-computes live ("8 hrs" → "10.5 hrs" → "OFF") and a
   fluid badge shoved its neighbors around on every change. */
.business-hours-widget .hours-badge {
    background: rgba(37, 116, 166, 0.14);
    color: #1d5c86;
    border: 1px solid rgba(37, 116, 166, 0.3);
    padding: 3px 4px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    text-align: center;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.business-hours-widget .hours-badge.off {
    background: rgba(100, 116, 139, 0.14) !important;
    color: #475569;
    border-color: rgba(100, 116, 139, 0.3);
}

.business-hours-widget .time-input,
.business-hours-widget input[type="time"] {
    border: 1px solid rgba(255, 255, 255, .7);
    background-color: rgba(255, 255, 255, .5);
    border-radius: 8px;
    padding: 3px 7px;
    font-size: 12px;
    width: 74px;
}

.business-hours-widget .time-input:focus {
    background-color: rgba(255, 255, 255, .78);
    border-color: #8fc4ec;
    box-shadow: 0 0 0 3px rgba(38, 116, 166, .16);
}

.business-hours-widget .slot-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 3px;
}

.business-hours-widget .slot-row:last-child {
    margin-bottom: 0;
}

.business-hours-widget .time-slider-container {
    position: relative;
    flex: 1 1 auto;
    min-width: 180px;
}

.business-hours-widget .time-slider {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 4px;
    margin: 12px 0 5px 0;
}

/* per-day scale labels eat ~14px per row — the master control's scale is enough */
.business-hours-widget .day-row .time-slider-labels {
    display: none;
}
.business-hours-widget .day-row .time-slider {
    margin: 10px 0;
}

.business-hours-widget .time-slider-range {
    position: absolute;
    height: 100%;
    /* solid dark green — the theme's --bit-badge-success is a pale badge FILL
       tint (e.g. #e6f5d0) that was unreadable as the selected-hours bar */
    background: linear-gradient(135deg, #22c55e, #15803d);
    border-radius: 3px;
    top: 0;
}

.business-hours-widget .time-slider-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid #16a34a;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}

.business-hours-widget .time-slider-handle:active {
    cursor: grabbing;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.business-hours-widget .time-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 2px;
    color: #999;
    font-size: 9px;
    padding: 0 3px;
}

.business-hours-widget .time-slider-tooltip {
    position: absolute;
    background: #333;
    color: white;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    transform: translateX(-50%);
    bottom: 100%;
    margin-bottom: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.business-hours-widget .time-slider-handle:hover .time-slider-tooltip,
.business-hours-widget .time-slider-handle:active .time-slider-tooltip {
    opacity: 1;
}

/* icon-only [+] chip next to the hours badge */
.business-hours-widget .btn-add-slot {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    font-size: 11px;
    padding: 0;
    color: #1d5c86;
    background: rgba(37, 116, 166, .1);
    border: 1px dashed rgba(37, 116, 166, .4);
    border-radius: 8px;
    line-height: 1;
}

.business-hours-widget .btn-add-slot:hover {
    background: rgba(37, 116, 166, .2);
    border-style: solid;
    color: #112a54;
}

.business-hours-widget .btn-remove-slot {
    border: 1px solid rgba(220, 38, 38, .28);
    color: #b91c1c;
    background: rgba(220, 38, 38, .12);
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 1.2;
}

.business-hours-widget .btn-remove-slot:hover {
    background: rgba(220, 38, 38, .25);
    border-color: rgba(220, 38, 38, .45);
    color: #7f1d1d;
}

.business-hours-widget .form-check-input {
    cursor: pointer;
}
/* ============================================================
   Compact frosted layout (.bh-compact) — employee working hours
   (single column: hero pills, inline quick chips, stat strip)
   ============================================================ */

/* live stat pills in the hero sub-row; the controller rewrites the inner
   badge markup (<span class="badge bg-success">…), so neutralize it here */
.bh-hd-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .23);
    color: #fff;
    /* hard width — the inner totals are rewritten live and a fluid pill
       shifted everything after it on each recalc */
    width: 96px;
    flex: 0 0 96px;
    white-space: nowrap;
    overflow: hidden;
}
.bh-hd-pill strong {
    display: inline-block;
    text-align: center;
    min-width: 0;
}
.bh-hd-pill .badge {
    background: transparent !important;
    color: #fff !important;
    padding: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

/* eyebrow heading with right-pinned actions */
.bh-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8aa0bd;
    margin: 0 0 8px;
}
.bh-eyebrow .bh-gap { flex: 1 1 auto; }

/* quick-action chips (replace the Quick Actions side panel) */
.bh-quick-chips {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.bh-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: #1d5c86;
    background: rgba(255, 255, 255, .5);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 99px;
    padding: 3px 11px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.bh-chip:hover {
    background: rgba(255, 255, 255, .85);
    color: #112a54;
}
.bh-chip.danger { color: #b91c1c; }
.bh-chip.danger:hover { background: rgba(254, 226, 226, .8); }

/* one-row summary strip (replaces the Summary side panel) */
.bh-summary-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, .45);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 11px;
    padding: 6px 10px;
    margin: 10px 0;
}
.bh-summary-strip .bh-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    font-weight: 600;
    color: #41597a;
    padding: 2px 9px;
    border-radius: 99px;
}
/* hard width on the live values so recalcs don't ripple the whole strip */
.bh-summary-strip .bh-stat b {
    display: inline-block;
    width: 54px;
    min-width: 54px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bh-summary-strip .bh-stat + .bh-stat {
    border-left: 1px solid rgba(255, 255, 255, .75);
    border-radius: 0;
}
.bh-summary-strip .bh-stat i { color: #2674a6; font-size: .78rem; }
.bh-summary-strip .bh-stat b { color: #12233b; font-weight: 800; }

/* slim inherit-hours toggle row (replaces the alert-info block) */
.bh-inherit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 11px;
    background: rgba(255, 255, 255, .45);
    margin-bottom: 10px;
}
.bh-inherit-row .tx { min-width: 0; }
.bh-inherit-row .tx b { font-size: .82rem; font-weight: 700; display: block; color: #12233b; }
.bh-inherit-row .tx span { font-size: .71rem; color: #41597a; }
.bh-inherit-row > div[data-controller] { margin-left: auto; flex: 0 0 auto; }

/* the compact layout trims the master control's inner spacing further */
.bh-compact .master-control .time-slider { margin-top: 12px; }
.bh-compact .master-control .time-slider-labels { margin-top: 0; }

/* ============================================================
   Per-panel scrollbars — the modal itself never scrolls; the
   Weekly Schedule day list and the holiday/vacation list each
   scroll independently with a slim frosted scrollbar.
   ============================================================ */
.business-hours-widget .schedule-container,
.bh-collection-scroll {
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(65, 89, 122, .35) transparent;
}
.business-hours-widget .schedule-container { max-height: min(38vh, 340px); }
.bh-collection-scroll { max-height: min(22vh, 190px); }

.business-hours-widget .schedule-container::-webkit-scrollbar,
.bh-collection-scroll::-webkit-scrollbar {
    width: 6px;
}
.business-hours-widget .schedule-container::-webkit-scrollbar-thumb,
.bh-collection-scroll::-webkit-scrollbar-thumb {
    background: rgba(65, 89, 122, .35);
    border-radius: 99px;
}
.business-hours-widget .schedule-container::-webkit-scrollbar-thumb:hover,
.bh-collection-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(65, 89, 122, .55);
}
.business-hours-widget .schedule-container::-webkit-scrollbar-track,
.bh-collection-scroll::-webkit-scrollbar-track {
    background: transparent;
}

/* vacation/holiday count badge in the card header updates live too */
.business-hours-modal [data-business-hours-target="collectionCount"] {
    display: inline-block;
    width: 70px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
