/*
   Platform management feature family styles.

   Global tokens, shell and dialog primitives live in design-system.css. Keep
   platform-only workspace, bounded-list and transfer patterns here so Razor
   components do not own visual policy through local <style> blocks or inline
   layout declarations.
*/

.platform-management-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.platform-management-card {
    min-width: 0;
    height: 100%;
    border-color: var(--app-border) !important;
    background: var(--app-surface) !important;
}

.platform-management-card__description {
    color: var(--app-muted);
}

.platform-management-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-menu-content-workspace {
    min-width: 0;
}

.menu-content-scroll-region {
    padding-right: 4px;
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.menu-content-top-two-bottom-one {
    align-items: stretch;
}

.menu-content-selector-panel,
.menu-content-product-panel {
    border-color: var(--app-border) !important;
    background: var(--app-surface) !important;
}

.menu-content-product-panel {
    border-top: 3px solid var(--app-primary) !important;
}

.menu-content-platform-select {
    min-width: 220px;
}

.menu-content-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.menu-content-list-text {
    flex: 1;
    min-width: 0;
}

.menu-content-hover-actions {
    display: inline-flex;
    align-items: center;
    opacity: .72;
    transition: opacity 120ms ease-in-out;
}

.menu-content-list-item:hover .menu-content-hover-actions,
.menu-content-hover-actions:focus-within {
    opacity: 1;
}

.menu-content-nav-item {
    min-height: 56px;
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.selectable-option-outlined {
    background-color: var(--app-surface);
    border-color: var(--app-border-strong) !important;
}

.selectable-option-filled {
    border-color: var(--app-primary) !important;
    background-color: var(--app-primary) !important;
    color: var(--app-primary-contrast) !important;
}

.selectable-option-filled .mud-typography,
.selectable-option-filled .mud-typography-caption,
.selectable-option-filled .menu-content-edit-button {
    color: var(--app-primary-contrast) !important;
}

.menu-content-price-input {
    max-width: 130px;
}

.menu-content-save-fab {
    position: fixed;
    right: 32px;
    bottom: 32px;
    z-index: 20;
}

.platform-menu-mobile-stepper {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--app-primary-border);
    border-radius: var(--app-radius-panel);
    background: var(--app-primary-soft);
}

.platform-menu-mobile-stepper__label {
    color: var(--app-primary);
    font-size: calc(12px * var(--app-font-scale));
    font-weight: 750;
}

.platform-menu-mobile-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
}

.platform-menu-mobile-navigation--single {
    grid-template-columns: minmax(0, 1fr);
}

.platform-addon-group-option-items-scroll,
.addon-group-related-products-table {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.platform-addon-group-option-items-scroll {
    min-height: 0;
}

.platform-drag-item--draggable {
    cursor: move;
}

.platform-drag-item--static {
    cursor: default;
}

.platform-data-transfer-card {
    min-width: 0;
    border-color: var(--app-border) !important;
    background: var(--app-surface) !important;
}

.platform-data-transfer-card__site {
    color: var(--app-muted);
}

.platform-data-transfer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-data-transfer-file-input {
    width: 100%;
    min-height: 44px;
    padding: 8px;
    border: 1px dashed var(--app-border-strong);
    border-radius: var(--app-radius-control);
    background: var(--app-surface-subtle);
    color: var(--app-text);
}

.platform-data-transfer-file-input:focus-visible {
    outline: 3px solid var(--app-focus-ring);
    outline-offset: 2px;
}

.platform-data-transfer-preview {
    border-color: var(--app-border) !important;
    background: var(--app-surface-subtle) !important;
}

.platform-config-import-table-scroll {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.platform-config-import-table-scroll .mud-table,
.platform-config-import-table-scroll .mud-table-container {
    min-width: max-content;
}

.platform-copy-preview__summary {
    margin: 0;
}

.platform-copy-preview {
    min-height: 0;
}

.platform-copy-preview__groups {
    display: grid;
    gap: 12px;
    height: min(560px, calc(100dvh - 320px));
    max-height: min(560px, calc(100dvh - 320px));
    align-content: start;
    align-items: start;
    grid-auto-rows: max-content;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.platform-copy-preview__group {
    min-width: 0;
    overflow: visible;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-panel);
    background: var(--app-surface-subtle);
}

.platform-copy-preview__group[data-result-state="conflict"] {
    border-color: var(--app-error);
}

.platform-copy-preview__group[data-result-state="skipped"] {
    border-color: var(--app-warning);
}

.platform-copy-preview__group-summary {
    display: block;
    list-style: none;
    padding: 12px 16px;
    cursor: pointer;
    outline-offset: -3px;
}

.platform-copy-preview__group-summary::-webkit-details-marker {
    display: none;
}

.platform-copy-preview__group-summary::marker {
    content: "";
}

.platform-copy-preview__group-summary-content {
    width: 100%;
}

.platform-copy-preview__group-toggle {
    flex: 0 0 auto;
    color: var(--app-muted);
}

.platform-copy-preview__group-toggle-icon {
    transition: transform 120ms ease;
}

.platform-copy-preview__group[open] .platform-copy-preview__group-toggle-icon {
    transform: rotate(180deg);
}

.platform-copy-preview__group-summary:focus-visible {
    outline: 3px solid var(--app-focus-ring);
}

.platform-copy-preview__group-content {
    min-height: 0;
    padding: 0 12px 12px;
}

.platform-copy-preview__result {
    min-width: 0;
    padding: 12px;
    border-color: var(--app-border) !important;
    background: var(--app-surface) !important;
}

.platform-copy-preview__result-heading {
    min-width: 0;
}

.platform-copy-preview__result-path {
    min-width: 0;
}

.platform-copy-preview__result-path .mud-typography {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.platform-copy-preview__identifiers .mud-typography,
.platform-copy-preview__candidate {
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: Cascadia Code, SFMono-Regular, Consolas, monospace;
}

.platform-copy-preview__reason {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.platform-copy-preview__identifiers {
    color: var(--app-muted);
}

.platform-copy-preview__candidates {
    padding: 8px 10px;
    border-left: 3px solid var(--app-warning);
    background: var(--app-warning-soft);
}

.platform-copy-preview__candidate {
    padding-left: 8px;
}

.platform-copy-preview__hint {
    overflow-wrap: anywhere;
    word-break: break-word;
    color: var(--app-info);
}

.platform-table-cell-wrap {
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

@media (max-width: 959.98px) {
    .platform-management-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 599.98px) {
    .menu-content-hover-actions {
        opacity: 1;
    }

    .menu-content-platform-select {
        width: 100%;
        min-width: 0;
    }

    .menu-content-save-fab {
        right: 16px;
        bottom: 16px;
    }

    .platform-menu-mobile-navigation {
        grid-template-columns: minmax(0, 1fr);
    }

    .platform-data-transfer-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .platform-data-transfer-actions .mud-button-root {
        width: 100%;
    }

    .platform-copy-preview__groups {
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .platform-copy-preview__result-heading {
        align-items: flex-start;
        flex-direction: column;
    }

}

@media (prefers-reduced-motion: reduce) {
    .menu-content-hover-actions,
    .menu-content-nav-item,
    .platform-copy-preview__group-toggle-icon {
        transition: none;
    }
}
