/* Hours Editor Component
   Builds on .input-group, .input-field, .tag-add-button patterns from card.css
   Row layout is handled by row() from components.js — no flex-direction overrides needed */

/* Wrapper integrates with explore_edit form layout */
.hours-editor-wrapper .opening-hours {
    cursor: pointer;
    background: #fafafa;
}

/* Panel visibility via class toggle */
.hours-editor-panel {
    display: none;
}
.hours-editor-panel.hours-panel-open {
    display: block;
}

/* Panel container */
.hours-editor-panel-inner {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    margin-top: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* Header: uses row() — just add wrap + spacing */
.hours-panel-header {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.hours-panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}
.hours-actions {
    flex-wrap: wrap;
    gap: 6px;
}

/* Action buttons — consistent with .tag-add-button pattern */
.hours-action-btn {
    padding: 3px 8px;
    font-size: 0.75rem;
    border: 1px solid #999;
    color: #999;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}
.hours-action-btn:hover {
    opacity: 0.8;
}
.hours-btn-open {
    border-color: #27ae60;
    color: #27ae60;
}
.hours-btn-copy {
    border-color: #2980b9;
    color: #2980b9;
}
.hours-btn-done {
    border-color: #999;
    color: #999;
}

/* Day rows — uses row() for horizontal layout */
.hours-day-row {
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}
.hours-day-row:last-of-type {
    border-bottom: none;
}

.hours-day-label {
    width: 36px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

/* Day toggle checkbox */
.hours-day-toggle {
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* Ranges wrap — dims when day is closed */
.hours-day-ranges-wrap {
    flex: 1;
    min-width: 0;
}
.hours-day-ranges-wrap.hours-day-closed {
    opacity: 0.4;
    pointer-events: none;
}

/* Ranges container — uses row() for wrap */
.hours-day-ranges {
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

/* Time select dropdowns */
.hours-time-select {
    padding: 4px 2px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
    width: 72px;
}

/* Range separators */
.hours-range-to {
    font-size: 0.8rem;
    color: #666;
}
.hours-range-separator {
    font-size: 0.75rem;
    color: #999;
    margin: 0 2px;
}

/* Remove range button */
.hours-remove-range {
    border: none;
    background: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
    padding: 0 2px;
    line-height: 1;
}
.hours-remove-range:hover {
    color: #c0392b;
}

/* Add range (break) button */
.hours-add-range {
    border: none;
    background: none;
    color: #2980b9;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 4px;
}
.hours-add-range:hover {
    text-decoration: underline;
}

/* Original value banner — shown when input couldn't be parsed */
.hours-original-banner {
    background: #fef9e7;
    border: 1px solid #f0c36d;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}
.hours-original-text {
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.hours-original-label {
    color: #856404;
    font-weight: 600;
}
.hours-original-value {
    background: #fff;
    border: 1px solid #f0c36d;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #856404;
    word-break: break-all;
}
.hours-original-hint {
    color: #a07800;
    font-size: 0.75rem;
    display: block;
    margin-top: 4px;
}

/* Preview row — uses row() */
.hours-preview-row {
    align-items: center;
    margin-top: 8px;
    padding: 4px 0;
    font-size: 0.8rem;
    color: #888;
}
.hours-preview-label {
    margin-right: 4px;
}
.hours-preview {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}
