/* =========================================================
   SPOTLIGHT
   ========================================================= */

.spotlight-container {
    position: fixed;

    inset: 0;

    z-index: 900;

    pointer-events: none;
}

.spotlight-window {
    position: fixed;

    display: flex;

    flex-direction: column;

    box-sizing: border-box;

    min-width: 300px;

    min-height: 200px;

    max-width: calc(100vw - 16px);

    max-height: calc(100vh - 16px);

    background: #fff;

    color: #111;

    border: 1px solid rgba(0,0,0,.14);

    border-radius: 10px;

    overflow: hidden;

    box-shadow:
        0 15px 45px rgba(0,0,0,.22);

    pointer-events: auto;

    touch-action: auto;
}

.spotlight-window.spotlight-active {
    box-shadow:
        0 18px 55px rgba(0,0,0,.28);
}

.spotlight-header {
    position: relative;

    display: flex;

    align-items: center;

    justify-content: space-between;

    flex: 0 0 auto;

    min-height: 42px;

    padding: 0 8px 0 14px;

    background: #f5f5f5;

    border-bottom: 1px solid rgba(0,0,0,.10);

    user-select: none;

    -webkit-user-select: none;

    touch-action: none;

    cursor: move;
}

.spotlight-title {
    flex: 1;

    min-width: 0;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;

    font-size: 14px;

    font-weight: 600;
}

.spotlight-actions {
    display: flex;

    align-items: center;

    gap: 2px;

    margin-left: 8px;
}

.spotlight-control {
    width: 34px;

    height: 32px;

    border: 0;

    border-radius: 5px;

    background: transparent;

    color: inherit;

    cursor: pointer;

    font-size: 17px;
}

.spotlight-control:hover {
    background: rgba(0,0,0,.08);
}

.spotlight-content {
    position: relative;

    flex: 1 1 auto;

    min-height: 0;

    overflow: auto;

    background: #fff;
}

.spotlight-preloader {
    position: absolute;

    inset: 0;

    z-index: 5;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(255,255,255,.85);
}

.spotlight-media {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: contain;
}

.spotlight-iframe {
    display: block;

    width: 100%;

    height: 100%;

    min-height: 100%;

    border: 0;
}

.spotlight-video {
    display: block;

    width: 100%;

    height: 100%;

    object-fit: contain;
}

.spotlight-audio {
    width: 100%;

    margin-top: 20px;
}

.spotlight-content pre {
    box-sizing: border-box;

    margin: 0;

    padding: 16px;

    white-space: pre-wrap;

    word-break: break-word;
}

.spotlight-error {
    padding: 30px;

    text-align: center;
}


/* =========================================================
   RESIZE HANDLES
   ========================================================= */

.spotlight-resize-handle {
    position: absolute;

    z-index: 20;

    touch-action: none;
}

.spotlight-resize-n {
    top: -4px;

    left: 8px;

    right: 8px;

    height: 8px;

    cursor: n-resize;
}

.spotlight-resize-s {
    bottom: -4px;

    left: 8px;

    right: 8px;

    height: 8px;

    cursor: s-resize;
}

.spotlight-resize-e {
    right: -4px;

    top: 8px;

    bottom: 8px;

    width: 8px;

    cursor: e-resize;
}

.spotlight-resize-w {
    left: -4px;

    top: 8px;

    bottom: 8px;

    width: 8px;

    cursor: w-resize;
}

.spotlight-resize-ne {
    top: -5px;

    right: -5px;

    width: 12px;

    height: 12px;

    cursor: ne-resize;
}

.spotlight-resize-nw {
    top: -5px;

    left: -5px;

    width: 12px;

    height: 12px;

    cursor: nw-resize;
}

.spotlight-resize-se {
    right: -5px;

    bottom: -5px;

    width: 12px;

    height: 12px;

    cursor: se-resize;
}

.spotlight-resize-sw {
    left: -5px;

    bottom: -5px;

    width: 12px;

    height: 12px;

    cursor: sw-resize;
}


/* =========================================================
   STATES
   ========================================================= */

.spotlight-window.spotlight-dragging {
    user-select: none;

    -webkit-user-select: none;
}

.spotlight-window.spotlight-maximized {
    border-radius: 0;

    max-width: none;

    max-height: none;
}

.spotlight-window.spotlight-fullscreen {
    border-radius: 0;
}

.spotlight-window.spotlight-snapped {
    border-radius: 6px;
}

.spotlight-window.spotlight-grouped {
    box-shadow:
        0 0 0 1px rgba(70,120,255,.25),
        0 15px 45px rgba(0,0,0,.22);
}

.spotlight-window.spotlight-minimized {
    display: none !important;
}


/* =========================================================
   SNAP ASSIST
   ========================================================= */

.spotlight-snap-assist-preview {
    position: fixed;

    display: none;

    box-sizing: border-box;

    z-index: 999998;

    pointer-events: none;

    background:
        rgba(60,120,255,.20);

    border:
        2px solid rgba(60,120,255,.75);

    border-radius: 8px;

    box-shadow:
        0 10px 40px rgba(0,0,0,.18);

    opacity: 0;

    transform: scale(.97);

    transition:
        opacity .12s ease,
        transform .12s ease;
}

.spotlight-snap-assist-preview.visible {
    display: block;

    opacity: 1;

    transform: scale(1);
}


/* =========================================================
   SNAP ASSIST CHOOSER
   ========================================================= */

.spotlight-snap-assist-chooser {
    position: fixed;

    z-index: 1000000;

    display: none;

    box-sizing: border-box;

    padding: 12px;

    border-radius: 12px;

    background:
        rgba(30,30,34,.97);

    color: #fff;

    border:
        1px solid rgba(255,255,255,.12);

    box-shadow:
        0 25px 70px rgba(0,0,0,.35);

    backdrop-filter:
        blur(16px);

    -webkit-backdrop-filter:
        blur(16px);
}

.spotlight-snap-assist-chooser.visible {
    display: block;
}

.spotlight-snap-assist-title {
    padding: 5px 5px 10px;

    font-size: 13px;

    font-weight: 600;
}

.spotlight-snap-assist-list {
    display: flex;

    flex-direction: column;

    gap: 6px;

    max-height: 280px;

    overflow-y: auto;
}

.spotlight-snap-assist-window {
    display: block;

    width: 100%;

    min-height: 42px;

    padding: 10px;

    border: 0;

    border-radius: 7px;

    background:
        rgba(255,255,255,.07);

    color: inherit;

    text-align: left;

    cursor: pointer;
}

.spotlight-snap-assist-window:hover {
    background:
        rgba(255,255,255,.14);
}

.spotlight-snap-assist-cancel {
    width: 100%;

    min-height: 38px;

    margin-top: 9px;

    border:
        1px solid rgba(255,255,255,.10);

    border-radius: 7px;

    background: transparent;

    color: inherit;

    cursor: pointer;
}


/* =========================================================
   TASKBAR
   ========================================================= */

.spotlight-taskbar {
    position: fixed;

    left: 0;

    right: 0;

    bottom: 0;

    z-index: 1000001;

    display: flex;

    align-items: center;

    gap: 5px;

    min-height: 42px;

    padding: 4px 7px;

    box-sizing: border-box;

    overflow-x: auto;

    background:
        rgba(25,25,28,.96);

    color: #fff;

    border-top:
        1px solid rgba(255,255,255,.10);

    backdrop-filter:
        blur(12px);

    -webkit-backdrop-filter:
        blur(12px);
}

.spotlight-taskbar-item {
    flex: 0 0 auto;

    display: flex;

    align-items: center;

    gap: 7px;

    min-width: 100px;

    max-width: 260px;

    height: 34px;

    padding: 0 10px;

    border: 0;

    border-radius: 6px;

    background:
        rgba(255,255,255,.07);

    color: #fff;

    cursor: pointer;
}

.spotlight-taskbar-item:hover {
    background:
        rgba(255,255,255,.13);
}

.spotlight-taskbar-item.minimized {
    opacity: .65;
}

.spotlight-taskbar-title {
    flex: 1;

    min-width: 0;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}

.spotlight-taskbar-group-count {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 19px;

    height: 19px;

    padding: 0 5px;

    border-radius: 10px;

    background:
        rgba(255,255,255,.14);

    font-size: 11px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .spotlight-window {
        min-width: 0 !important;

        min-height: 0 !important;

        width: 100vw !important;

        height:
            calc(100dvh - 42px) !important;

        max-width: 100vw !important;

        max-height:
            calc(100dvh - 42px) !important;

        left: 0 !important;

        top: 0 !important;

        border-radius: 0;
    }

    .spotlight-resize-handle {
        display: none;
    }

    .spotlight-header {
        min-height: 48px;
    }

    .spotlight-control {
        width: 38px;

        height: 38px;
    }

    .spotlight-snap-assist-preview {
        border-radius: 0;
    }

    .spotlight-snap-assist-chooser {
        left: 12px !important;

        right: 12px;

        top: auto !important;

        bottom: 54px;

        width: auto !important;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (
    min-width: 601px
) and (
    max-width: 1024px
) {

    .spotlight-window {
        max-width:
            calc(100vw - 16px);

        max-height:
            calc(100vh - 58px);
    }

    .spotlight-resize-handle {
        width: 12px;

        height: 12px;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.spotlight-control:focus-visible,
.spotlight-taskbar-item:focus-visible,
.spotlight-snap-assist-window:focus-visible,
.spotlight-snap-assist-cancel:focus-visible {
    outline:
        2px solid #4285f4;

    outline-offset:
        2px;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (
    prefers-reduced-motion: reduce
) {

    .spotlight-snap-assist-preview {
        transition: none;
    }
}
.spotlight-window {
    position: fixed;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 300px;
    min-height: 200px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    z-index: 1000;
}

.spotlight-header {
    position: relative;
    z-index: 50;

    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 42px;
    flex: 0 0 42px;

    padding: 0 6px 0 12px;

    background: #f5f5f5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);

    user-select: none;
    -webkit-user-select: none;

    touch-action: none;
    cursor: move;
}

.spotlight-title-area {
    display: flex;
    align-items: center;
    gap: 8px;

    min-width: 0;
    flex: 1 1 auto;

    overflow: hidden;
}

.spotlight-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    min-width: 22px;
    height: 22px;

    font-size: 12px;
    font-weight: 700;

    color: #555;
}

.spotlight-title {
    display: block;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.spotlight-controls {
    position: relative;
    z-index: 100;

    display: flex;
    align-items: center;

    flex: 0 0 auto;

    height: 100%;

    margin-left: 8px;
}

.spotlight-control {
    appearance: none;
    -webkit-appearance: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 36px;
    height: 32px;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 4px;

    background: transparent;
    color: #333;

    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    pointer-events: auto;

    user-select: none;
    -webkit-user-select: none;
}

.spotlight-control:hover {
    background: rgba(0, 0, 0, 0.08);
}

.spotlight-control:active {
    background: rgba(0, 0, 0, 0.15);
}

.spotlight-control:focus-visible {
    outline: 2px solid #2684ff;
    outline-offset: -2px;
}

.spotlight-control-close {
    font-size: 24px;
}

.spotlight-content {
    position: relative;

    flex: 1 1 auto;

    min-width: 0;
    min-height: 0;

    overflow: auto;

    background: #fff;
}

.spotlight-window.spotlight-minimized {
    display: none;
}

.spotlight-window.spotlight-maximized {
    border-radius: 0;
}

.spotlight-window.spotlight-fullscreen {
    border-radius: 0;
}

.spotlight-window.spotlight-dragging {
    cursor: move;
    user-select: none;
}

.spotlight-window.spotlight-resizing {
    user-select: none;
}

.spotlight-resize-handle {
    position: absolute;

    z-index: 40;

    width: 12px;
    height: 12px;

    touch-action: none;
}

.spotlight-resize-n {
    top: -5px;
    left: 12px;
    right: 12px;

    width: auto;
    cursor: ns-resize;
}

.spotlight-resize-s {
    bottom: -5px;
    left: 12px;
    right: 12px;

    width: auto;
    cursor: ns-resize;
}

.spotlight-resize-e {
    top: 12px;
    bottom: 12px;
    right: -5px;

    height: auto;
    cursor: ew-resize;
}

.spotlight-resize-w {
    top: 12px;
    bottom: 12px;
    left: -5px;

    height: auto;
    cursor: ew-resize;
}

.spotlight-resize-ne {
    top: -5px;
    right: -5px;
    cursor: nesw-resize;
}

.spotlight-resize-nw {
    top: -5px;
    left: -5px;
    cursor: nwse-resize;
}

.spotlight-resize-se {
    right: -5px;
    bottom: -5px;
    cursor: nwse-resize;
}

.spotlight-resize-sw {
    left: -5px;
    bottom: -5px;
    cursor: nesw-resize;
}


/* Content types */

.spotlight-image {
    display: block;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    margin: auto;
}

.spotlight-video {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.spotlight-audio {
    display: block;

    width: calc(100% - 30px);

    margin: 30px auto;
}

.spotlight-iframe,
.spotlight-pdf,
.spotlight-embed {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}

.spotlight-json {
    box-sizing: border-box;

    margin: 0;
    padding: 16px;

    white-space: pre-wrap;
    word-break: break-word;

    font-family: monospace;
}

.spotlight-error {
    box-sizing: border-box;

    margin: 20px;
    padding: 16px;

    border: 1px solid #d33;
    border-radius: 6px;

    background: #fff5f5;
}

.spotlight-error strong {
    display: block;
    margin-bottom: 10px;
}

.spotlight-error pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.spotlight-window {
    --spotlight-accent: #374151;
    --spotlight-header-bg: #111827;
    --spotlight-header-color: #ffffff;
    --spotlight-header-hover: #1f2937;
    --spotlight-border-color: #374151;
    --spotlight-focus-color: #374151;
}

.spotlight-window .spotlight-header {
    background: var(--spotlight-header-bg);
    color: var(--spotlight-header-color);
}

.spotlight-window .spotlight-control:hover {
    background: var(--spotlight-header-hover);
}

.spotlight-window .spotlight-accent {
    color: var(--spotlight-accent);
}
.spotlight-window:focus-within {
    border-color: var(--spotlight-focus-color);
}

.spotlight-theme-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.spotlight-theme-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spotlight-theme-icon {
    font-size: 16px;
    line-height: 1;
    color: var(--spotlight-accent);
}

.spotlight-theme-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;

    min-width: 150px;

    padding: 5px;

    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .18);

    z-index: 999999;

    color: #111827;
}

.spotlight-theme-option {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 7px 9px;

    border: 0;
    background: transparent;

    cursor: pointer;

    text-align: left;

    border-radius: 4px;
}

.spotlight-theme-option:hover {
    background: #f3f4f6;
}

.spotlight-theme-swatch {
    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    border-radius: 50%;
}

.spotlight-theme-name {
    font-size: 12px;
    white-space: nowrap;
}

.spotlight-theme-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.spotlight-theme-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spotlight-theme-icon {
    font-size: 16px;
    line-height: 1;
    color: var(--spotlight-accent);
}

.spotlight-theme-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;

    min-width: 150px;

    padding: 5px;

    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;

    box-shadow: 0 8px 25px rgba(0, 0, 0, .18);

    z-index: 999999;

    color: #111827;
}

.spotlight-theme-option {
    width: 100%;

    display: flex;
    align-items: center;

    gap: 8px;

    padding: 7px 9px;

    border: 0;
    background: transparent;

    cursor: pointer;

    text-align: left;

    border-radius: 4px;
}

.spotlight-theme-option:hover {
    background: #f3f4f6;
}

.spotlight-theme-swatch {
    width: 14px;
    height: 14px;

    flex: 0 0 14px;

    border-radius: 50%;
}

.spotlight-theme-name {
    font-size: 12px;
    white-space: nowrap;
}


/* Mobile */

@media (max-width: 600px) {

    .spotlight-window {
        min-width: 0 !important;
        min-height: 0 !important;

        width: 100vw !important;
        height: 100dvh !important;

        max-width: 100vw !important;
        max-height: 100dvh !important;

        left: 0 !important;
        top: 0 !important;

        border-radius: 0 !important;
    }

    .spotlight-header {
        min-height: 48px;
        flex-basis: 48px;
    }

    .spotlight-control {
        width: 42px;
        height: 40px;
    }

    .spotlight-resize-handle {
        display: none;
    }

    .spotlight-content {
        overflow: auto;
    }
}


/* Tablet */

@media (min-width: 601px) and (max-width: 1024px) {

    .spotlight-window {
        max-width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .spotlight-resize-handle {
        width: 14px;
        height: 14px;
    }
}


/* Reduced motion */

@media (prefers-reduced-motion: reduce) {

    .spotlight-window,
    .spotlight-control {
        transition: none !important;
    }
}