/*** Modal structure ***/

.filament-peek-modal {
    background-color: var(--gray-50);
    color: var(--gray-950);
    display: flex;
    height: 100vh;
    left: 0;
    margin: 0 !important;
    padding: 0 !important;
    position: fixed;
    top: 0;
    width: 100vw;
    z-index: 39;

    --filament-peek-panel-header-height: 4.8rem;
    --filament-peek-builder-actions-height: 4.25rem;
}

.filament-peek-modal:where(.dark, .dark *) {
    background-color: var(--gray-950);
    color: var(--color-white);
}

.filament-peek-panel {
    display: flex;
    flex-direction: column;
}

.filament-peek-panel-header {
    align-items: center;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-950);
    display: flex;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    justify-content: space-between;
    min-height: var(--filament-peek-panel-header-height);
    padding: calc(var(--spacing) * 4);
    user-select: none;
}

.filament-peek-panel-header:where(.dark, .dark *) {
    background-color: var(--gray-900);
    border-bottom: 1px solid var(--gray-800);
    color: var(--color-white);
}

.filament-peek-panel-body {
    flex-grow: 1;
    background-color: var(--gray-100);
    padding: calc(var(--spacing) * 4);
}

.filament-peek-panel-body:where(.dark, .dark *) {
    background-color: var(--gray-950);
}

.filament-peek-panel-body iframe {
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    margin-left: auto;
    margin-right: auto;
    transition: all 200ms;
}

.filament-peek-panel-body.allow-iframe-overflow {
    overflow-y: auto;
}

body.is-filament-peek-preview-modal-open {
    overflow: hidden;
}

/*** Preview ***/

.filament-peek-preview {
    flex-grow: 1;
    max-width: 100%;
}

.filament-peek-preview .filament-peek-panel-header>* {
    min-width: 10rem;
}

.filament-peek-device-presets {
    display: none;
    justify-content: center;
}

@media screen and (min-width: 80rem) {
    .filament-peek-device-presets {
        display: flex;
    }
}

.filament-peek-device-presets button {
    align-items: center;
    display: inline-flex;
    flex-direction: column;
    margin-left: calc(var(--spacing) * 2);
    margin-right: calc(var(--spacing) * 2);
}

.filament-peek-device-presets button:disabled {
    opacity: 0.25;
}

.filament-peek-device-presets button svg {
    width: calc(var(--spacing) * 6);
    height: calc(var(--spacing) * 6);
}

.filament-peek-device-presets button:after {
    background-color: transparent;
    content: '';
    display: block;
    height: calc(var(--spacing) * 1);
    margin-top: calc(var(--spacing) * 1);
    width: calc(var(--spacing) * 1);
    border-radius: calc(infinity * 1px);
}

.filament-peek-device-presets button.is-active-device-preset:after {
    background-color: currentColor;
    top: calc(var(--spacing) * -1);
}

.filament-peek-rotate-preset svg {
    position: relative;
    top: calc(var(--spacing) * -1);
}

.filament-peek-modal-actions {
    display: flex;
    justify-content: end;
}

/*** Editor ***/

.filament-peek-editor {
    display: none;
    border-right: 1px solid var(--gray-200);
}

:dir(rtl) .filament-peek-editor {
    border-left: 1px solid var(--gray-200);
}

.filament-peek-editor:where(.dark, .dark *) {
    border-color: var(--gray-800) !important;
}

.filament-peek-editor .filament-peek-panel-body {
    display: flex;
    height: 100%;
    padding: 0;
    width: 100%;
}

.filament-peek-editor-buttons {
    display: inline-flex;
    align-items: center;
}

.filament-peek-editor-actions {
    display: flex;
    gap: calc(var(--spacing) * 4);
}

.filament-peek-editor-icon {
    background-color: transparent !important;
    border: none !important;
    gap: 0 !important;
    padding: calc(var(--spacing) * 2) !important;
}

.filament-peek-editor-icon:not(:focus) {
    box-shadow: none !important;
}

.filament-peek-editor-icon svg {
    color: var(--gray-900);
}

.filament-peek-editor-icon svg:where(.dark, .dark *) {
    color: var(--color-white);
}

.filament-peek-editor-icon.is-icon-active svg {
    color: var(--primary-600);
}

.filament-peek-editor-auto-refresh-label {
    align-items: center;
    display: inline-flex;
    gap: calc(var(--spacing) * 2);
    padding: calc(var(--spacing) * 2);
}

.filament-peek-builder-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    width: 100%;
}

.filament-peek-builder-content {
    height: calc(100vh - var(--filament-peek-panel-header-height));
    max-height: calc(100vh - var(--filament-peek-panel-header-height));
    overflow-y: auto;
    padding: calc(var(--spacing) * 4);
    width: 100%;
}

.filament-peek-builder-content .tippy-content [x-ref="panel"] {
    color: var(--gray-900);
}

.filament-peek-builder-content .tippy-content [x-ref="panel"]:where(.dark, .dark *) {
    color: var(--gray-300);
}

.filament-peek-builder-actions {
    display: none;
}

.filament-peek-builder-editor.has-sidebar-actions .filament-peek-builder-content {
    height: calc(100vh - var(--filament-peek-panel-header-height) - var(--filament-peek-builder-actions-height));
    max-height: calc(100vh - var(--filament-peek-panel-header-height) - var(--filament-peek-builder-actions-height));
    overflow-y: auto;
    padding: calc(var(--spacing) * 4);
    width: 100%;
}

.filament-peek-builder-editor.has-sidebar-actions .filament-peek-builder-actions {
    border-top: 1px solid var(--gray-200);
    display: block;
    height: var(--filament-peek-builder-actions-height);
    width: 100%;
}

.filament-peek-builder-editor.has-sidebar-actions .filament-peek-builder-actions:where(.dark, .dark *) {
    border-color: var(--gray-800);
}

/* Main builder */
.filament-peek-builder-editor.has-sidebar-actions .fi-fo-builder>.fi-fo-builder-block-picker {
    bottom: 0;
    left: 0;
    padding: calc(var(--spacing) * 4);
    position: absolute;
    width: 100%;
}

/* Nested builders */
.filament-peek-builder-editor.has-sidebar-actions .fi-fo-builder .fi-fo-builder>.fi-fo-builder-block-picker {
    padding: initial;
    position: initial;
}

/*** Resizer ***/

.filament-peek-editor-resizer {
    background-color: transparent;
    border-left: 3px solid transparent;
    height: 100%;
    left: 100%;
    position: absolute;
    top: 0;
    width: 9px;
}

:dir(rtl) .filament-peek-editor-resizer {
    border-left: none;
    border-right: 3px solid transparent;
    left: initial;
    right: 100%;
}

.filament-peek-editor-resizer:hover {
    border-color: var(--gray-500);
    cursor: ew-resize;
}

.filament-peek-iframe-cover {
    display: none;
}

.is-filament-peek-editor-resizing {
    cursor: ew-resize;
    user-select: none;
}

.is-filament-peek-editor-resizing .filament-peek-editor-resizer {
    border-color: var(--gray-500);
}

/* This must be above everything to prevent resizing glitches */
.is-filament-peek-editor-resizing .filament-peek-iframe-cover {
    bottom: 0;
    display: block;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 9999;
}
