/**
 * Thingcons Architectural Search Popup Styles - Luxury Dark Glassmorphism Edition
 * Features deep translucent dark smoke glass, vibrant backdrop blur, and luminous amber accents.
 */

/* ==========================================================================
   Header Search Trigger Buttons
   ========================================================================== */
.gb-shape-791f878a,
.gb-shape-83a59ae0,
.thingcons-search-toggle,
[data-search-trigger] {
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease !important;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.gb-shape-791f878a:hover,
.gb-shape-83a59ae0:hover,
.thingcons-search-toggle:hover,
[data-search-trigger]:hover {
    color: var(--accent, #FFC456) !important;
    transform: scale(1.12);
}

.gb-shape-791f878a:active,
.gb-shape-83a59ae0:active,
.thingcons-search-toggle:active,
[data-search-trigger]:active {
    transform: scale(0.96);
}

/* ==========================================================================
   Modal Backdrop & Overlay (Hardware-Accelerated Zero-Lag Blur)
   ========================================================================== */
.thingcons-search-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
    font-family: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.thingcons-search-modal * {
    box-sizing: border-box;
}

.thingcons-search-modal.is-open {
    visibility: visible;
    pointer-events: auto;
}

.thingcons-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 7, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: opacity;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.thingcons-search-modal.is-open .thingcons-search-backdrop {
    opacity: 1;
}

/* ==========================================================================
   Modal Container & Dialog Box (Dark Glassmorphism)
   ========================================================================== */
.thingcons-search-container {
    position: relative;
    width: 100%;
    max-width: 660px;
    margin: 60px 20px 20px 20px;
    z-index: 10;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}

.thingcons-search-dialog {
    background: rgb(26 23 20 / 0%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    box-shadow: 
        0 30px 80px -15px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 1px 0 rgba(255, 255, 255, 0.22) inset;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    opacity: 0;
    transform: translate3d(0, -14px, 0) scale(0.98);
    -webkit-transform: translate3d(0, -14px, 0) scale(0.98);
    will-change: transform, opacity;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
}

.thingcons-search-modal.is-open .thingcons-search-dialog {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    -webkit-transform: translate3d(0, 0, 0) scale(1);
}

/* ==========================================================================
   Topbar (Brand Heading & Glass Close Button)
   ========================================================================== */
.thingcons-search-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.thingcons-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-accent-mark {
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--accent, #FFC456);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 196, 86, 0.5);
}

.topbar-heading {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #D6D3D1;
}

.thingcons-search-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #A8A29E;
    transition: all 0.2s ease;
    padding: 0;
}

.thingcons-search-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
    border-color: var(--accent, #FFC456);
    transform: rotate(90deg);
    box-shadow: 0 0 12px rgba(255, 196, 86, 0.35);
}

/* ==========================================================================
   Search Input Wrap & Translucent Input Box
   ========================================================================== */
.thingcons-search-input-wrap {
    padding: 16px 20px 12px 20px;
    background: transparent;
}

.thingcons-search-form {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 7px 15px;
    background: rgba(255, 255, 255, 0.07);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) inset, 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.thingcons-search-form:focus-within {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent, #FFC456);
    box-shadow: 
        0 0 0 3px rgba(255, 196, 86, 0.25),
        0 0 22px rgba(255, 196, 86, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.thingcons-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #A8A29E;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.thingcons-search-form:focus-within .thingcons-search-icon {
    color: var(--accent, #FFC456);
}

.thingcons-search-icon svg {
    width: 19px;
    height: 19px;
}

.thingcons-search-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 16.5px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    color: #FFFFFF !important;
    padding: 8px 0 !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
}

.thingcons-search-input::placeholder {
    color: #78716C !important;
    font-weight: 400;
}

/* Hide native webkit search decorations */
.thingcons-search-input::-webkit-search-cancel-button,
.thingcons-search-input::-webkit-search-decoration,
.thingcons-search-input::-webkit-search-results-button,
.thingcons-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: none !important;
}

/* Clear Button */
.thingcons-search-clear {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #D6D3D1;
    padding: 0;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.thingcons-search-clear:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #FFFFFF;
}

/* Loading Spinner */
.thingcons-search-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.thingcons-search-spinner svg {
    animation: thingcons-rotate 1.5s linear infinite;
    width: 18px;
    height: 18px;
}

.thingcons-search-spinner .path {
    stroke: var(--accent, #FFC456);
    stroke-linecap: round;
    animation: thingcons-dash 1.2s ease-in-out infinite;
}

@keyframes thingcons-rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes thingcons-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* ==========================================================================
   Modal Body (Content Area)
   ========================================================================== */
.thingcons-search-body {
    padding: 6px 20px 18px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: 480px;
    background: transparent;
}

.thingcons-search-body::-webkit-scrollbar {
    width: 5px;
}

.thingcons-search-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 4px;
}

/* ==========================================================================
   Suggestions Area (Translucent Dark Glass Hashtags)
   ========================================================================== */
.thingcons-search-suggestions {
    padding: 8px 0;
}

.suggestions-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.suggestions-decor-line {
    width: 18px;
    height: 2px;
    background: var(--accent, #FFC456);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 196, 86, 0.4);
}

.suggestions-label-text {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #A8A29E;
}

.suggestions-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 6px 13px;
    font-size: 13.5px;
    font-weight: 500;
    color: #E7E5E4;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.suggestion-tag:hover {
    background: rgba(255, 196, 86, 0.16);
    border-color: var(--accent, #FFC456);
    color: #FFC456;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 196, 86, 0.25), 0 0 0 1px rgba(255, 196, 86, 0.2);
}

.suggestion-tag:active {
    transform: translateY(0);
}

/* ==========================================================================
   Live Search Results List (Dark Glass Architectural Cards)
   ========================================================================== */
.thingcons-search-section {
    margin-bottom: 16px;
}

.thingcons-search-section:last-child {
    margin-bottom: 0;
}

.thingcons-section-title {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #A8A29E;
    padding: 6px 4px 10px 4px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.thingcons-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin-left: 6px;
}

.thingcons-result-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.thingcons-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-left: 3px solid transparent;
    text-decoration: none !important;
    color: #FFFFFF !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
}

.thingcons-result-item:hover,
.thingcons-result-item:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    border-left-color: var(--accent, #FFC456);
    transform: translateX(3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 196, 86, 0.12);
}

.thingcons-result-thumb {
    width: 68px;
    height: 50px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.thingcons-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thingcons-result-thumb-placeholder {
    color: #78716C;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.thingcons-result-info {
    flex: 1;
    min-width: 0;
}

.thingcons-result-title {
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.35;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.thingcons-result-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #A8A29E;
}

.thingcons-cat-badge {
    display: inline-block;
    background: rgba(255, 196, 86, 0.18);
    color: #FFC456;
    border: 1px solid rgba(255, 196, 86, 0.35);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
}

.thingcons-result-arrow {
    color: #78716C;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.thingcons-result-item:hover .thingcons-result-arrow {
    color: var(--accent, #FFC456);
    transform: translateX(3px);
}

/* ==========================================================================
   View All Button (Glowing Amber Dark Glass CTA)
   ========================================================================== */
.thingcons-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    margin-top: 10px;
    background: rgba(255, 196, 86, 0.12);
    border: 1px solid rgba(255, 196, 86, 0.3);
    border-radius: 10px;
    color: #FFC456 !important;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(255, 196, 86, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
}

.thingcons-view-all svg {
    color: #FFC456;
    transition: transform 0.2s ease, color 0.2s ease;
}

.thingcons-view-all:hover {
    background: rgba(255, 196, 86, 0.22);
    border-color: #FFC456;
    color: #FFD27D !important;
    box-shadow: 0 4px 18px rgba(255, 196, 86, 0.35);
}

.thingcons-view-all:hover svg {
    color: #FFD27D;
    transform: translateX(4px);
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.thingcons-no-results {
    text-align: center;
    padding: 36px 16px;
    color: #A8A29E;
}

.thingcons-no-results-icon {
    margin-bottom: 12px;
    color: #57534E;
}

.thingcons-no-results-title {
    font-size: 15.5px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.thingcons-no-results-desc {
    font-size: 13.5px;
    color: #A8A29E;
    margin: 0;
}

/* ==========================================================================
   Footer (Translucent Dark Shortcut Bar)
   ========================================================================== */
.thingcons-search-footer {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: #78716C;
}

.shortcut-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.shortcut-tip kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10.5px;
    font-weight: 600;
    color: #D6D3D1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   Mobile Responsive
   ========================================================================== */
@media (max-width: 640px) {
    .thingcons-search-container {
        margin: 12px 10px;
        max-height: calc(100vh - 24px);
    }

    .thingcons-search-dialog {
        border-radius: 14px;
    }

    .thingcons-search-topbar {
        padding: 10px 14px 8px 14px;
    }

    .thingcons-search-input-wrap {
        padding: 10px 14px 8px 14px;
    }

    .thingcons-search-form {
        padding: 4px 10px;
    }

    .thingcons-search-input {
        font-size: 16px !important;
    }

    .thingcons-search-body {
        padding: 6px 14px 14px 14px;
        max-height: 65vh;
    }

    .thingcons-search-footer {
        display: none;
    }

    .suggestion-tag {
        font-size: 13px;
        padding: 5px 11px;
    }

    .thingcons-result-thumb {
        width: 58px;
        height: 44px;
    }
}

/* ==========================================================================
   Graceful Fallback for browsers without backdrop-filter
   ========================================================================== */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .thingcons-search-backdrop {
        background: rgba(10, 8, 7, 0.92);
    }
    .thingcons-search-dialog {
        background: #1C1917;
        border: 1px solid #292524;
    }
    .thingcons-search-form {
        background: #292524;
    }
    .suggestion-tag {
        background: #292524;
    }
    .thingcons-result-item {
        background: #292524;
    }
    .thingcons-view-all {
        background: #292524;
    }
    .thingcons-search-footer {
        background: #151311;
    }
}
