/* ==========================================================================
   Spotlight Search — Ntono Digital
   Apple-inspired floating search overlay with glassmorphism.
   ========================================================================== */

/* ── Trigger Button (Header Pill) ──────────────────────────────────── */

/* Ensure header-actions is a flex row (higher specificity to guarantee layout) */
.ntono-header-pill .ntono-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ntono-search-trigger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease, background-color 0.3s ease;
    padding: 0;
    flex-shrink: 0;
}

.ntono-search-trigger:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.ntono-search-trigger .material-symbols-outlined {
    font-size: 1.25rem;
}

/* Hide search trigger in header on mobile — it lives in the mobile menu instead */
@media (max-width: 768px) {
    .ntono-header-pill .ntono-search-trigger {
        display: none !important;
    }
}

/* ── Overlay Backdrop ──────────────────────────────────────────────── */
.ntono-spotlight {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    padding-top: 15vh;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    visibility: hidden;
    pointer-events: none;
    transition: background 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease, visibility 0s 0.35s;
}

.ntono-spotlight.is-open {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    visibility: visible;
    pointer-events: auto;
    transition: background 0.35s ease, backdrop-filter 0.35s ease, -webkit-backdrop-filter 0.35s ease, visibility 0s 0s;
}

/* ── Search Panel ──────────────────────────────────────────────────── */
.ntono-spotlight__panel {
    width: 100%;
    max-width: 580px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(40px) saturate(1.5);
    -webkit-backdrop-filter: blur(40px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}

.ntono-spotlight.is-open .ntono-spotlight__panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ── Input Row ─────────────────────────────────────────────────────── */
.ntono-spotlight__input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ntono-spotlight__icon {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    display: flex;
}

.ntono-spotlight__input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 1.125rem;
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    color: #fff;
    caret-color: var(--accent-saffron, #FAA916);
}

.ntono-spotlight__input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.ntono-spotlight__kbd {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 2px 6px;
    flex-shrink: 0;
    line-height: 1.4;
}

.ntono-spotlight__clear {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.35);
    padding: 4px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
}

.ntono-spotlight__clear:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.ntono-spotlight__clear .material-symbols-outlined {
    font-size: 1.125rem;
}

.ntono-spotlight.has-query .ntono-spotlight__clear {
    display: flex;
}

.ntono-spotlight.has-query .ntono-spotlight__kbd {
    display: none;
}

/* ── Category Chips ────────────────────────────────────────────────── */
.ntono-spotlight__chips {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ntono-spotlight__chips::-webkit-scrollbar {
    display: none;
}

.ntono-spotlight__chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 0.375rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.ntono-spotlight__chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.ntono-spotlight__chip.is-active {
    background: var(--accent-saffron, #FAA916);
    border-color: var(--accent-saffron, #FAA916);
    color: #000;
    font-weight: 600;
}

/* ── Results ───────────────────────────────────────────────────────── */
.ntono-spotlight__results {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    -ms-overflow-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.ntono-spotlight__results::-webkit-scrollbar {
    width: 4px;
}

.ntono-spotlight__results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Individual result item */
.ntono-spotlight__result {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    transition: background 0.15s ease;
    cursor: pointer;
}

.ntono-spotlight__result:hover,
.ntono-spotlight__result.is-focused {
    background: rgba(255, 255, 255, 0.06);
}

.ntono-spotlight__result.is-focused {
    background: rgba(250, 169, 22, 0.1);
}

.ntono-spotlight__result-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.ntono-spotlight__result-icon .material-symbols-outlined {
    font-size: 1.125rem;
}

.ntono-spotlight__result-text {
    flex: 1;
    min-width: 0;
}

.ntono-spotlight__result-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ntono-spotlight__result-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ntono-spotlight__result-arrow {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.15);
    font-size: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.ntono-spotlight__result:hover .ntono-spotlight__result-arrow,
.ntono-spotlight__result.is-focused .ntono-spotlight__result-arrow {
    color: var(--accent-saffron, #FAA916);
    transform: translateX(2px);
}

/* ── States: Empty / Loading / No Results ──────────────────────────── */
.ntono-spotlight__empty,
.ntono-spotlight__no-results {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
}

.ntono-spotlight__empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

.ntono-spotlight__loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.ntono-spotlight__spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-saffron, #FAA916);
    border-radius: 50%;
    animation: ntono-spotlight-spin 0.7s linear infinite;
}

@keyframes ntono-spotlight-spin {
    to { transform: rotate(360deg); }
}

/* ── Footer hint ───────────────────────────────────────────────────── */
.ntono-spotlight__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.625rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
}

.ntono-spotlight__footer kbd {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px 5px;
    margin: 0 2px;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .ntono-spotlight {
        padding: 1rem;
        padding-top: 10vh;
        align-items: flex-start;
    }

    .ntono-spotlight__panel {
        max-width: 100%;
        border-radius: 16px;
        max-height: 80vh;
    }

    .ntono-spotlight__kbd {
        display: none;
    }

    .ntono-spotlight__footer {
        display: none;
    }
}
