/* Signal Stack - Styles */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&display=swap');

:root {
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --accent-color: #d4af37;
    --success-color: #38a169;
    --error-color: #e53e3e;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Merriweather', Georgia, serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%),
                linear-gradient(to bottom, #f7fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.container.with-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.container.with-sidebar > header {
    flex: 1 1 100%;
    order: -2;
}

.container.with-sidebar > .sidebar {
    order: -1;
}

.container.with-sidebar > main {
    flex: 1;
    min-width: 0;
    order: 0;
}

.container.with-sidebar > footer {
    flex: 1 1 100%;
    order: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Form */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.helper-text {
    display: block;
    margin-top: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.warning-text {
    margin-top: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 24px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline {
    padding: 12px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    margin: 20px auto 0;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Progress */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    animation: shimmer 2s infinite;
}

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

.progress-text {
    text-align: center;
    color: var(--text-primary);
    font-weight: 600;
}

/* Stages */
.stages {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stages h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
}

.stage-list {
    list-style-position: inside;
    color: var(--text-secondary);
}

.stage-list li {
    padding: 8px 0;
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 30px auto;
}

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

/* Results */
.success-banner {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--success-color), #2f855a);
    color: white;
    border-radius: 8px;
    margin-bottom: 30px;
}

.success-banner h2 {
    color: white;
    margin-bottom: 8px;
}

.success-banner p {
    font-size: 1.1rem;
}

.artifacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.artifact-card {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.artifact-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.artifact-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.artifact-card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.artifact-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    flex: 1;
}

.artifact-card .button-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: auto;
}

.artifact-card .button-group .btn-secondary {
    flex: 1;
    font-size: 0.9rem;
    padding: 10px 16px;
}

/* Error */
.error-card {
    border-left: 4px solid var(--error-color);
}

.error-message {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: var(--error-color);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.9;
}

footer a {
    color: #721c24;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
    }

    .artifacts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================================
   NEW UI COMPONENTS - UI/UX OVERHAUL
   ============================================================================ */

/* Notes Toggle */
.notes-toggle {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    padding: 14px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.notes-toggle:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.notes-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.notes-toggle::before {
    content: "📝";
    font-size: 1.1rem;
}

#notesToggleIcon {
    transition: transform 0.3s;
    display: inline-block;
}

#notesToggleIcon.expanded {
    transform: rotate(90deg);
}

.notes-container {
    margin-top: 12px;
    animation: slideDown 0.3s ease-out;
}

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

/* Stage Pills Preview */
.stages-preview {
    margin: 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.stages-preview h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stage-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stage-pill {
    background: white;
    color: var(--primary-color);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Progress Header */
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.progress-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
}

.stage-indicator {
    color: var(--primary-color);
    font-weight: 600;
}

.time-estimate {
    color: var(--text-secondary);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

#progressPercent {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Analysis Content Layout */
.analysis-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 1024px) {
    .analysis-content {
        grid-template-columns: 1fr;
    }
}

/* Stages Panel */
.stages-panel {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.stages-panel h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.stage-list-dynamic {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stage-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    background: white;
    border: 2px solid transparent;
}

.stage-item.pending {
    opacity: 0.6;
}

.stage-item.in-progress {
    background: #fff3cd;
    border-color: var(--accent-color);
    animation: pulse 2s infinite;
}

.stage-item.completed {
    background: #d4edda;
    border-color: var(--success-color);
    opacity: 1;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.stage-status {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stage-item.pending .stage-status::before {
    content: "⏳";
}

.stage-item.in-progress .stage-status::before {
    content: "⚡";
}

.stage-item.completed .stage-status::before {
    content: "✅";
}

.stage-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Live Insights Panel */
.live-insights-panel {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    max-height: 500px;
    overflow-y: auto;
}

.live-insights-panel h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-size: 1.1rem;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding-bottom: 8px;
}

.insights-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.insight-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    animation: fadeInLeft 0.5s ease-out;
}

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

.insight-item.highlight {
    background: #fff3cd;
    border-left-color: var(--error-color);
    font-weight: 500;
}

.info-text.reassuring {
    text-align: center;
    margin-top: 24px;
    color: var(--success-color);
    font-weight: 500;
}

/* Summary Snapshot */
.summary-snapshot {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.summary-snapshot h3 {
    color: var(--primary-color);
    margin-bottom: 16px;
    font-weight: 700;
}

.snapshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.snapshot-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.snapshot-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.snapshot-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.snapshot-value {
    display: block;
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 700;
}

.snapshot-value.high {
    color: var(--success-color);
}

.snapshot-value.medium {
    color: #d97706;
}

.snapshot-value.low {
    color: var(--error-color);
}

/* Improved Button Focus States */
button:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-outline:focus {
    outline: 3px solid rgba(26, 54, 93, 0.3);
    outline-offset: 2px;
}

/* Better Typography */
h1 {
    font-weight: 800;
}

h2 {
    font-weight: 700;
}

h3 {
    font-weight: 600;
}

body {
    line-height: 1.7;
}

.info-text {
    line-height: 1.7;
}

/* Improved Empty State for History */
.no-history {
    text-align: center;
    padding: 40px 20px;
}

.no-history::before {
    content: "📋";
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
}

/* ============================================================================
   HISTORY SIDEBAR STYLES
   ============================================================================ */

.sidebar {
    position: sticky;
    top: 20px;
    width: 280px;
    min-width: 280px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 50px;
    min-width: 50px;
}

.sidebar.collapsed .history-list,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .sidebar-header h3 {
    display: none;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #1a365d 0%, #2d5a8e 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-search {
    padding: 12px;
    background: white;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.sidebar-search input:focus {
    outline: none;
    border-color: #1a365d;
}

.sidebar-search input::placeholder {
    color: #a0aec0;
}

.history-list {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 12px;
}

.history-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    display: flex;
    gap: 10px;
}

.history-item:hover {
    background: #e9ecef;
    border-color: #d4af37;
    transform: translateX(4px);
}

.history-item.active {
    background: #fff3cd;
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
}

.history-item.in-progress-analysis {
    background: linear-gradient(90deg, #fff3cd 0%, #fffaed 100%);
    border-color: #ffc107;
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    animation: pulse-border 2s infinite;
}

.history-item.in-progress-analysis:hover {
    animation: pulse-border 1s infinite;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(255, 193, 7, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
    }
}

.history-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a365d 0%, #2d5a8e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.history-item-content {
    flex: 1;
    min-width: 0;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
}

.history-item-header strong {
    color: #1a365d;
    font-size: 14px;
    flex: 1;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.history-status-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.history-status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.history-status-badge.in-progress {
    background: #fff3cd;
    color: #856404;
}

.history-status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.history-date {
    font-size: 11px;
    color: #6c757d;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-summary {
    font-size: 12px;
    color: #495057;
    margin: 0 0 8px 0;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.artifact-count {
    font-size: 11px;
    color: #6c757d;
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
}

.no-history,
.loading {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-size: 14px;
}

.no-history::before {
    content: "🔍";
    display: block;
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-history-cta {
    margin-top: 12px;
    font-size: 13px;
    color: #1a365d;
    font-weight: 600;
}

.past-analysis-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.analysis-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.analysis-header-left {
    flex: 1;
}

.analysis-header-right {
    flex-shrink: 0;
}

.past-analysis-header h3 {
    margin: 0 0 8px 0;
    color: #1a365d;
    font-size: 1.5rem;
}

.past-analysis-header p {
    margin: 4px 0;
    color: #495057;
}

.past-analysis-header .timestamp {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
    margin-top: 8px;
}

.past-analysis-header a {
    color: #1a365d;
    text-decoration: none;
    font-weight: 500;
}

.past-analysis-header a:hover {
    text-decoration: underline;
}

.btn-new-analysis {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.btn-new-analysis:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-new-analysis:focus {
    outline: 3px solid rgba(26, 54, 93, 0.3);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .analysis-header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-new-analysis {
        width: 100%;
    }
}

.insights-content {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.insights-content p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #495057;
}

.insights-content p:last-child {
    margin-bottom: 0;
}

.insights-content strong,
.insights-content b {
    color: #1a365d;
    font-weight: 600;
    display: block;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 1.05em;
}

.insights-content h4 {
    color: #1a365d;
    font-weight: 600;
    margin: 20px 0 12px 0;
    font-size: 1.1em;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 6px;
}

#analysisInsights {
    margin-bottom: 30px;
}

#analysisInsights > h4 {
    color: #1a365d;
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 1.4rem;
}

.insights-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 28px;
    border-radius: 12px;
    border-left: 4px solid #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.insights-summary h3 {
    color: #1a365d;
    font-weight: 700;
    margin: 0 0 16px 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insights-summary p {
    color: #495057;
    line-height: 1.8;
    margin: 0;
    font-size: 1rem;
    text-align: justify;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 10px;
    }

    .sidebar {
        position: fixed;
        left: 0; /* Show by default */
        top: 0;
        bottom: 0;
        z-index: 1000;
        max-height: 100vh;
        width: 280px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    }

    .sidebar.collapsed {
        left: -300px; /* Hide when collapsed */
        box-shadow: none;
    }

    .container.with-sidebar > main {
        flex: 1 1 100%;
    }

    .toggle-btn {
        position: fixed;
        left: 10px;
        top: 10px;
        z-index: 1001;
    }
}

/* Scrollbar styling for history list */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #b8941f;
}
