* {
    font-family: 'Inter', sans-serif;
}

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

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

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

/* Animations */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

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

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

@keyframes wave {
    0%, 100% {
        height: 4px;
    }
    50% {
        height: 20px;
    }
}

.animate-fade-in {
    animation: fade-in 0.3s ease-out forwards;
}

.animate-slide-in {
    animation: slide-in-right 0.3s ease-out forwards;
}

.recording-pulse {
    position: relative;
}

.recording-pulse::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.4);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Waveform bars */
.waveform-bar {
    width: 3px;
    background: #3b82f6;
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

.recording .waveform-bar {
    background: #ef4444;
    animation-duration: 0.5s;
}

/* Enhanced Transcript Styles */
.transcript-entry {
    animation: fade-in 0.2s ease-out;
    padding: 8px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    transition: all 0.15s;
    position: relative;
}

.transcript-entry:hover {
    background: #f8fafc;
}

/* Speaker-specific styling */
.transcript-entry.speaker-doctor {
    background: #f8fafc;
    border-left: 3px solid #3b82f6;
}

.transcript-entry.speaker-patient {
    background: white;
    border-left: 3px solid #10b981;
}

.transcript-entry.speaker-system {
    background: #f1f5f9;
    border-left: 3px solid #94a3b8;
    opacity: 0.9;
}

.transcript-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.transcript-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: 700;
    flex-shrink: 0;
}

.speaker-doctor .transcript-avatar {
    background: #dbeafe;
    color: #1d4ed8;
}

.speaker-patient .transcript-avatar {
    background: #d1fae5;
    color: #059669;
}

.speaker-system .transcript-avatar {
    background: #e2e8f0;
    color: #64748b;
}

.transcript-speaker {
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.speaker-doctor .transcript-speaker {
    color: #1d4ed8;
}

.speaker-patient .transcript-speaker {
    color: #059669;
}

.speaker-system .transcript-speaker {
    color: #64748b;
}

.transcript-text {
    color: #334155;
    line-height: 1.5;
    font-size: 13px;
    margin-left: 24px;
}

.transcript-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 24px;
    margin-top: 2px;
}

.transcript-time {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
}

.transcript-confidence {
    font-size: 10px;
    color: #10b981;
    background: #d1fae5;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 500;
}

/* AI Insights Panel Enhancements */
.ai-insight-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.ai-insight-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.ai-insight-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.ai-insight-icon {
    width: 14px;
    height: 14px;
    color: #3b82f6;
}

.ai-insight-title {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
}

.ai-insight-text {
    font-size: 11px;
    color: #475569;
    line-height: 1.4;
}

/* Waveform Animation - Enhanced 2026 */
@keyframes waveform-active {
    0%, 100% { transform: scaleY(0.2); opacity: 0.3; }
    50% { transform: scaleY(1); opacity: 1; }
}

@keyframes waveform-recording {
    0%, 100% { height: 4px; opacity: 0.4; }
    50% { height: 24px; opacity: 1; }
}

#waveform-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 32px;
}

#waveform-display > div {
    width: 3px;
    background: #cbd5e1;
    border-radius: 2px;
    transition: all 0.15s ease;
}

#waveform-display.recording > div {
    background: #ef4444;
    animation: waveform-recording 0.5s ease-in-out infinite;
    opacity: 0.8;
}

#waveform-display.recording > div:nth-child(odd) {
    animation-delay: 0.1s;
    animation-duration: 0.6s;
}

#waveform-display.recording > div:nth-child(3n) {
    animation-delay: 0.2s;
    animation-duration: 0.4s;
}

#waveform-display.recording > div:nth-child(5n) {
    animation-delay: 0.3s;
    animation-duration: 0.7s;
}

#waveform-display.paused > div {
    animation: none;
    background: #f59e0b;
    opacity: 0.5;
    height: 4px;
}

/* Recording Pulse Ring */
@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

.recording-pulse::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.3);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    z-index: -1;
}

/* Empty state refinement */
#empty-transcript-msg {
    animation: fade-in 0.3s ease-out;
}

/* Enterprise Stepper Styles - 2026 Premium */
.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 14px;
    border-radius: 9999px;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.step-item:hover:not(.active):not(.completed) {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
}

.step-connector {
    width: 20px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 4px;
    transition: all 0.3s;
    border-radius: 1px;
    flex-shrink: 0;
    position: relative;
}

.step-connector.active {
    background: linear-gradient(to right, #10b981, #3b82f6);
}

.step-connector.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: #3b82f6;
    border-radius: 50%;
}

.step-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.3s;
    border: 2px solid #cbd5e1;
    background: white;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Active Step - Premium Pill Style */
.step-item.active {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2), 0 2px 4px -1px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.step-item.active .step-circle {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 700;
}

.step-item.completed {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.step-item.completed .step-circle {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: all 0.2s;
    letter-spacing: -0.2px;
}

.step-item.active .step-label {
    color: white;
    font-weight: 600;
}

.step-item.completed .step-label {
    color: #059669;
    font-weight: 600;
}

/* Completed check icon refinement */
.step-item.completed .step-circle svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

/* Step content transitions */
.step-content {
    animation: fade-in 0.4s ease-out;
}

.step-content.hidden {
    display: none;
    animation: none;
}

/* Toast styles */
.toast {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slide-in-right 0.3s ease-out;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #10b981;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast.warning {
    border-left-color: #f59e0b;
}

/* Card hover effects */
.patient-card {
    transition: all 0.2s;
    cursor: pointer;
}

.patient-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.patient-card.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Input focus states */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* File upload area */
#upload-area.dragover {
    border-color: #3b82f6;
    background: #eff6ff;
}

/* AI Processing shimmer */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f7f8 4%, #edeef1 25%, #f6f7f8 36%);
    background-size: 1000px 100%;
}

/* AI Copilot Sidebar Styles */
#ai-copilot-sidebar {
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

/* Enhanced Progress Circle */
#completion-circle {
    transition: stroke-dashoffset 0.5s ease;
}

/* Live Insights Panel Animation */
@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slide-in-right 0.3s ease-out forwards;
}

/* Command Palette Styles */
#command-palette {
    animation: fade-in 0.2s ease-out;
}

#command-list button:hover {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
}

/* Smart Suggestion Chips */
#suggested-patients-chips::-webkit-scrollbar {
    height: 4px;
}

#suggested-patients-chips::-webkit-scrollbar-track {
    background: transparent;
}

#suggested-patients-chips::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Enhanced Transcript Timeline */
.transcript-entry {
    position: relative;
    padding-left: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.transcript-entry:hover {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
    border-radius: 0 4px 4px 0;
}

/* AI Confidence Badges */
.ai-confidence-high {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.ai-confidence-medium {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.ai-confidence-low {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Structured Intake Helper */
#structured-intake button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Vital Evaluation Badges */
.vital-badge-elevated {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.vital-badge-high {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.vital-badge-normal {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* Timeline Styles */
#encounter-timeline::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

/* Timeline dot animations */
#encounter-timeline > div::before {
    transition: transform 0.2s, box-shadow 0.2s;
}

#encounter-timeline > div:hover::before {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* MMJ Intelligence Panel */
#mmj-intelligence {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
}

/* Edit Action Dropdowns */
.group:hover .opacity-0 {
    opacity: 1;
}

/* Recording State Indicator */
.recording-active {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3);
    animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Quality Score Animation */
@keyframes score-count-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#quality-score {
    animation: score-count-up 0.5s ease-out;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 1024px) {
    #ai-copilot-sidebar {
        width: 100%;
        right: -100%;
    }
    
    #ai-copilot-sidebar.translate-x-full {
        transform: translateX(-100%);
    }
    
    #main-content[style*="margin-right: 320px"] {
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    .step-label {
        display: none;
    }
    
    .step-connector {
        width: 12px;
    }
    
    #main-content {
        padding: 1rem;
    }
    
    /* Mobile command palette */
    #command-palette > div {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    /* Stack quality bars on mobile */
    #quality-score + div {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles for Export */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    #main-content {
        margin: 0;
        padding: 0;
    }
}

/* Focus Styles for Accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading Shimmer for AI Processing */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.ai-processing-shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f7f8 4%, #edeef1 25%, #f6f7f8 36%);
    background-size: 1000px 100%;
}

/* Toast Notification Enhancements */
.toast {
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Custom Selection Color */
::selection {
    background: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}