/* 
    OOACP Shared Styles
    Contains common styles used across OOACP (Online Ordering Admin Control Panel) pages
*/

.mw-400 {
    max-width: unset;
}

@media (min-width: 768px) {
    .mw-400 {
        max-width: 400px;
    }
}

/* Timeset/Closed Dates*/

.timeset-block {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    transition: all 0.2s ease-in-out;
}

    .timeset-block.changed {
        background-color: #fff3cd;
        border-color: #ffc107 !important;
        box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
    }

    .timeset-block.saved {
        background-color: #d1edff;
        border-color: #17a2b8 !important;
    }

    .timeset-block.error {
        background-color: #f8d7da;
        border-color: #dc3545 !important;
    }

.day-row {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

    .day-row:last-child {
        border-bottom: none;
    }

.form-select {
    font-size: 0.875rem;
}

.form-label {
    font-weight: 500;
    color: #495057;
}

    .form-label.small {
        font-size: 0.75rem;
        color: #6c757d;
    }

.timeset-card-body {
    padding: 1rem;
}

.badge {
    font-size: 0.75rem;
}

.form-check-input:disabled {
    opacity: 0.6;
}

.form-select:disabled {
    opacity: 0.6;
    background-color: #e9ecef;
}

/* Closed Dates specific styles */
.closed-dates-form {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Home Naviation Cards*/
.navigation-card {
    border-radius: 8px;
    overflow: hidden;
    padding: 16px;
}

    .navigation-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    }

    .navigation-card .icon-container {
        transition: all 0.3s ease;
    }

    .navigation-card:hover .icon-container {
        transform: scale(1.1);
    }

    .navigation-card:hover .card-title {
        text-decoration: underline;
    }

/* SORTING & SAVING */
.drag-handle {
    cursor: grab;
    color: #6c757d;
    user-select: none;
}

.drag-handle:hover {
    color: #495057;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-row.changed {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}

.sortable-row.saved {
    background-color: #d1edff !important;
    border-left: 3px solid #0dcaf0;
}

.sortable-row.error {
    background-color: #f8d7da !important;
    border-left: 3px solid #dc3545;
}

/* Row drag and drop. wwwroot/lib/js/ocSortable.js sets these classes. */

/* The copy of the row that follows the mouse. */
.oc-sortable-helper {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.25);
    opacity: 0.95;
}

tr.oc-sortable-helper {
    display: table;
    background-color: #fff;
}

/* The gap where the row lands on a drop. */
tr.oc-sortable-placeholder > td {
    background-color: #f1f8ff;
    border-top: 2px dashed #86b7fe;
    border-bottom: 2px dashed #86b7fe;
}

div.oc-sortable-placeholder {
    background-color: #f1f8ff;
    border: 2px dashed #86b7fe;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* The hidden row and the gap both count as rows for nth-of-type, so the stripes and the hover color
   would jump from row to row during a drag. */
.table > tbody.oc-sortable-active > tr > * {
    --bs-table-accent-bg: transparent;
}

/* Checkbox with a message */
.message-checkbox-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.message-checkbox {
    margin-right: 0.5rem;
}

.message-checkbox-label {
    font-weight: 500;
    color: #495057;
}

.message-checkbox-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #28a745;
}

input:checked + .toggle-slider-red {
    background-color: #f74e5e!important;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-switch:focus + .toggle-slider {
    box-shadow: 0 0 1px #28a745;
}

/* Image classes */
.editable-image {
    width: 100%;
    border-radius: 5px;
    max-width: 150px;
    max-height: 130px;
}

.no-image-placeholder {
    width: 40px;
    height: 40px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

/* Mobile-specific styles */
@media (max-width: 767.98px) {
    .store-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .mobile-card {
        background: #fff;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        position: relative;
    }

        .mobile-card.changed {
            border-left: 4px solid #ffc107;
            background-color: #fff3cd;
        }

        .mobile-card.saved {
            border-left: 4px solid #0dcaf0;
            background-color: #d1edff;
        }

        .mobile-card.error {
            border-left: 4px solid #dc3545;
            background-color: #f8d7da;
        }

    .mobile-field {
        margin-bottom: 0.75rem;
    }

        .mobile-field label {
            font-weight: 600;
            font-size: 0.875rem;
            color: #495057;
            margin-bottom: 0.25rem;
            display: block;
        }

    .mobile-drag-handle {
        position: absolute;
        right: 10px;
        top: 10px;
        cursor: grab;
        color: #6c757d;
        padding: 5px;
    }

        .mobile-drag-handle:active {
            cursor: grabbing;
        }

    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.75rem;
        padding-right: 35px;
    }

    .mobile-pos-name {
        font-weight: 600;
        color: #495057;
        font-size: 1rem;
    }

    .mobile-online-only {
        color: #6f42c1;
        font-size: 0.875rem;
    }

    .mobile-actions {
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid #dee2e6;
    }

    .mobile-sort-controls {
        text-align: center;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background-color: #f8f9fa;
        border-radius: 0.375rem;
    }

        .mobile-sort-controls .btn {
            margin: 0 0.25rem;
        }

    .mobile-save-button {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* Hide desktop elements on mobile */
@media (max-width: 767.98px) {
    .desktop-table {
        display: none !important;
    }

    .desktop-controls {
        display: none !important;
    }

    .desktop-save-button {
        display: none !important;
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 768px) {
    .mobile-cards {
        display: none !important;
    }

    .mobile-sort-controls {
        display: none !important;
    }

    .mobile-save-button {
        display: none !important;
    }
}

/* Settings Styles - Extracted from SiteSettings.razor and Settings.razor */
.setting-item {
    transition: background-color 0.2s ease;
}

.setting-item:hover {
    background-color: #f8f9fa;
}

.setting-item:last-child {
    border-bottom: none !important;
}

.setting-item.changed {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}

.setting-item.saved {
    background-color: #d1edff !important;
    border-left: 3px solid #0dcaf0;
}

.setting-item.error {
    background-color: #f8d7da !important;
    border-left: 3px solid #dc3545;
}

.setting-card-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
}

.item-row.changed {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}

.item-row.saved {
    background-color: #d1edff !important;
    border-left: 3px solid #0dcaf0;
}

.item-row.error {
    background-color: #f8d7da !important;
    border-left: 3px solid #dc3545;
}

.item-row[draggable="true"] {
    cursor: move;
}

.item-row.drag-over {
    background-color: #e3f2fd;
    border: 2px dashed #2196f3;
}

.item-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

.apply-to-item-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.apply-to-item-checkbox {
    margin-right: 0.5rem;
}

.apply-to-item-label {
    font-weight: 500;
    color: #495057;
}

.apply-to-item-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Promotions page specific styles */
.promotions-table td {
    vertical-align: middle;
}

.promotions-reset-btn:hover {
    color: #000;
}
/* ============================================================================
   Online Ordering appearance editor: the CSS card and the Theme card
   ----------------------------------------------------------------------------
   Global rather than scoped. The editor is a stack of nested components, and
   several of these rules cross a component boundary: .oo-has-preview narrows the
   property grid inside CssRuleBlock, which is two components below the element
   carrying the class. A scoped .razor.css rewrites selectors with a per-component
   attribute and does not cross that boundary, so those rules would silently
   never apply.

   Contrast note: the state colours below are darkened from the Bootstrap
   defaults for the same reason .oc-title-* above are, because they carry text.
   ============================================================================ */

.oo-css-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
}

.oo-css-search {
    position: relative;
    flex: 1 1 260px;
    max-width: 420px;
}

.oo-css-search input {
    padding-right: 4rem;
}

.oo-css-search-clear {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
}

.oo-css-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: auto;
}

.oo-css-split {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.oo-css-body {
    flex: 1 1 auto;
    min-width: 0;
}

.oo-css-preview {
    flex: 0 0 40%;
    position: sticky;
    top: 4rem;
}

/* The preview takes width from the editor, so the controls get narrower columns
   rather than a horizontal scrollbar. */
.oo-has-preview .oo-css-property-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (max-width: 991.98px) {
    .oo-css-split {
        flex-direction: column;
    }

    .oo-css-preview {
        flex: 1 1 auto;
        position: static;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .oo-css-toolbar {
        position: static;
    }
}

.oo-css-section-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.oo-css-section-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    text-decoration: none;
    color: #212529;
}

.oo-css-section-caret {
    display: inline-block;
    transition: transform 120ms ease;
}

.oo-css-section-caret.oo-open {
    transform: rotate(90deg);
}

.oo-css-rule {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f1f1;
}

.oo-css-rule:last-child {
    border-bottom: 0;
}

.oo-css-rule-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.oo-css-rule-changed {
    border-left: 3px solid #ffc107;
    padding-left: 0.5rem;
}

.oo-css-property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.oo-css-field-label {
    margin-bottom: 0.15rem;
    font-size: 0.875rem;
}

.oo-css-field-help {
    font-size: 0.75rem;
}

/* A native colour input is 3rem wide by default and squeezes the text box it
   sits beside, which is the input that actually holds the value. */
.oo-css-swatch {
    flex: 0 0 2.5rem;
    max-width: 2.5rem;
    padding: 0.15rem;
}

.oo-contrast {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
}

.oo-contrast-mark {
    flex: 0 0 auto;
    font-weight: 700;
}

.oo-contrast-pass {
    color: #146c43;
}

.oo-contrast-fail {
    color: #b02a37;
}

.oo-contrast-unknown {
    color: #8a6100;
}

.oo-contrast-none {
    color: #5c636a;
}

.oo-focus-ring-note {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    font-size: 0.8125rem;
}

.oo-correction {
    margin-top: 0.35rem;
    padding: 0.5rem;
    border-left: 3px solid #0f6674;
    background-color: #f2f8f9;
    font-size: 0.75rem;
}

.oo-correction-head {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.oo-correction-pair {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.oo-correction-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border: 1px solid #adb5bd;
    border-radius: 2px;
}

.oo-correction-measured {
    margin-top: 0.25rem;
    color: #5c636a;
}

.oo-correction-problem {
    margin-top: 0.25rem;
    color: #b02a37;
    font-weight: 600;
}

.oo-correction-advice {
    margin-top: 0.25rem;
    color: #8a6100;
}

.oo-preview {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: hidden;
}

.oo-preview-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.oo-preview-site-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.oo-preview-status {
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.oo-preview-live {
    color: #146c43;
}

.oo-preview-waiting {
    color: #5c636a;
}

.oo-preview-problem {
    color: #8a6100;
}

.oo-preview-frame {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
}

/* Why the guest menu will not show a record the merchant SET to show online, beside the record.
   Rendered by Shared/Components/Menu/RenderBlockReason.razor, which owns the rule; that component
   decides when this class appears and this comment does not restate the conditions, because the
   version that did went stale the same day the rule narrowed. It stays rare, which is why it can be
   muted: an explanation, not a warning banner. The values match the OOACP badge so the same
   merchant sees the same thing in either editor. */
.render-block {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.4rem;
    padding: 0.05rem 0.35rem;
    border: 1px solid #d9b382;
    border-radius: 0.75rem;
    background: #fdf6ec;
    color: #6b5433;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: nowrap;
    cursor: help;
    vertical-align: middle;
}

.render-block__timeset {
    opacity: 0.7;
}

/* The time sets on a category or an item, as one short line under its POS name. Rendered by
   Shared/Components/Menu/TimesetChip.razor. Grey and small on purpose: it states a fact about the
   record, it is not a warning. The colours are the app.css tokens, and ThemeTokenTests holds
   --oc-text-muted at WCAG AA on --oc-card-header-bg. OOAdminControlPanel Content/Site.css
   .oo-timeset__chip writes the same colours as hex.

   The grid track has no minimum width, so a long name cannot widen the table column. The chip cuts
   the name short with an ellipsis instead, and its title carries the whole text. max-width keeps
   the chip short in a wide column. */
.timeset-chip {
    display: grid;
    grid-template-columns: minmax(0, auto);
    justify-content: start;
    max-width: 16rem;
    margin-top: 1px;
}

.timeset-chip__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.4rem;
    border: 1px solid var(--oc-form-border);
    border-radius: 0.75rem;
    background: var(--oc-card-header-bg);
    color: var(--oc-text-muted);
    font-size: 0.7rem;
    font-style: normal;
    font-weight: normal;
    line-height: 1.3;
}

/* The expandable Description field on the menu editor screens.

   Rendered by Shared/Components/Menu/ExpandableDescription.razor. The wrapper hugs the box so the
   expand button can sit inside it at the right-hand end, which keeps the table column and the row
   height exactly as they were. */
.oc-desc-field {
    position: relative;
    display: block;
}

.oc-desc-field > input.oc-desc-input {
    width: 100%;
    padding-right: 28px;
}

.oc-desc-expand {
    position: absolute;
    top: 50%;
    right: 3px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #6c757d;
    line-height: 1;
    cursor: pointer;
}

.oc-desc-expand:hover {
    border-color: #ced4da;
    background: #f1f3f5;
    color: #212529;
}

/* The button is in the tab order, so a keyboard user has to be able to SEE where they are. The
   earlier rule set outline: none and left only a pale border on a pale background. */
.oc-desc-expand:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 1px;
    background: #f1f3f5;
    color: #212529;
}

.oc-desc-text {
    resize: vertical;
}

/* The warning that Done will change the merchant's text. It is the ONLY notice of that, so it has
   to be readable: Bootstrap's .text-warning is #ffc107, 1.63:1 on white, far below the WCAG AA
   4.5:1 for body text. This is the same darkened hue app.css already uses for .oc-title-warning,
   measured at 5.54:1. */
.oc-desc-breaknote {
    color: #8a6100;
    font-weight: 600;
}

/* Specials online (feature-board-4117). "In N specials" under an item's POS name, rendered by
   Shared/Components/Menu/SpecialLinksChip.razor, and the notice a changed row shows when the item is
   also a pick in a special. Like the time set chip it states a fact about the record, so it uses the
   same muted tokens; the row notice is the one line a merchant must read before saving, so it uses
   the darkened warning hue .oc-desc-breaknote already measured at 5.54:1 on white. */
.special-links-chip {
    margin-top: 1px;
}

.special-links-chip__label {
    padding: 0 0.4rem;
    border: 1px solid var(--oc-form-border);
    border-radius: 0.75rem;
    background: var(--oc-card-header-bg);
    color: var(--oc-text-muted);
    font-size: 0.7rem;
    line-height: 1.3;
    white-space: nowrap;
    cursor: pointer;
}

.special-links-chip__list {
    margin: 0.2rem 0 0 0;
    padding-left: 1rem;
    color: var(--oc-text-muted);
    font-size: 0.75rem;
}

.special-row-notice {
    margin-top: 0.25rem;
    color: #8a6100;
    font-size: 0.75rem;
    font-weight: 600;
}

.special-where-it-lives {
    color: var(--oc-text-muted);
    font-size: 0.75rem;
}
