/* =============================================
   LANGUAGE TOGGLE
   Fixed to top right — floats above everything
   including Arolax's GSAP animation layers
   ============================================= */

#lang-toggle-bar {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
}

#lang-toggle {
    cursor: pointer;
    padding: 6px 14px;
    font-size: 14px;
    background-color: #F0FEFF;
    border: 1px solid currentColor;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

#lang-toggle:hover {
    opacity: 0.7;
}


/* =============================================
   SEARCH WRAPPER
   Scopes all search elements so they don't
   interfere with Arolax's own styles
   ============================================= */

#alex-search-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 0;
}


/* =============================================
   SEARCH BAR
   ============================================= */

#search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

#search-input {
    flex: 1;                          /* takes all available space */
    padding: 10px 16px;
    font-size: 16px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    outline: none;
    background: #F0FEFF;
    transition: border-color 0.2s ease;
}

#search-input:focus {
    border-color: currentColor;
}

#search-btn {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid currentColor;
    background: transparent;
    transition: opacity 0.2s ease;
    white-space: nowrap;              /* prevents button text from wrapping */
}

#search-btn:hover {
    opacity: 0.7;
}


/* =============================================
   RESULT CARDS
   ============================================= */

#search-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.search-card {
    padding: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: #F0FEFF;
    transition: border-color 0.2s ease;
}

.search-card:hover {
    border-color: currentColor;
}

/* Small page label above the heading */
.search-card-page {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    margin-bottom: 6px;
}

.search-card-heading {
    margin: 0 0 8px 0;
    font-size: 18px;
}

/* Content preview — truncated by JS to 200 chars */
.search-card-content {
    margin: 0 0 12px 0;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1.6;
}

.search-card-link {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.search-card-link:hover {
    text-decoration: underline;
}

/* Shown when search returns nothing */
.no-results {
    opacity: 0.5;
    font-style: italic;
}


/* =============================================
   AI ANSWER BOX
   Hidden by default — JS removes .hidden
   class when there is an answer to show
   ============================================= */

#answer-box {
    padding: 24px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #F0FEFF;
    margin-top: 8px;
}

/* Small label above the answer */
#answer-title {
    margin: 0 0 12px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

/* The actual answer text injected by JS */
#answer-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
}

/* Shows while Transformer.js is thinking */
#answer-loading {
    font-style: italic;
    opacity: 0.5;
}


/* =============================================
   UTILITY
   .hidden is used by JS to show/hide elements
   !important ensures Arolax cannot override it
   ============================================= */

.hidden {
    display: none !important;
}


/* =============================================
   SCROLL PROGRESS INDICATOR
   Fixed bar at the top that fills left-to-right
   as user scrolls down the page
   ============================================= */

#scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: orange;
    width: 0%;
    z-index: 99998;
    transition: width 0.1s ease-out;
}


/* =============================================
   RESPONSIVE
   On small screens stack the search bar
   ============================================= */

@media (max-width: 600px) {
    #search-bar {
        flex-direction: column;
    }

    #lang-toggle-bar {
        top: 12px;
        right: 12px;
    }
}