/* ==========================================================================
   MediVision AI Assistant v2.0 - Design System & Modern CSS Stylesheet
   ========================================================================== */

:root {
    /* Color Palette - Dark Medical Theme */
    --bg-main: #0b0f19;
    --bg-card: rgba(18, 26, 43, 0.75);
    --bg-card-hover: rgba(25, 36, 59, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.03);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(14, 165, 233, 0.3);
    
    --primary: #0ea5e9;
    --primary-glow: rgba(14, 165, 233, 0.4);
    --accent: #14b8a6;
    --accent-glow: rgba(20, 184, 166, 0.3);
    --indigo: #6366f1;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-main: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(14, 165, 233, 0.15);
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables Override */
body.light-theme {
    --bg-main: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.02);
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(14, 165, 233, 0.3);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background Effects */
.bg-glow {
    position: fixed;
    top: -20%;
    left: 20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, rgba(99, 102, 241, 0.05) 50%, transparent 70%);
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* App Wrapper */
.app-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: 24px;
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--indigo));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 0 20px var(--primary-glow);
}

.logo-pulse {
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid var(--primary);
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 0.2; }
}

.brand-info h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-v2 {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

/* Buttons */
button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--indigo));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: opacity var(--transition-fast);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-main);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-main);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
}

.btn-close {
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
}

.btn-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.form-group small {
    font-size: 11px;
    color: var(--text-muted);
}

.db-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
    font-size: 13px;
    font-weight: 500;
}

.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Main Workspace Grid */
.workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex: 1;
}

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

/* Left Column: Workbench */
.workbench-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-section {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    color: var(--primary);
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Sample Cards */
.sample-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sample-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
    transition: all var(--transition-fast);
}

.sample-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.sample-card.active {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.1);
    box-shadow: 0 0 15px var(--primary-glow);
}

.sample-card img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

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

.sample-meta span {
    font-size: 10px;
    color: var(--text-muted);
}

/* Input Grid */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .input-grid {
        grid-template-columns: 1fr;
    }
}

.input-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-main);
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.step-num {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(14, 165, 233, 0.15);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.card-title h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
}

.card-title p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Dropzone */
.dropzone {
    position: relative;
    min-height: 180px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    overflow: hidden;
}

.dropzone.dragover, .dropzone:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.05);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 16px;
}

.upload-icon {
    font-size: 28px;
    color: var(--primary);
}

.dropzone-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.dropzone-text span {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.file-limits {
    font-size: 10px;
    color: var(--text-muted);
}

.camera-trigger-wrap {
    margin-top: 6px;
    position: relative;
    z-index: 10;
}

.btn-camera-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: rgba(14, 165, 233, 0.15);
    border: 1px solid var(--primary-glow);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-camera-trigger:hover {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

/* Live Camera Viewfinder Overlay */
.webcam-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.webcam-container.hidden {
    display: none;
}

#webcamFeed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.webcam-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 25;
}

.btn-snap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
    transition: transform 0.15s ease;
}

.btn-snap:hover {
    transform: scale(1.05);
}

.btn-cancel-cam {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-full);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel-cam:hover {
    background: rgba(239, 68, 68, 0.8);
}


/* Image Preview Overlay */
.image-preview-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.image-preview-container.hidden {
    display: none;
}

.image-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 165, 233, 0) 0%, rgba(14, 165, 233, 0.25) 50%, rgba(14, 165, 233, 0) 100%);
    background-size: 100% 200%;
    animation: scanAnimation 3s infinite linear;
    pointer-events: none;
}

@keyframes scanAnimation {
    0% { background-position: 0 -100%; }
    100% { background-position: 0 100%; }
}

.btn-remove-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    font-size: 14px;
    z-index: 10;
}

/* Voice Recorder Widget */
.recorder-widget {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visualizer-box {
    position: relative;
    height: 70px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

#audioVisualizer {
    width: 100%;
    height: 100%;
    display: block;
}

.rec-timer {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 4px;
}

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

.btn-record {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-record.recording {
    animation: recordPulse 1s infinite alternate;
    background: #ef4444;
}

@keyframes recordPulse {
    from { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    to { transform: scale(1.1); box-shadow: 0 0 25px rgba(239, 68, 68, 0.9); }
}

.recorder-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.audio-playback-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-playback-preview.hidden {
    display: none;
}

.audio-playback-preview audio {
    width: 100%;
    height: 36px;
}

.btn-clear-audio {
    background: transparent;
    color: var(--text-muted);
    font-size: 16px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 8px;
}

.text-symptom-box textarea {
    width: 100%;
    height: 70px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 12px;
    resize: none;
}

.text-symptom-box textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: center;
}

.btn-launch-diagnosis {
    width: 100%;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 10px 30px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all var(--transition-smooth);
}

.btn-launch-diagnosis:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px var(--primary-glow);
}

/* Right Column: Diagnostic Results */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
}

.result-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.doctor-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar-box {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.ai-pulse {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    border: 2px solid var(--bg-main);
}

.doctor-profile h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
}

.doctor-profile p {
    font-size: 11px;
    color: var(--text-secondary);
}

.analysis-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
}

/* Loader */
.diagnosis-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding: 30px 20px;
}

.diagnosis-loader.hidden {
    display: none;
}

.dna-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(14, 165, 233, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

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

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

.progress-bar-wrap {
    width: 80%;
    height: 6px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

/* Result Body */
.result-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sub-result-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.sub-result-box.highlight-box {
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.03);
}

.sub-result-box h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.transcription-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.6;
}

.impression-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.7;
}

/* Audio Player */
.audio-synthesis-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-synth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.voice-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo);
    padding: 2px 8px;
    border-radius: 4px;
}

.audio-player-custom {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-play-pause {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-play-pause:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-waveform-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    cursor: pointer;
}

.waveform-progress {
    height: 100%;
    width: 0%;
    background: var(--primary);
}

.time-display {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Medical Disclaimer */
.medical-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 11px;
    line-height: 1.5;
}

.medical-disclaimer i {
    font-size: 14px;
    margin-top: 2px;
}

/* History Card */
.history-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.history-header h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.db-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
}

.btn-text:hover {
    color: var(--primary);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.history-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.05);
}

.history-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
}

.history-time {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.history-snippet {
    font-size: 11px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    align-items: center;
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 12px;
}

.empty-state i {
    font-size: 24px;
    margin-bottom: 6px;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}
