/* =============================================================================
   RAG Demo - Static Site Overrides
   Layered on top of main.css + bare.css (body always has bare-mode)
   ============================================================================= */

/* Hide elements not needed in demo */
body.bare-mode .header-right {
    display: none !important;
}

/* Header brand text */
.header-brand {
    font-weight: bold;
    font-size: 13px;
    color: #000000;
    letter-spacing: 0.5px;
}

/* =============================================================================
   Sub-header Banner
   ============================================================================= */

.sub-header {
    position: fixed;
    top: 36px;
    left: 0;
    right: 0;
    z-index: 99;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: #000080;
    color: #ffffff;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 12px;
    border-bottom: 2px solid #404040;
}

.sub-header a {
    color: #ffffff;
    text-decoration: underline;
}

.sub-header a:hover {
    color: #d0d0d0;
}

/* Push main-container below header + sub-header */
body.bare-mode .main-container {
    height: calc(100vh - 66px) !important;
    height: calc(100dvh - 66px) !important;
    margin-top: 66px !important;
}

/* =============================================================================
   Content Layout Override
   Ensure chat scrolls and question bar stays pinned at bottom.
   bare.css sets overflow-y:auto on .content at >1024px — override that.
   ============================================================================= */

body.bare-mode .content {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: hidden !important;
}

/* =============================================================================
   Question Bar — Always visible at bottom of content area
   ============================================================================= */

.question-bar {
    flex-shrink: 0;
    padding: 10px 16px 12px;
    border-top: 2px solid #808080;
    background: #c0c0c0;
}

.question-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    max-width: 700px;
    margin: 0 auto;
}

.question-btn {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: #c0c0c0;
    border: 2px outset #808080;
    border-radius: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 13px;
    color: #000080;
    text-align: left;
    cursor: pointer;
    transition: none;
    line-height: 1.4;
}

.question-btn:hover {
    background: #d0d0d0;
}

.question-btn:active {
    border-style: inset;
}

.question-btn.active {
    border-style: inset;
    background: #b0b0b0;
}

/* =============================================================================
   Answer Area
   ============================================================================= */

/* Show detailed answer button */
.btn-expand-answer {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    background: #c0c0c0;
    border: 2px outset #808080;
    border-radius: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #000080;
    cursor: pointer;
    transition: none;
}

.btn-expand-answer:hover {
    background: #d0d0d0;
}

.btn-expand-answer:active {
    border-style: inset;
}

/* Answer content (HTML from QA.json) */
.answer-content {
    line-height: 1.6;
}

.answer-content strong {
    font-weight: 700;
}

.answer-content em {
    font-style: italic;
}

/* =============================================================================
   Welcome Adjustments
   ============================================================================= */

body.bare-mode .welcome-message {
    padding: 40px 20px 20px;
}

body.bare-mode .welcome-message h2 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #000080;
}

body.bare-mode .welcome-message p {
    font-size: 12px;
    color: #404040;
    margin-bottom: 0;
}

/* =============================================================================
   Progress Indicator in Demo
   ============================================================================= */

body.bare-mode .query-progress {
    max-width: 700px;
}

/* =============================================================================
   Source Chip Active State
   ============================================================================= */

/* Source panel top offset — account for sub-header on tablet */
@media (max-width: 1024px) {
    body.bare-mode .source-panel {
        top: 66px !important;
    }
}

/* Source panel top offset — account for taller sub-header on mobile */
@media (max-width: 640px) {
    body.bare-mode .source-panel {
        top: 84px !important;
    }
}

body.bare-mode .source-chip .number {
    white-space: nowrap;
}

body.bare-mode .source-chip.active {
    background: #000080;
    color: #ffffff;
    border-color: #000080;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media (max-width: 640px) {
    .sub-header {
        height: auto;
        padding: 6px 12px;
        justify-content: center;
        text-align: center;
        font-size: 11px;
        line-height: 1.4;
    }

    body.bare-mode .main-container {
        height: calc(100vh - 84px) !important;
        height: calc(100dvh - 84px) !important;
        margin-top: 84px !important;
    }

    body.bare-mode .source-panel {
        top: 84px !important;
    }

    .question-btn {
        font-size: 12px;
        padding: 8px 10px;
        line-height: 1.35;
    }

    /* Hide Q1 and Q4 on mobile — keep 2 questions for compact layout */
    .question-grid .question-btn:nth-child(1),
    .question-grid .question-btn:nth-child(4) {
        display: none;
    }

    .question-bar {
        padding: 8px 10px 10px;
    }

    .question-grid {
        gap: 6px;
    }
}
