* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-sidebar: #f5f3f0;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #6c757d;
    --color-accent-blue: #3b82f6;
    --color-accent-teal: #14b8a6;
    --color-accent-red: #ff9a9a;
    --color-green-high: rgba(74, 222, 128, 0.2);
    --color-yellow-medium: rgba(251, 191, 36, 0.2);
    --color-red-low: rgba(248, 113, 113, 0.2);
    --color-border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 15px rgba(0, 0, 0, 0.1);
}

html {
    height: 100%;
    overflow: hidden;
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}

body {
    font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(153deg, #f4f6ea, transparent 70.71%),
                linear-gradient(313deg, #d8d0a4, transparent 70.71%),
                linear-gradient(110deg, #b09c5f, transparent 70.71%);
    color: var(--color-text-primary);
    line-height: 1.6;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Add noise/grain texture overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='6.5' numOctaves='1' seed='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='1'/%3E%3C/svg%3E");
    background-size: 100px 100px;
}

/* Ensure content appears above the grain texture */
body > * {
    position: relative;
    z-index: 2;
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color 0.3s;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(200, 200, 200, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: var(--color-accent-blue);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Toggle label states (controlled via JavaScript) */
.toggle-label.active {
    color: var(--color-text-primary);
}

.toggle-label.inactive {
    color: var(--color-text-secondary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-info-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 12px;
    background: rgb(192 192 192 / 39%);
    border-radius: 24px;
    transition: background 0.2s;
}

.user-info-container:hover {
    background: rgb(192 192 192 / 50%);
}

.username {
    font-size: 13px;
    color: #3a3a3a;
    font-weight: 500;
}

.user-specialty {
    font-size: 10px;
    color: #6a6a6a;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.avatar {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.1);
    color: #3a3a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-icon {
    font-size: 10px;
    color: var(--color-text-secondary);
}

/* Query Input Area (Top) */
.query-input-area-top {
    background: rgb(222 214 205 / 60%);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 64px;
    z-index: 10;
}

/* Status Bar */
.status-bar {
    background: rgb(222 214 205 / 60%);
    backdrop-filter: blur(10px);
    padding: 8px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 144px;
    z-index: 89;
    border-bottom: 1px solid rgba(200, 200, 200, 0.3);
    height: 40px;
}

.status-pill {
    padding: 7px 9px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 100;
    font-family: 'Karla', sans-serif;
    background: rgb(239 231 223);
    color: black;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: inline-block;
    border: 1px solid rgb(0 0 0 / 19%);
    box-shadow: var(--shadow-md);
    position: absolute;
    top: 30%;
    white-space: nowrap;
    overflow: hidden;
    line-height: 15px;
    z-index: 200;
}

.status-pill.visible {
    opacity: 1;
}

.status-pill.shimmer {
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

.status-pill.position-left {
    left: 20%;
    transform: translate(-50%, -50%);
}

.status-pill.position-center {
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-pill.position-right {
    left: 70%;
    transform: translate(-50%, -50%);
}

.query-input-container-top {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

.query-input-top {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 24px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 50px;
    line-height: 1.5;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.query-input-top:focus {
    outline: none;
    border-color: var(--color-accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.query-input-top::placeholder {
    color: #9ca3af;
}

.send-button-top {
    width: 44px;
    height: 44px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.send-button-top svg {
    filter: brightness(0) invert(1);
}

.send-button-top:hover {
    background: #059669;
    transform: scale(1.05);
}

.send-button-top:active {
    transform: scale(0.95);
}

/* Main Container (Two-column layout) */
.main-container {
    display: flex;
    height: calc(100vh - 64px - 80px);
    overflow: hidden;
}

/* Evidence Panel (Left - 40%) */
.evidence-panel {
    width: 40%;
    max-width: 500px;
    background: linear-gradient(135deg, rgba(235, 235, 235, 0.6) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(5px);
    padding: 16px;
    overflow-y: auto;
    border-right: 1px solid rgba(200, 200, 200, 0.3);
    transition: width 0.3s ease, padding 0.3s ease;
    box-shadow: var(--shadow-xl);
    flex-shrink: 0;
}

/* Hide scrollbar for evidence panel */
.evidence-panel::-webkit-scrollbar {
    display: none;
}

.evidence-panel {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.evidence-panel.collapsed {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
}

.evidence-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 15px 4px 0 4px;
}

.evidence-panel-title-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.evidence-panel-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    padding-left: 5px;
}

.evidence-panel-subtitle {
    font-family: 'Karla', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-secondary);
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.evidence-panel-subtitle span {
    padding: 5px;
}

.amboss-logo-link {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s;
}

.amboss-logo-link:hover {
    opacity: 0.8;
}

.amboss-logo {
    height: 20px;
    width: auto;
    vertical-align: middle;
}

.amboss-link {
    color: #3b82f6;
    text-decoration: underline;
    transition: color 0.2s;
}

.amboss-link:hover {
    color: #2563eb;
}

.collapse-toggle {
    display: none;
}

.collapse-toggle:hover {
    color: var(--color-text-primary);
    background: rgba(0, 0, 0, 0.05);
}

.evidence-panel.collapsed .collapse-toggle {
    transform: rotate(180deg);
}

/* Old evidence-status removed - now using global status bar */

.evidence-summary {
    background: rgb(230 224 214 / 82%);
    padding: 15px 25px 10px 25px;
    margin: 0 0 20px 0;
    font-size: 13px;
    color: var(--color-text-primary);
    border-left: 1px solid rgba(200, 200, 200, 0.3);
    border-right: 1px solid rgba(200, 200, 200, 0.3);
    border-bottom: 1px solid rgb(128 128 128 / 30%);
    height: 277px;
    position: relative;
    left: -15px;
    width: calc(100% + 32px);
    overflow: hidden;
    transition: height 0.4s ease;
}

.evidence-summary-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

.evidence-summary::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 150px;
    background: linear-gradient(to top, rgb(230 224 214) 10%, transparent 100%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.evidence-summary.expanded {
    height: auto;
    overflow: visible;
}

.evidence-summary.expanded::after {
    opacity: 0;
}

.evidence-summary-toggle {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(200, 200, 200, 0.6);
    border: 1px solid rgba(150, 150, 150, 0.4);
    border-radius: 12px;
    width: 32px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.evidence-summary-toggle:hover {
    background: rgba(180, 180, 180, 0.7);
}

.evidence-summary-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.4s ease;
}

/* When expanded, rotate caret to point up (collapse) */
.evidence-summary.expanded .evidence-summary-toggle svg {
    transform: rotate(180deg);
}

.evidence-summary-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 277px;
}

.evidence-summary-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(128, 128, 128, 0.2);
    border-top-color: rgba(128, 128, 128, 0.6);
    border-radius: 50%;
    animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.evidence-summary-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    color: var(--color-text-primary);
}

.evidence-summary-section {
    margin-bottom: 12px;
}

.evidence-summary-section:last-child {
    margin-bottom: 0;
}

.evidence-summary-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.evidence-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Evidence Card (Simplified) */
.evidence-card {
    background: rgb(245 245 245);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    border: 1px solid rgba(200, 200, 200, 0.2);
    position: relative;
}

/* Card slide-in animation */
.evidence-card.slide-in {
    animation: slideInFromLeft 0.4s ease-out forwards;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cme-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.evidence-card:hover {
    box-shadow: var(--shadow-md);
    background: #fcfcfc;
}

.evidence-excerpt {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-primary);
    margin-bottom: 12px;
    font-style: italic;
    padding: 24px 16px;
    position: relative;
    max-height: 120px;
    overflow: hidden;
    cursor: pointer;
}

/* Fade out effect on bottom of excerpt */
.evidence-excerpt::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100px;
    background: linear-gradient(to top, rgb(245 245 245), transparent);
    pointer-events: none;
    transition: background 0.2s;
}

/* Hover state for excerpt gradient */
.evidence-card:hover .evidence-excerpt::after {
    background: linear-gradient(to top, #fcfcfc, transparent);
}

.evidence-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(200, 200, 200, 0.2);
}

.evidence-source-tag {
    display: inline-flex;
    align-items: center;
    padding: 0;
    background: transparent;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    overflow: hidden;
}

.evidence-source-tag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
}

.evidence-source-tag-icon svg {
    width: 14px;
    height: 14px;
}

.evidence-source-tag-text {
    padding: 6px 10px 6px 6px;
}

/* Different color variants for source tags - all grayscale */
.evidence-source-tag.tag-color-1 .evidence-source-tag-icon {
    background: rgba(100, 100, 100, 0.8);
    color: #3a3a3a;
}

.evidence-source-tag.tag-color-1 .evidence-source-tag-text {
    background: rgba(100, 100, 100, 0.2);
    color: #8a8a8a;
}

.evidence-source-tag.tag-color-2 .evidence-source-tag-icon {
    background: rgba(120, 120, 120, 0.8);
    color: #2a2a2a;
}

.evidence-source-tag.tag-color-2 .evidence-source-tag-text {
    background: rgba(120, 120, 120, 0.2);
    color: #8a8a8a;
}

.evidence-source-tag.tag-color-3 .evidence-source-tag-icon {
    background: rgba(110, 110, 110, 0.8);
    color: #3a3a3a;
}

.evidence-source-tag.tag-color-3 .evidence-source-tag-text {
    background: rgba(110, 110, 110, 0.2);
    color: #8a8a8a;
}

.evidence-source-tag.tag-color-4 .evidence-source-tag-icon {
    background: rgba(100, 100, 100, 0.8);
    color: #2a2a2a;
}

.evidence-source-tag.tag-color-4 .evidence-source-tag-text {
    background: rgba(100, 100, 100, 0.2);
    color: #8a8a8a;
}

.evidence-source-tag.tag-color-5 .evidence-source-tag-icon {
    background: rgba(120, 120, 120, 0.8);
    color: #3a3a3a;
}

.evidence-source-tag.tag-color-5 .evidence-source-tag-text {
    background: rgba(120, 120, 120, 0.2);
    color: #8a8a8a;
}

.evidence-source-tag.tag-color-6 .evidence-source-tag-icon {
    background: rgba(110, 110, 110, 0.8);
    color: #2a2a2a;
}

.evidence-source-tag.tag-color-6 .evidence-source-tag-text {
    background: rgba(110, 110, 110, 0.2);
    color: #8a8a8a;
}

.evidence-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.evidence-action-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.evidence-action-link:hover {
    color: var(--color-text-primary);
}

.evidence-full-button {
    padding: 6px 16px;
    background: var(--color-accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.evidence-full-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

/* Chat Area (Right - 60%) */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    overflow: hidden;
}

.model-header {
    padding: 12px 20px 8px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to top, transparent, rgb(255 255 255 / 34%));
    border-bottom: 1px solid rgba(200, 200, 200, 0.2);
    width: 100%;
}

.model-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.confidence-legend {
    display: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.high {
    background: #86efac;
}

.legend-dot.medium {
    background: #fde047;
}

.legend-dot.low {
    background: #e8a020;
}

.legend-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.conversation {
    padding: 30px;
    margin: 24px 0 32px 0;
    overflow-y: auto;
    flex: 1;
    max-width: 800px;
    width: 90%;
    background: #f8f8f7;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.user-message {
    background: radial-gradient(#ffffff24, #e5e5e54a);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    margin-left: auto;
    max-width: 85%;
    font-size: 15px;
    line-height: 1.6;
    border: 1px solid rgba(128, 128, 128, 0.2);
}

.ai-message {
    background: transparent;
    padding: 0;
    border: none;
    font-size: 15px;
    line-height: 1.7;
    max-width: 100%;
}

.ai-message p {
    margin-bottom: 16px;
}

.ai-message p:last-child {
    margin-bottom: 0;
}

.placeholder-message {
    text-align: center;
    color: #9ca3af;
    font-size: 15px;
    padding: 40px 20px;
    font-style: italic;
}

/* Response Actions (VERIFY button and follow-up questions) */
.response-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(200, 200, 200, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.verify-button {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.verify-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

.verify-button:active {
    transform: translateY(0);
}

.follow-up-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.follow-up-pill {
    background: rgba(200, 200, 200, 0.2);
    color: var(--color-text-primary);
    border: 1px solid rgba(200, 200, 200, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    max-width: fit-content;
    animation: fadeInUp 0.6s ease-out both;
}

.follow-up-pill:nth-child(1) {
    animation-delay: 0.2s;
}

.follow-up-pill:nth-child(2) {
    animation-delay: 0.3s;
}

.follow-up-pill:nth-child(3) {
    animation-delay: 0.4s;
}

.follow-up-pill:hover {
    background: rgba(200, 200, 200, 0.3);
    border-color: rgba(200, 200, 200, 0.5);
    transform: translateY(-1px);
}

.follow-up-pill:active {
    transform: translateY(0);
}

/* Confidence Highlights - CSS wavy underline */
/* Pending highlight (before fact-checking reveals confidence) */
.highlight-pending {
    cursor: pointer;
    position: relative;
}

/* Confidence underline classes — continuous SVG squiggle */
.confidence-underline {
    text-decoration: none;
    cursor: pointer;
    background-repeat: repeat-x;
    background-position: left bottom 1px;
    background-size: 9px 5px;
    padding-bottom: 3px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    transition: background-color 0.2s ease;
}

.confidence-underline:hover {
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 3px;
}

.confidence-underline.high {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'%3E%3Cpath d='M0 3 Q2.25 0 4.5 3 Q6.75 6 9 3' fill='none' stroke='%2322c55e' stroke-width='1.5'/%3E%3C/svg%3E");
}

.confidence-underline.medium {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'%3E%3Cpath d='M0 3 Q2.25 0 4.5 3 Q6.75 6 9 3' fill='none' stroke='%23d4c800' stroke-width='1.5'/%3E%3C/svg%3E");
}

.confidence-underline.low {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5' viewBox='0 0 9 5'%3E%3Cpath d='M0 3 Q2.25 0 4.5 3 Q6.75 6 9 3' fill='none' stroke='%23e8a020' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* Fact-checking animation */
.fact-checking {
    animation: pulse-text-opacity 1.5s ease-in-out infinite;
}

@keyframes pulse-text-opacity {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

/* Verification Notification Banner */
.verification-notification {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-top: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.verification-notification.visible {
    top: 0;
}

.verification-icon {
    font-size: 16px;
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Removed add-model-column styles (no longer needed) */

/* Removed old evidence-view and query-input-area styles (replaced with new simplified layout) */

/* Tooltip */
.tooltip {
    position: absolute;
    background: linear-gradient(153deg, #f4f6ea, transparent 70.71%), linear-gradient(313deg, #eee9ce, transparent 70.71%), linear-gradient(110deg, #eaeaea, transparent 91%);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.05);
    padding: 14px;
    max-width: 420px;
    z-index: 1000;
    display: none;
    border: 1px solid rgba(200, 200, 200, 0.3);
}

.tooltip.visible {
    display: block;
    animation: tooltipFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 24px;
    width: 16px;
    height: 16px;
    background: #f5f2e5;
    border: 1px solid var(--color-border);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

.tooltip-header {
    margin-bottom: 10px;
}

.confidence-score {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.confidence-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-fill.high {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.confidence-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.confidence-fill.low {
    background: linear-gradient(90deg, #e8a020, #f0b040);
}

.confidence-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.tooltip-reasoning {
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.tooltip-resources {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resource-card-small {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(5px);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    opacity: 0.5;
}

.resource-card-small .resource-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.resource-card-small .resource-authors {
    font-size: 11px;
    margin-bottom: 3px;
}

.resource-card-small .resource-chapter {
    font-size: 11px;
    margin-bottom: 8px;
}

.resource-quote {
    background: rgba(255, 255, 255, 0.4);
    border-left: 3px solid var(--color-text-secondary);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-text-primary);
    font-style: italic;
    margin-top: 8px;
}

.view-more {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.view-more:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    display: flex;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-book-cover {
    width: 120px;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    padding: 8px;
    overflow: hidden;
}

.modal-book-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.modal-book-info {
    flex: 1;
}

.modal-access-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    margin-left: auto;
}

.modal-access-text {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-access-logo {
    height: 28px;
    width: auto;
}

.modal-book-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.modal-book-authors {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.modal-book-publisher {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.modal-book-date {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.modal-close-button {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
    color: var(--color-text-secondary);
}

.modal-close-button:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text-primary);
}

.modal-chapter-info {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.03);
    text-align: center;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
}

.modal-body {
    padding: 24px;
    font-family: Georgia, 'Times New Roman', serif;
    line-height: 1.8;
    font-size: 15px;
    color: var(--color-text-primary);
}

.modal-excerpt-highlight {
    background: rgba(251, 191, 36, 0.25);
    padding: 16px;
    border-left: 4px solid rgba(251, 191, 36, 0.7);
    margin: 24px 0;
    border-radius: 4px;
    font-style: italic;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 25%;
    }

    .history-view {
        grid-template-columns: 1fr;
    }

    .model-column:last-child {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
}
