/**
 * Selection Studio — Page Switcher CSS (Unified Phase 4 Overlay Constitution)
 * Location: /studio/css/page-switcher.css
 */

/* =========================================================
   1. SHELL & LAYOUT
   ========================================================= */

.page-switcher-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: transparent;
    color: var(--color-text-primary);
}

/* =========================================================
   2. HEADER & SEARCH
   ========================================================= */

.page-switcher-header {
    display: flex;
    flex-direction: column;
    padding: var(--space-6) var(--space-6) var(--space-5);
    border-bottom: 1px solid var(--color-border-subtle);
}

.page-switcher-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.page-switcher-title {
    margin: 0;
    font-size: var(--studio-type-dialog-title-size);
    font-weight: var(--studio-font-weight-medium);
    line-height: var(--studio-type-dialog-title-line-height);
    letter-spacing: var(--studio-type-dialog-title-letter-spacing);
    color: var(--studio-text-primary);
}

.page-switcher-close-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--studio-text-muted, #64748b);
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 160ms ease, background-color 160ms ease;
}

.page-switcher-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.page-switcher-search-wrapper {
    width: 100%;
    margin-top: var(--space-2);
}

.page-switcher-search-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-medium);
    background: var(--color-bg-input);
    color: var(--studio-text-primary);
    font: inherit;
    font-size: var(--studio-type-body-compact-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-body-compact-line-height);
    outline: none;
    transition: border-color var(--motion-fast) var(--ease-standard), box-shadow var(--motion-fast) var(--ease-standard);
}

.page-switcher-search-input::placeholder {
    color: var(--color-text-muted);
}

.page-switcher-search-input:focus {
    border-color: var(--studio-gold, #d4b483);
    box-shadow: 0 0 0 3px rgba(212, 180, 131, 0.15);
}

/* =========================================================
   3. BODY & CARDS
   ========================================================= */

.page-switcher-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--space-6);
}

.page-switcher-list-slot {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.page-switcher-card {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    padding: var(--space-4) var(--space-5);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-medium);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
    color: var(--studio-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 160ms var(--ease-standard), border-color 160ms var(--ease-standard), background-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard);
}

.page-switcher-card:hover {
    transform: translateY(-1px);
    border-color: var(--color-border-strong);
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-small);
}

.page-switcher-card.is-selected {
    border-color: var(--color-accent-border);
    background: linear-gradient(180deg, rgba(212, 180, 131, 0.12), rgba(212, 180, 131, 0.04));
}

.page-switcher-card-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.page-switcher-card-title,
.page-switcher-card-slug {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-switcher-card-title {
    font-size: var(--studio-type-card-title-size);
    font-weight: var(--studio-font-weight-strong);
    line-height: var(--studio-type-card-title-line-height);
}

.page-switcher-card-slug {
    font-size: var(--studio-type-meta-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-meta-line-height);
    color: var(--studio-text-muted);
}

.page-switcher-badge-home {
    flex-shrink: 0;
    font-size: var(--studio-type-status-size);
    font-weight: var(--studio-font-weight-label);
    line-height: var(--studio-type-status-line-height);
    letter-spacing: var(--studio-type-status-letter-spacing);
    color: var(--studio-text-accent);
    padding: 2px 6px;
    border: 1px solid var(--color-accent-border);
    border-radius: var(--radius-small);
    background: var(--color-accent-soft);
}

.page-switcher-status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    padding: var(--space-4);
    border: 1px dashed var(--color-border-default);
    border-radius: var(--radius-medium);
    color: var(--studio-text-muted);
    font-size: var(--studio-type-body-compact-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-body-compact-line-height);
    text-align: center;
}

.page-switcher-status.is-error {
    border-color: rgba(255, 105, 97, 0.28);
    color: var(--color-danger);
}

/* =========================================================
   4. FOOTER & UNIFIED OVERLAY BUTTONS (PHASE 4)
   ========================================================= */

.page-switcher-footer {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--color-border-subtle);
    background: rgba(11, 17, 22, 0.5);
}

.page-switcher-selection-error {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid rgba(255, 105, 97, 0.28);
    border-radius: var(--radius-small);
    background: rgba(255, 105, 97, 0.12);
    color: var(--studio-text-danger);
    font-size: var(--studio-type-body-compact-size);
    font-weight: var(--studio-font-weight-regular);
    line-height: var(--studio-type-body-compact-line-height);
    text-align: center;
}

.page-switcher-selection-error.is-hidden {
    display: none !important;
}

.page-switcher-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--space-3);
    width: 100%;
}

.page-switcher-btn-secondary {
    appearance: none;
    height: 32px;
    min-height: 32px;
    padding: 0 14px;
    border: none;
    outline: none;
    border-radius: 6px;
    background: transparent;
    color: var(--studio-text-muted);
    font: inherit;
    font-size: var(--studio-type-ui-label-size);
    font-weight: var(--studio-font-weight-medium);
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.page-switcher-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.page-switcher-btn-primary {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--studio-gold, #d4b483);
    border-radius: 6px;
    background: rgba(212, 180, 131, 0.08);
    color: var(--studio-text-accent);
    font: inherit;
    font-size: var(--studio-type-ui-label-size);
    font-weight: var(--studio-font-weight-strong);
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, opacity 160ms ease;
}

.page-switcher-btn-primary .resident-action-arrow {
    display: inline-block;
    transition: transform 180ms ease;
}

.page-switcher-btn-primary:hover:not(:disabled) {
    background: var(--studio-gold, #d4b483);
    color: #06090c;
    box-shadow: 0 0 12px rgba(212, 180, 131, 0.25);
}

.page-switcher-btn-primary:hover:not(:disabled) .resident-action-arrow {
    transform: translateX(4px);
}

.page-switcher-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.page-switcher-close-btn:focus-visible,
.page-switcher-card:focus-visible,
.page-switcher-btn-primary:focus-visible,
.page-switcher-btn-secondary:focus-visible {
    outline: 2px solid var(--studio-gold, #d4b483);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .page-switcher-card:hover {
        transform: none;
    }

    .page-switcher-btn-primary:hover:not(:disabled) .resident-action-arrow {
        transform: none;
    }
}

/* =========================================================
   5. RESPONSIVE
   ========================================================= */

@media (max-width: 640px) {

    .page-switcher-header,
    .page-switcher-body,
    .page-switcher-footer {
        padding-inline: var(--space-4);
    }

    .page-switcher-footer-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .page-switcher-btn-primary,
    .page-switcher-btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
