/* ===== MEDICALNOTES UNIFIED DESIGN SYSTEM ===== */

/* World-Class Healthcare AI Platform Design System */

/* This file ensures complete consistency across all MedicalNotes pages */

:root {
    /* ===== BRAND COLOR SYSTEM ===== */

    /* Primary Healthcare Colors - Trust & Clarity */
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;
    --primary-300: #93C5FD;
    --primary-400: #60A5FA;
    --primary-500: #3B82F6;
    --primary-600: #2563EB;
    --primary-700: #1D4ED8;
    --primary-800: #1E40AF;
    --primary-900: #1E3A8A;
    
    /* Secondary Innovation Colors - Creativity & Technology */
    --secondary-50: #F5F3FF;
    --secondary-100: #EDE9FE;
    --secondary-200: #DDD6FE;
    --secondary-300: #C4B5FD;
    --secondary-400: #A78BFA;
    --secondary-500: #8B5CF6;
    --secondary-600: #7C3AED;
    --secondary-700: #6D28D9;
    --secondary-800: #5B21B6;
    --secondary-900: #4C1D95;
    
    /* Accent Success Colors - Growth & Health */
    --accent-50: #ECFDF5;
    --accent-100: #D1FAE5;
    --accent-200: #A7F3D0;
    --accent-300: #6EE7B7;
    --accent-400: #34D399;
    --accent-500: #10B981;
    --accent-600: #059669;
    --accent-700: #047857;
    --accent-800: #065F46;
    --accent-900: #064E3B;
    
    /* ===== NEUTRAL SYSTEM ===== */

    /* Professional Healthcare Neutrals */
    --neutral-50: #F9FAFB;
    --neutral-100: #F3F4F6;
    --neutral-200: #E5E7EB;
    --neutral-300: #D1D5DB;
    --neutral-400: #9CA3AF;
    --neutral-500: #6B7280;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;
    
    /* ===== SEMANTIC COLORS ===== */
    --success-50: #ECFDF5;
    --success-500: #10B981;
    --success-600: #059669;
    --success-700: #047857;
    --warning-50: #FFFBEB;
    --warning-500: #F59E0B;
    --warning-600: #D97706;
    --warning-700: #B45309;
    --error-50: #FEF2F2;
    --error-500: #EF4444;
    --error-600: #DC2626;
    --error-700: #B91C1C;
    --info-50: #EFF6FF;
    --info-500: #3B82F6;
    --info-600: #2563EB;
    --info-700: #1D4ED8;
    
    /* ===== SHADOW SYSTEM ===== */

    /* Professional Depth & Elevation */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 5%);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 10%), 0 1px 2px 0 rgb(0 0 0 / 6%);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 10%), 0 2px 4px -1px rgb(0 0 0 / 6%);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 10%), 0 4px 6px -2px rgb(0 0 0 / 5%);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 10px 10px -5px rgb(0 0 0 / 4%);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 25%);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 6%);
    --shadow-blue: 0 4px 14px 0 rgb(59 130 246 / 39%);
    --shadow-purple: 0 4px 14px 0 rgb(124 58 237 / 39%);
    
    /* ===== TRANSITION SYSTEM ===== */

    /* Smooth, Professional Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* ===== BORDER RADIUS SYSTEM ===== */

    /* Consistent Corner Rounding */
    --radius-none: 0;
    --radius-sm: 0.125rem;    /* 2px */
    --radius-md: 0.375rem;    /* 6px */
    --radius-lg: 0.5rem;      /* 8px */
    --radius-xl: 0.75rem;     /* 12px */
    --radius-2xl: 1rem;       /* 16px */
    --radius-3xl: 1.5rem;     /* 24px */
    --radius-full: 9999px;    /* Full round */
    
    /* ===== SPACING SYSTEM ===== */

    /* Consistent Layout Spacing - 8px Baseline */
    --space-0: 0;
    --space-1: 0.25rem;       /* 4px */
    --space-2: 0.5rem;        /* 8px */
    --space-3: 0.75rem;       /* 12px */
    --space-4: 1rem;          /* 16px */
    --space-5: 1.25rem;       /* 20px */
    --space-6: 1.5rem;        /* 24px */
    --space-8: 2rem;          /* 32px */
    --space-10: 2.5rem;       /* 40px */
    --space-12: 3rem;         /* 48px */
    --space-16: 4rem;         /* 64px */
    --space-20: 5rem;         /* 80px */
    --space-24: 6rem;         /* 96px */
    --space-32: 8rem;         /* 128px */
    
    /* ===== TYPOGRAPHY SCALE ===== */

    /* Professional Font Sizes - WCAG AA Compliant */
    --text-xs: 0.75rem;       /* 12px */
    --text-sm: 0.875rem;      /* 14px */
    --text-base: 1rem;        /* 16px */
    --text-lg: 1.125rem;      /* 18px */
    --text-xl: 1.25rem;       /* 20px */
    --text-2xl: 1.5rem;       /* 24px */
    --text-3xl: 1.875rem;     /* 30px */
    --text-4xl: 2.25rem;      /* 36px */
    --text-5xl: 3rem;         /* 48px */
    --text-6xl: 3.75rem;      /* 60px */
    
    /* ===== Z-INDEX SYSTEM ===== */

    /* Proper Layering */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ===== TYPOGRAPHY SYSTEM ===== */

/* Inter and Roboto are loaded via <link rel="stylesheet"> in each page's <head>. */

/* A misplaced @import was previously here — browsers silently ignored it (must precede all rules). */

/* Base Typography */
body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--neutral-900);
    background-color: var(--neutral-50);
}

/* Heading Hierarchy */
h1, .h1 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-4xl);
    font-weight: 700;
    line-height: 1.2;
    color: var(--neutral-900);
    letter-spacing: -0.025em;
    margin-bottom: var(--space-6);
}

h2, .h2 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-3xl);
    font-weight: 600;
    line-height: 1.3;
    color: var(--neutral-900);
    letter-spacing: -0.025em;
    margin-bottom: var(--space-5);
}

h3, .h3 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-2xl);
    font-weight: 600;
    line-height: 1.4;
    color: var(--neutral-900);
    margin-bottom: var(--space-4);
}

h4, .h4 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.4;
    color: var(--neutral-900);
    margin-bottom: var(--space-3);
}

h5, .h5 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-lg);
    font-weight: 500;
    line-height: 1.5;
    color: var(--neutral-900);
    margin-bottom: var(--space-2);
}

h6, .h6 {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1.5;
    color: var(--neutral-900);
    margin-bottom: var(--space-2);
}

/* Body Text */
p {
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--neutral-700);
    margin-bottom: var(--space-4);
}

.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

/* ===== BUTTON SYSTEM ===== */

/* Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: Inter, sans-serif;
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border-color: var(--primary-600);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-500), var(--secondary-600));
    color: white;
    border-color: var(--secondary-600);
    box-shadow: var(--shadow-secondary);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--secondary-600), var(--secondary-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
    border-color: var(--accent-600);
    box-shadow: var(--shadow-accent);
}

.btn-accent:hover {
    background: linear-gradient(135deg, var(--accent-600), var(--accent-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-ghost {
    background: transparent;
    color: var(--neutral-700);
    border-color: var(--neutral-300);
}

.btn-ghost:hover {
    background: var(--neutral-100);
    border-color: var(--neutral-400);
    color: var(--neutral-900);
}

.btn-outline {
    background: transparent;
    color: var(--primary-600);
    border-color: var(--primary-300);
}

.btn-outline:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-600);
    border-color: var(--primary-300);
}

.btn-outline-primary:hover {
    background: var(--primary-50);
    border-color: var(--primary-500);
    color: var(--primary-700);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-500), var(--error-600));
    color: white;
    border-color: var(--error-600);
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--error-600), var(--error-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
    border-color: var(--success-600);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-600), var(--success-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
    color: white;
    border-color: var(--warning-600);
    box-shadow: var(--shadow-md);
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--warning-600), var(--warning-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-xl);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--text-lg);
    border-radius: var(--radius-xl);
}

/* Button States */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.btn:active {
    transform: translateY(0);
}

/* ===== FORM COMPONENTS ===== */

/* Form Groups */
.form-group {
    margin-bottom: var(--space-6);
}

/* Form Labels */
.form-label {
    display: block;
    font-family: Inter, sans-serif;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--neutral-700);
    margin-bottom: var(--space-2);
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: Inter, sans-serif;
    font-size: var(--text-base);
    line-height: 1.5;
    color: var(--neutral-900);
    background: white;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 10%);
}

.form-input:disabled {
    background: var(--neutral-100);
    color: var(--neutral-500);
    cursor: not-allowed;
}

.form-input.error {
    border-color: var(--error-500);
    box-shadow: 0 0 0 3px rgb(239 68 68 / 10%);
}

/* Form Error Messages */
.form-error {
    color: var(--error-600);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ===== CARD SYSTEM ===== */

/* Base Card */
.card {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Card Header */
.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
}

.card-title {
    font-family: Inter, sans-serif;
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--neutral-900);
    margin: 0;
}

/* Card Body */
.card-body {
    padding: var(--space-6);
}

/* Card Footer */
.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--neutral-200);
    background: var(--neutral-50);
}

/* Data Cards */
.data-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
    text-align: center;
}

.data-card-value {
    font-family: Inter, sans-serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--neutral-900);
    line-height: 1.2;
    margin-bottom: var(--space-2);
}

.data-card-label {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ===== NAVIGATION SYSTEM ===== */

/* Navbar */
.navbar {
    background: rgb(255 255 255 / 95%);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--neutral-200);
    padding: var(--space-4) 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: all var(--transition-normal);
}

.navbar.scrolled {
    background: rgb(255 255 255 / 98%);
    box-shadow: var(--shadow-sm);
}

.navbar-container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    color: var(--neutral-900);
    font-weight: 700;
    font-size: var(--text-xl);
}

.logo-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-lg);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--space-8);
}

.nav-link {
    text-decoration: none;
    color: var(--neutral-600);
    font-weight: 500;
    transition: color var(--transition-normal);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-600);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-500);
    border-radius: var(--radius-full);
}

/* Sidebar */
.sidebar {
    background: white;
    border-right: 1px solid var(--neutral-200);
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: var(--z-fixed);
    transition: all var(--transition-normal);
    overflow-y: auto;
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-50);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--neutral-900);
}

.sidebar-nav {
    padding: var(--space-4);
}

.nav-item {
    margin-bottom: var(--space-2);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    text-decoration: none;
    color: var(--neutral-600);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-50);
    color: var(--primary-700);
}

.nav-link .material-icons-round {
    font-size: var(--text-lg);
}

/* ===== LAYOUT SYSTEM ===== */

/* Container */
.container {
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* Grid System */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Spacing Utilities */
.m-0 { margin: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

.p-0 { padding: 0; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* ===== NOTIFICATION SYSTEM ===== */
.notification {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
    border: 1px solid;
    margin-bottom: var(--space-6);
}

.notification-success {
    background: var(--success-50);
    color: var(--success-700);
    border-color: var(--success-200);
}

.notification-error {
    background: var(--error-50);
    color: var(--error-700);
    border-color: var(--error-200);
}

.notification-warning {
    background: var(--warning-50);
    color: var(--warning-700);
    border-color: var(--warning-200);
}

.notification-info {
    background: var(--info-50);
    color: var(--info-700);
    border-color: var(--info-200);
}

.notification .material-icons-round {
    font-size: 1.25rem;
}

/* ===== ANIMATION SYSTEM ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Animation Classes */
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideInUp 0.4s ease-out; }
.animate-slide-left { animation: slideInLeft 0.4s ease-out; }
.animate-slide-right { animation: slideInRight 0.4s ease-out; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .navbar-container {
        padding: 0 var(--space-4);
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    h1, .h1 { font-size: var(--text-3xl); }
    h2, .h2 { font-size: var(--text-2xl); }
    h3, .h3 { font-size: var(--text-xl); }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .card-body,
    .card-header,
    .card-footer {
        padding: var(--space-4);
    }
}

/* ===== ACCESSIBILITY ===== */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-primary: var(--neutral-900);
        --text-tertiary: var(--neutral-700);
        --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 30%);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Indicators */
.focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-primary { color: var(--primary-600); }
.text-secondary { color: var(--secondary-600); }
.text-accent { color: var(--accent-600); }
.text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); }
.text-error { color: var(--error-600); }

.bg-primary { background-color: var(--primary-50); }
.bg-secondary { background-color: var(--secondary-50); }
.bg-accent { background-color: var(--accent-50); }
.bg-white { background-color: white; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid var(--neutral-300);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Premium Spinner */
.premium-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.spinner-ring {
    width: 20px;
    height: 20px;
    border: 2px solid var(--neutral-300);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
}

.spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
}

/* ===== WORKFLOW PROGRESS TRACKER ===== */
.workflow-progress {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
}

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

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    z-index: 2;
    transition: all var(--transition-normal);
}

.step-circle {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--neutral-100);
    border: 3px solid var(--neutral-300);
    transition: all var(--transition-normal);
}

.progress-step.active .step-circle {
    background: var(--primary-500);
    border-color: var(--primary-500);
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgb(59 130 246 / 10%);
}

.progress-step.completed .step-circle {
    background: var(--accent-500);
    border-color: var(--accent-500);
}

.step-circle .material-icons-round {
    font-size: 24px;
    color: var(--neutral-500);
    transition: all var(--transition-normal);
}

.progress-step.active .step-circle .material-icons-round,
.progress-step.completed .step-circle .material-icons-round {
    color: white;
}

.step-number {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--neutral-600);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 600;
    border: 2px solid white;
    transition: all var(--transition-normal);
}

.progress-step.active .step-number {
    background: var(--primary-600);
}

.progress-step.completed .step-number {
    background: var(--accent-600);
}

.step-label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--neutral-600);
    text-align: center;
    transition: all var(--transition-normal);
}

.progress-step.active .step-label {
    color: var(--primary-600);
    font-weight: 600;
}

.progress-step.completed .step-label {
    color: var(--accent-600);
    font-weight: 600;
}

.progress-connector {
    flex: 1;
    height: 3px;
    background: var(--neutral-200);
    margin: 0 var(--space-4);
    position: relative;
    transition: all var(--transition-normal);
}

.progress-connector.completed {
    background: var(--accent-500);
}

.progress-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary-500);
    transition: width var(--transition-slow);
}

.progress-connector.completed::after {
    width: 100%;
    background: var(--accent-500);
}

.progress-description {
    text-align: center;
    font-size: var(--text-base);
    color: var(--neutral-600);
    font-weight: 500;
    padding: var(--space-3);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
}

/* Mobile responsiveness for progress tracker */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .progress-connector {
        width: 3px;
        height: 40px;
        margin: 0;
        transform: rotate(90deg);
    }
    
    .step-circle {
        width: 56px;
        height: 56px;
    }
    
    .step-circle .material-icons-round {
        font-size: 20px;
    }
}

/* ===== MATERIAL DESIGN RESULT CARDS ===== */
.result-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.result-card .card-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.result-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-card .card-icon.primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
}

.result-card .card-icon.secondary {
    background: linear-gradient(135deg, var(--secondary-500), var(--secondary-600));
    color: white;
}

.result-card .card-icon.accent {
    background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
    color: white;
}

.result-card .card-icon.success {
    background: linear-gradient(135deg, var(--success-500), var(--success-600));
    color: white;
}

.result-card .card-icon .material-icons-round {
    font-size: 24px;
}

.result-card .card-title-section {
    flex: 1;
}

.result-card .card-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--neutral-900);
    margin: 0 0 var(--space-1) 0;
}

.result-card .card-subtitle {
    font-size: var(--text-sm);
    color: var(--neutral-600);
    margin: 0;
}

.result-card .card-content {
    padding: var(--space-6);
    position: relative;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
    margin: var(--space-6) 0;
}

/* Status Card */
.status-card {
    grid-column: 1 / -1;
}

.card-alert {
    margin: var(--space-4) var(--space-6) 0;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.card-alert.warning {
    background: var(--warning-50);
    border: 1px solid var(--warning-200);
}

.card-alert .alert-icon {
    color: var(--warning-600);
    flex-shrink: 0;
}

.card-alert .alert-content strong {
    color: var(--warning-700);
    display: block;
    margin-bottom: var(--space-1);
}

.card-alert .alert-content p {
    color: var(--warning-600);
    margin: 0;
    font-size: var(--text-sm);
}

/* Text Preview */
.text-preview {
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    font-family: 'Roboto Mono', monospace;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--neutral-700);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 120px;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.result-card.expanded .text-preview {
    max-height: 400px;
    overflow-y: auto;
}

.expand-btn {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: white;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.expand-btn:hover {
    background: var(--neutral-50);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.expand-btn .material-icons-round {
    font-size: 18px;
    color: var(--neutral-600);
}

/* Analysis Summary */
.analysis-summary {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.analysis-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
}

.analysis-label {
    font-weight: 500;
    color: var(--neutral-600);
    min-width: 120px;
    font-size: var(--text-sm);
}

.analysis-value {
    flex: 1;
    color: var(--neutral-900);
    font-weight: 500;
}

.analysis-value.severity-high {
    color: var(--error-600);
    font-weight: 600;
}

.analysis-value.severity-medium {
    color: var(--warning-600);
    font-weight: 600;
}

.analysis-value.severity-low {
    color: var(--accent-600);
    font-weight: 600;
}

.analysis-note {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-3);
    background: var(--info-50);
    border: 1px solid var(--info-200);
    border-radius: var(--radius-lg);
    color: var(--info-700);
    font-size: var(--text-sm);
}

.analysis-note .material-icons-round {
    font-size: 18px;
    color: var(--info-600);
}

/* Compliance Badges */
.compliance-badges {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.compliance-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
    background: var(--accent-50);
    color: var(--accent-700);
    border: 1px solid var(--accent-200);
}

.compliance-badge.fhir {
    background: var(--primary-50);
    color: var(--primary-700);
    border-color: var(--primary-200);
}

.compliance-badge.hipaa {
    background: var(--secondary-50);
    color: var(--secondary-700);
    border-color: var(--secondary-200);
}

.compliance-badge .material-icons-round {
    font-size: 16px;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    padding: var(--space-6);
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
    flex-wrap: wrap;
}

/* Mobile responsiveness for result cards */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .result-card .card-header {
        padding: var(--space-4);
    }
    
    .result-card .card-content {
        padding: var(--space-4);
    }
    
    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}

/* ===== LOADING SKELETONS ===== */
.skeleton {
    background: linear-gradient(90deg, var(--neutral-200) 25%, var(--neutral-100) 50%, var(--neutral-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6);
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.skeleton-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
}

.skeleton-title-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.skeleton-title {
    height: 20px;
    width: 60%;
}

.skeleton-subtitle {
    height: 16px;
    width: 40%;
}

.skeleton-content {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.skeleton-text {
    height: 16px;
}

.skeleton-text.short { width: 70%; }
.skeleton-text.medium { width: 85%; }
.skeleton-text.long { width: 95%; }

.skeleton-progress {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-200);
}

.skeleton-progress-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.skeleton-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

.skeleton-step-circle {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
}

.skeleton-step-label {
    height: 16px;
    width: 60px;
}

.skeleton-progress-description {
    height: 20px;
    width: 80%;
    margin: 0 auto;
}

/* Upload skeleton */
.skeleton-upload {
    border: 2px dashed var(--neutral-300);
    border-radius: var(--radius-xl);
    padding: var(--space-16);
    text-align: center;
    background: var(--neutral-50);
}

.skeleton-upload-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-4);
}

.skeleton-upload-text {
    height: 20px;
    width: 60%;
    margin: 0 auto var(--space-2);
}

.skeleton-upload-subtext {
    height: 16px;
    width: 40%;
    margin: 0 auto;
}

/* ===== ENHANCED MICRO-INTERACTIONS ===== */

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 50%);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Enhanced Button Interactions */
.btn {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 30%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease-out, height 0.6s ease-out;
    pointer-events: none;
}

.btn:active::after {
    width: 300px;
    height: 300px;
    transition: width 0.1s ease-out, height 0.1s ease-out;
}

/* Enhanced Card Hover Effects */
.card,
.result-card,
.feature-card {
    transition: all var(--transition-normal), box-shadow var(--transition-slow);
}

.card:hover,
.result-card:hover,
.feature-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.card:hover .card-icon,
.result-card:hover .card-icon,
.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    transition: transform var(--transition-bounce);
}

/* Progress Step Interactions */
.progress-step {
    cursor: pointer;
}

.progress-step:hover .step-circle {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgb(59 130 246 / 10%);
}

.progress-step.active:hover .step-circle {
    transform: scale(1.15);
    box-shadow: 0 0 0 12px rgb(59 130 246 / 15%);
}

/* Upload Area Interactions */
.upload-area {
    transition: all var(--transition-normal);
    position: relative;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgb(59 130 246 / 10%) 50%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.upload-area:hover::before {
    opacity: 1;
    animation: shimmer 2s infinite;
}

.upload-area.dragover {
    transform: scale(1.02);
    border-color: var(--primary-500);
    background: var(--primary-50);
    box-shadow: 0 0 0 4px rgb(59 130 246 / 10%);
}

.upload-area.dragover::before {
    opacity: 1;
    animation: shimmer 1s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Enhanced Input Focus */
.form-input {
    position: relative;
    transition: all var(--transition-normal);
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgb(59 130 246 / 15%), 0 0 0 3px rgb(59 130 246 / 10%);
}

/* Floating Labels */
.form-group {
    position: relative;
}

.form-label.floating {
    position: absolute;
    top: 12px;
    left: 16px;
    background: white;
    padding: 0 4px;
    color: var(--neutral-500);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.form-input:focus + .form-label.floating,
.form-input:not(:placeholder-shown) + .form-label.floating {
    top: -8px;
    font-size: var(--text-xs);
    color: var(--primary-600);
    font-weight: 500;
}

/* Navigation Link Interactions */
.nav-link {
    position: relative;
    transition: all var(--transition-normal);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-500);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 100%;
}

.nav-link.active::before {
    width: 100%;
    background: var(--primary-600);
}

/* Icon Spin on Hover */
.material-icons-round {
    transition: transform var(--transition-normal);
}

.btn:hover .material-icons-round,
.nav-link:hover .material-icons-round {
    transform: scale(1.1);
}

.btn-primary:hover .material-icons-round {
    animation: pulse-icon 0.6s ease-in-out;
}

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

/* Loading State Interactions */
.btn.loading {
    pointer-events: none;
    position: relative;
}

.btn.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentcolor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.btn.loading .material-icons-round,
.btn.loading span:not(.sr-only) {
    opacity: 0;
}

/* Notification Slide In */
.notification {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes slideInRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Tooltip Interactions */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--neutral-900);
    color: white;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    white-space: nowrap;
    z-index: var(--z-tooltip);
    animation: fadeIn 0.2s ease-out;
    margin-bottom: 4px;
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--neutral-900);
    z-index: var(--z-tooltip);
}

/* Scroll-triggered Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animation Delays */
.animate-on-scroll:nth-child(1) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.5s; }
