/* record_ui.css */

.record-response-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 0;
    max-width: 800px;
    margin: 0 auto;
}

/* Motorcycle Context Header (Clean Typography Capsule) */
.record-motorcycle-header {
    background-color: var(--bg-card);
    border-radius: 50px; /* Stadium / Capsule shape */
    padding: 12px 24px;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    border: 3px solid var(--accent-color); /* Signature gold trim */
    margin: 0 0 20px 0;
    box-shadow: inset 0 0 10px rgba(178, 148, 91, 0.1);
    box-sizing: border-box;
    flex-wrap: wrap;
}

.record-motorcycle-header span {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

.record-motorcycle-header .record-header-sep {
    color: var(--accent-color);
    font-weight: 400;
    opacity: 0.85;
}

/* Question Card (Replaces Bubble) */
.record-question-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-card);
    margin-bottom: 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.record-question-main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
}

.record-question-q {
    font-family: var(--font-sans); /* Closer to the Dash's geometric sans */
    font-weight: 600;
    font-size: 3rem;
    color: #10B981; /* Tripper Dash Green */
    line-height: 1;
}

.record-question-text {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
}

/* Question Footer (Inside the card) */
.record-question-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background-color: rgba(0,0,0,0.02);
    border-top: 1px solid var(--border-color);
}
html.dark-theme .record-question-footer {
    background-color: rgba(255,255,255,0.02);
}

.record-question-code {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Collapsible Card (Accordion) */
.record-collapsible-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    overflow: hidden;
    transition: all 0.3s ease;
    border-inline-start: 4px solid transparent;
}
.record-collapsible-card.open {
    border-inline-start: 4px solid var(--accent-color);
}

.record-collapsible-header {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background-color: transparent;
    user-select: none;
}

.record-collapsible-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-collapsible-icon {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(178, 148, 91, 0.1);
    color: var(--accent-color);
}


.record-collapsible-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: 0.5px;
}

.record-collapsible-toggle {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.record-collapsible-card.open .record-collapsible-toggle {
    transform: rotate(180deg);
}

.record-collapsible-content {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
}

/* Dashboard Telltale SVG Icons */
.telltale-icon {
    display: block;
    width: 20px;
    height: 20px;
}

/* Red dashboard warning (e.g., Oil Pressure) */
.record-collapsible-icon.telltale-red {
    background-color: transparent;
    color: #FF3B30; /* Dashboard Red */
}
.record-collapsible-icon.telltale-red .telltale-icon {
    width: 24px;
    height: 24px;
}

/* Amber dashboard warning (e.g., Check Engine) */
.record-collapsible-icon.telltale-amber {
    background-color: transparent;
    color: #FF9500; /* Dashboard Amber */
}
.record-collapsible-icon.telltale-amber .telltale-icon {
    width: 24px;
    height: 24px;
}

.record-collapsible-card.open .record-collapsible-content {
    padding: 0 24px 24px 24px;
    max-height: none;
}

/* Actionable Checklist inside content */
.record-checklist {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.record-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background-color: rgba(0,0,0,0.02);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
html.dark-theme .record-checklist-item {
    background-color: rgba(255,255,255,0.02);
}

.record-checklist-item.checked {
    background-color: rgba(40, 167, 69, 0.05);
    border-color: rgba(40, 167, 69, 0.2);
}

.record-checklist-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.record-checklist-text {
    flex: 1;
}

.record-checklist-item.checked .record-checklist-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Markdown Content Rendering (Mistune) */
/* -------------------------------------------------------------------------- */

.record-bullet-list {
    padding-inline-start: 24px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.record-h4 {
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 1.05em;
    font-weight: 600;
    color: var(--text-primary);
}

.record-h5 {
    margin-top: 12px;
    margin-bottom: 6px;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Inline Page Citation Tags */
.record-inline-citation {
    font-size: 0.82em;
    font-weight: 500;
    color: var(--text-secondary);
    unicode-bidi: isolate;
    white-space: nowrap;
    margin-inline-start: 2px;
}

/* Textual Information Sources (Citations Footer Block) */
.record-sources-container {
    margin-top: 14px;
    margin-bottom: 0;
    padding: 16px 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.record-sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.record-source-item {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.02);
}

html.dark-theme .record-source-item {
    background-color: rgba(255, 255, 255, 0.03);
}

.record-source-book-title {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.record-source-dot {
    color: var(--accent-color);
    font-weight: 700;
}

.record-source-pages {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.4;
}

.record-diagrams-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.record-diagrams-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* Markdown Alerts */
.record-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
}

.record-alert-warning {
    background-color: rgba(220, 53, 69, 0.05);
    border-inline-start: 3px solid #dc3545;
}

.record-alert-warning .record-alert-icon,
.record-alert-warning strong {
    color: #dc3545;
}

.record-alert-info {
    background-color: rgba(10, 132, 255, 0.05);
    border-inline-start: 3px solid #0a84ff;
}

.record-alert-info .record-alert-icon,
.record-alert-info strong {
    color: #0a84ff;
}

/* Markdown Tables */
.record-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 12px 0;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.record-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    text-align: start;
}

.record-table th,
.record-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.record-table th {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.03);
    white-space: nowrap;
}

html.dark-theme .record-table th {
    background-color: rgba(255, 255, 255, 0.04);
}

.record-table tbody tr:last-child td {
    border-bottom: none;
}

.record-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.015);
}

html.dark-theme .record-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.015);
}

/* -------------------------------------------------------------------------- */
/* Record & Search Page Layout, Loaders & Clarification UI                    */
/* -------------------------------------------------------------------------- */

.is-hidden {
    display: none;
}

.record-body-wrapper {
    width: 100%;
    max-width: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.record-loader-card {
    width: 100%;
    min-height: 100px;
    padding: 20px;
    box-sizing: border-box;
    height: auto;
}

.record-loader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.record-loader-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: zamm-spin 0.9s linear infinite;
    margin: 4px auto;
}

#answer-area {
    width: 100%;
}

/* Two-Card Search Loading Layout */
.search-loader-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.search-main-card {
    padding: 24px 28px;
    gap: 14px;
}

#search-title {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.search-main-explanation {
    font-size: 1rem !important;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

.search-main-worth-it {
    font-size: 1.05rem !important;
    font-weight: 700;
    color: var(--accent-color);
    margin: 2px 0 0 0;
}

/* Bottom Compact Card for Live Server Status */
.search-live-status-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
}

.search-live-spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: zamm-spin 0.9s linear infinite;
    flex-shrink: 0;
}

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

#loader-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

#conversation-container {
    width: 100%;
    min-height: 120px;
    padding: 24px;
    box-sizing: border-box;
    height: auto;
}

#clarification-title {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
    text-align: center;
}

#clarification-area {
    display: none;
    text-align: center;
}

#clarification-text {
    font-size: 17px;
    margin-bottom: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

#clarification-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 440px;
    margin: 0 auto;
}

.clarification-option-btn {
    padding: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background: var(--bg-main);
    color: var(--text-primary);
    font-weight: 600;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.clarification-option-btn:hover {
    border-color: var(--accent-color);
}

.clarification-other-btn {
    padding: 14px;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.clarification-other-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

#clarification-other-container {
    display: none;
    max-width: 440px;
    margin: 14px auto 0 auto;
    flex-direction: column;
    gap: 10px;
}

#clarification-other-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #ccc);
    font-size: 15px;
    box-sizing: border-box;
    background: var(--bg-card, #fff);
    color: var(--text-primary, #111);
}

#clarification-other-submit {
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

#error-area {
    display: none;
    text-align: center;
    padding: 12px;
    color: var(--text-primary);
}
