﻿:root {
    --bg-page: #ffffff; /* Cleaner white base */
    --bg-card: #ffffff;
    --text-primary: #1a1a1a; /* Sharper black */
    --text-secondary: #5e5e66; /* Sharper grey */
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --border: #e6e6eb; /* Lighter, cleaner border */
    --nav-height: 44px;
    --border-radius: 18px;
    /* Purple-tinted shadows for that "premium" feel */
    --shadow-sm: 0 4px 20px rgba(124, 58, 237, 0.06); 
    --shadow-md: 0 12px 32px rgba(124, 58, 237, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.7);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --input-bg: #f9fafb;
    --file-row-bg: #f9fafb;
    --drop-zone-bg: rgba(124, 58, 237, 0.02);
    --features-bg: transparent; /* Remove solid block to let body gradient show */
    --large-item-bg: #fafafa;
}

[data-theme="dark"] {
    --bg-page: #000000;
    --bg-card: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --border: #424245;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 16px rgba(0,0,0,0.4);
    --nav-bg: rgba(29, 29, 31, 0.8);
    --glass-bg: rgba(28, 28, 30, 0.6);
    --input-bg: rgba(28, 28, 30, 0.8);
    --file-row-bg: #1c1c1e;
    --drop-zone-bg: rgba(255,255,255,0.05);
    /* --features-bg: #000000; - kept transparent or handled by body */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    /* Subtle violet mesh gradient for Light Mode "Glow" */
    background-image: radial-gradient(circle at 50% 0%, #f7f3ff 0%, #ffffff 70%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.47059;
    font-size: 17px;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background: #000000; /* Force flat black in dark mode */
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-page); 
}
::-webkit-scrollbar-thumb {
    background: #d2d2d7; 
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent); 
}

/* Button Pulse Animation */
@keyframes btnShine {
    0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

.btn-primary:active {
    transform: scale(0.96);
}

.hero .btn-primary {
    animation: btnShine 2s infinite;
}

/* Nav - Floating Glass Pill */
.nav-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 980px;
    height: 64px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.8); /* Highlight top edge */
    border-radius: 100px;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.06),
        0 1px 2px rgba(255,255,255,0.8) inset; /* Inner light mechanism */
    transition: all 0.3s ease;
    animation: slideDown 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

[data-theme="dark"] .nav-bar {
    background: rgba(20, 20, 23, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.nav-content {
    /* max-width: 980px; removed constraint as parent controls it */
    width: 100%;
    margin: 0;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px 0 24px; /* padding for pill */
}

.nav-logo {
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-logo ion-icon {
    transition: transform 0.5s ease;
}

.nav-logo:hover ion-icon {
    transform: rotate(180deg) scale(1.1);
}

.nav-logo:hover {
    transform: scale(1.02);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0,0,0,0.03);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid rgba(0,0,0,0.02);
}

[data-theme="dark"] .nav-links {
    background: rgba(255,255,255,0.08);
}

.nav-links a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 100px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-links a:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}
[data-theme="dark"] .nav-links a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-btn {
    background: var(--text-primary);
    color: var(--bg-page) !important;
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.nav-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2) !important;
    opacity: 1 !important;
}

/* Mobile Responsive Nav */
@media (max-width: 768px) {
    .nav-bar {
        top: 10px;
        width: 94%;
        height: 60px;
    }
    .nav-links { display: none; } /* Handled by inline JS style usually, or remove this and depend on JS active class */
    .mobile-toggle { display: block !important; }
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: rgba(128,128,128,0.1);
}

/* Hero */
.hero {
    min-height: 90vh; 
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding-top: var(--nav-height);
}

.hero-content {
    max-width: 700px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.07143;
    font-weight: 600;
    letter-spacing: -0.005em;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 400;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 98px;
    font-size: 17px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.link {
    color: var(--accent);
    text-decoration: none;
    font-size: 19px;
    display: inline-flex;
    align-items: center;
}

.link:hover {
    text-decoration: underline;
}

.arrow {
    font-size: 20px;
    margin-left: 4px;
    transition: transform 0.2s;
}

.link:hover .arrow {
    transform: translateX(3px);
}

/* Features Grid */
.features {
    padding: 100px 0;
    background: var(--features-bg);
}

.grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-item {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 32px;
    height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align contents to top */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid var(--border); /* Subtle border by default */
    position: relative;
    overflow: hidden;
}

/* Subtle gradient background for visual interest */
.grid-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(124, 58, 237, 0.03) 100%);
    z-index: 0;
    opacity: 0.5;
}
[data-theme="dark"] .grid-item::before {
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(124, 58, 237, 0.1) 100%);
}

.feature-icon-box {
    width: 60px;
    height: 60px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 28px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
}

.grid-item:hover .feature-icon-box {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent);
    color: white;
}

.item-content {
    position: relative;
    z-index: 1;
}

.large-item {
    background: var(--large-item-bg);
}

.dark-item {
    /* Removed specific override to keep them uniform now */
}
[data-theme="dark"] .dark-item {
    background: #1c1c1e;
    border: 1px solid #333;
}

.dark-item p {
    color: #86868b;
}

.item-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}
.dark-item .item-content h3 {
    color: white;
}

.item-content p {
    font-size: 19px;
    color: var(--text-secondary);
    font-weight: 500;
}

.grid-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: var(--accent);
}

/* Upload Section */
.upload-section {
    padding: 120px 0;
    background: var(--bg-page);
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 22px;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-primary);
}

.section-header h2 {
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 21px;
    color: var(--text-secondary);
}

/* Glass Panel Form */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 17px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--input-bg);
    color: var(--text-primary);
}

.input-group input:focus {
    border-color: var(--accent);
    background: var(--bg-card);
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--drop-zone-bg);
    margin-bottom: 24px;
}

.drop-zone *:not(input) {
    pointer-events: none;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.05); /* Updated to match accent color */
}

.upload-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.drop-title {
    display: block;
    font-size: 17px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 4px;
}

.drop-subtitle {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}

.file-list {
    margin-bottom: 24px;
    text-align: left;
}

.file-row {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--file-row-bg);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
    padding: 16px;
    font-size: 17px;
    font-weight: 500;
}

/* Health Tips Section - Enhanced */
.health-tips-section {
    padding: 100px 0;
    background: var(--bg-page);
    overflow: hidden;
    position: relative;
}

.health-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 0 22px;
}

.health-header h2 {
    font-size: 40px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.tips-carousel-wrapper {
    width: 100%;
    overflow-x: auto;
    cursor: grab;
    /* Mask for fade effect on edges */
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tips-carousel-wrapper:active {
    cursor: grabbing;
}

.tips-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.tips-track {
    display: flex;
    gap: 32px;
    width: max-content;
    padding: 20px 40px; /* Space for shadow and initial offset */
}

.health-card {
    width: 350px;
    height: 420px;
    background: var(--bg-card);
    border-radius: 28px;
    padding: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.health-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 24px 48px rgba(0,0,0,0.12);
    border-color: var(--accent);
}

.card-icon-wrapper {
    width: 64px;
    height: 64px;
    background: rgba(0, 113, 227, 0.08);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    margin-bottom: 24px;
    font-size: 32px;
}

.card-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.card-content p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-number {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 80px;
    font-weight: 800;
    color: var(--text-primary);
    opacity: 0.05;
    z-index: 0;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}

/* @keyframes scrollLeft - Removed */

/* Background Blob for Hero - Removed for Neural Network */
/* .hero::before { deleted } */

/* Footer */
footer {
    background: var(--bg-page);
    padding: 40px 0;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

.footer-content {
    display: flex;
    justify-content: space-between;
}

.footer-links a {
    color: var(--text-primary);
    text-decoration: none;
    margin-left: 20px;
}

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

/* Animation Utilities */
.fade-in {
    opacity: 0;
}

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

@media (max-width: 1068px) {
    .grid-container { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 48px; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 40px; }
    .hero p { font-size: 19px; max-width: 100%; }
    .grid-container { grid-template-columns: 1fr; }
    .large-item { grid-column: auto; }
    .grid-item { height: 300px; padding: 30px; }
    .input-grid { grid-template-columns: 1fr; }
}

/* Stats Strip */
.stats-strip {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 30px 0;
    margin-bottom: 60px;
    z-index: 10;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.stats-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 980px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}
.stat-box {
    text-align: center;
}
.stat-number {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
    margin-bottom: 5px;
}
.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Process Workflow */
.process-section {
    padding: 100px 0;
    background: var(--bg-page);
    position: relative;
}
.process-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    padding: 0 20px;
}
/* The connected line */
.process-line {
    position: absolute;
    top: 50px;
    left: 100px;
    right: 100px;
    height: 2px;
    background: var(--border);
    z-index: 0;
    display: block;
}
/* Pulse animation running through the line */
.process-line::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: impulse 3s infinite linear;
}
@keyframes impulse {
    0% { left: -30%; }
    100% { left: 100%; }
}
.process-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}
.process-step {
    text-align: center;
    flex: 1;
    max-width: 250px;
}
.step-icon-wrapper {
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-sm);
}
.process-step:hover .step-icon-wrapper {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
}
.step-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.step-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 768px) {
    .stats-container { flex-direction: column; }
    .process-steps {
        flex-direction: column;
        gap: 28px;
        align-items: center;
    }
    .process-step {
        max-width: 100%;
        width: min(100%, 360px);
        margin: 0 auto;
    }
    .process-line { display: none; }
    .step-icon-wrapper { width: 80px; height: 80px; font-size: 32px; }
    .step-title { font-size: 18px; }
    .step-desc {
        font-size: 14px;
        max-width: 32ch;
        margin: 0 auto;
    }
}

/* Scanner Animation in Drop Zone */
.scan-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.02);
    z-index: 5;
    border-radius: 12px;
    pointer-events: none;
    overflow: hidden;
}
.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
    top: 0;
    animation: scanner 2s infinite ease-in-out;
}
@keyframes scanner {
    0% { top: 0%; opacity: 0; }
    10% { opacity: 1; }
    50% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}


.process-steps {
    position: relative;
    /* Ensure line inside is handled correctly */
}


/* Extra pop for Light Mode Cards */
html:not([data-theme='dark']) .grid-item,
html:not([data-theme='dark']) .health-card,
html:not([data-theme='dark']) .glass-panel {
    border: 1px solid rgba(124, 58, 237, 0.08); /* Subtle violet border to separate from white bg */
    background: #ffffff;
}


.features {
    position: relative;
    overflow: hidden;
}


/* Analysis Results Styling */
.analysis-results {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid var(--border);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.analysis-results.visible {
    opacity: 1;
    transform: translateY(0);
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr; /* Changed to single column for better width */
    gap: 48px;
    margin-top: 48px;
}

.result-header p {
    font-size: 20px;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 42px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Animation hooks */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUpCard 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.3);
}

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

.result-card h3 {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
}

.result-card h3 ion-icon {
    color: var(--accent);
    background: rgba(124, 58, 237, 0.1);
    padding: 10px;
    border-radius: 14px;
}

.metric-card-header {
    width: 100%;
}

.metric-score-pill {
    white-space: normal;
    text-align: right;
}

.health-graph canvas {
    width: 100% !important;
    max-width: 540px;
}

/* Lists */
.list-check {
    list-style: none;
}

.list-check li {
    position: relative;
    padding-left: 38px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 17px;
}

.list-check li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--accent);
    font-weight: 900;
    font-size: 16px;
    background: rgba(124, 58, 237, 0.08); /* faint circle bg */
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* SWOT Grid */
.swot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.swot-box {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.swot-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.swot-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.swot-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.swot-box h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.swot-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.swot-box li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 20px;
    position: relative;
}

.swot-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    font-size: 1.2em;
}

/* Specific Styles for SWOT Types */
/* Strengths */
.swot-box.strengths {
    border-left: 4px solid #10b981;
    background: linear-gradient(to right bottom, rgba(16, 185, 129, 0.05), var(--bg-card));
}
.swot-box.strengths .swot-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}
.swot-box.strengths li::before { color: #10b981; }

/* Weaknesses */
.swot-box.weaknesses {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(to right bottom, rgba(245, 158, 11, 0.05), var(--bg-card));
}
.swot-box.weaknesses .swot-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}
.swot-box.weaknesses li::before { color: #f59e0b; }

/* Opportunities */
.swot-box.opportunities {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(to right bottom, rgba(59, 130, 246, 0.05), var(--bg-card));
}
.swot-box.opportunities .swot-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}
.swot-box.opportunities li::before { color: #3b82f6; }

/* Threats */
.swot-box.threats {
    border-left: 4px solid #ef4444;
    background: linear-gradient(to right bottom, rgba(239, 68, 68, 0.05), var(--bg-card));
}
.swot-box.threats .swot-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}
.swot-box.threats li::before { color: #ef4444; }

/* Graph */
.graph-bar {
    margin-bottom: 28px;
}

.graph-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.bar-track {
    height: 16px;
    background: rgba(0,0,0,0.04);
    border-radius: 50px;
    overflow: hidden;
    position: relative;
}

[data-theme='dark'] .bar-track {
    background: rgba(255,255,255,0.08);
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 50px;
    width: 0; /* JS will animate this or keyframe */
    animation: growBar 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes growBar {
    from { width: 0; }
}

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

@media (max-width: 768px) {
    .result-grid { grid-template-columns: 1fr; }
    .swot-grid { grid-template-columns: 1fr; }
    .metric-score-pill {
        width: 100%;
        text-align: left;
    }
    .health-graph canvas {
        max-width: 100%;
    }
    .analysis-action-btn {
        width: 100%;
    }
}


.spin {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Compliance Section */
.compliance-section {
    padding: 100px 0;
    /* Richer background for contrast, or keep card bg */
    background: linear-gradient(to bottom, var(--bg-card), var(--bg-page)); 
    border-top: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.compliance-section::before {
    /* Background Ambience */
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    width: 1000px;
    height: 1000px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
}

.compliance-wrapper {
    text-align: center;
    position: relative;
    z-index: 1;
}

.compliance-headers h2 {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.compliance-headers p {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 60px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.badges-grid {
    display: grid;
    /* Fixed 3 columns for desktop symmetry */
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 980px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .badges-grid {
        grid-template-columns: 1fr;
    }
    .badge-item {
        padding: 16px;
        gap: 12px;
    }
    .badge-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    .badge-item span {
        font-size: 15px;
    }
    .badge-item small {
        font-size: 13px;
    }

    .compliance-section {
        display: none;
    }
}

.badge-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    gap: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    width: 100%;
}

[data-theme='dark'] .badge-item {
    background: #1c1c1e;
}

.badge-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 24px 48px rgba(124, 58, 237, 0.15);
    border-color: var(--accent);
}

.badge-icon {
    font-size: 32px;
    color: var(--accent);
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.08);
    transition: transform 0.4s ease, background 0.4s ease, color 0.4s ease;
}

.badge-item:hover .badge-icon {
    transform: rotate(10deg);
    background: var(--accent);
    color: #ffffff;
}

.badge-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1; /* Take remaining space */
    min-width: 0; /* Enable text wrapping in flex child */
}

.badge-item span {
    display: block;
    font-weight: 800;
    color: var(--text-primary);
    font-size: 17px;
    margin-bottom: 4px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.badge-item small {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

/* Make grid responsive to prevent squashing */
@media (max-width: 1100px) {
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- NEW INDUSTRY LEVEL UI/UX STYLES --- */

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    opacity: 0.7;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 16px; margin-bottom: 12px; width: 100%; }
.skeleton-text.short { width: 60%; }
.skeleton-title { height: 24px; margin-bottom: 16px; width: 40%; }
.skeleton-card { height: 200px; border-radius: var(--border-radius); }

/* Chatbot Interface */
.chatbot-container {
    margin-top: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
}
.chat-header {
    padding: 16px 24px;
    background: var(--accent);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg-page);
}
.chat-msg {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    animation: fadeUp 0.3s ease forwards;
}
.chat-msg.user {
    align-self: flex-end;
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-msg.ai {
    align-self: flex-start;
    background: var(--input-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}
.chat-input-area {
    padding: 16px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
}
.chat-input-area input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--input-bg);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.3s;
}
.chat-input-area input:focus {
    border-color: var(--accent);
}
.chat-input-area button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.2s;
}
.chat-input-area button:hover {
    transform: scale(1.05);
}

/* Modal (Doctor Booking) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}
.modal-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
    position: relative;
    animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    font-size: 24px; color: var(--text-secondary);
    cursor: pointer;
}
.doctor-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.doctor-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    transition: all 0.2s;
}
.doctor-card:hover {
    border-color: var(--accent);
    background: var(--drop-zone-bg);
}
.doctor-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: bold;
}
.doctor-info h4 { margin-bottom: 4px; }
.doctor-info p { font-size: 13px; color: var(--text-secondary); }

/* Language Selector */
.lang-select {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}
[data-theme="dark"] .lang-select {
    background: rgba(255,255,255,0.08);
}
.lang-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Voice Button */
.voice-btn {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent);
    border: none;
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}
.voice-btn:hover {
    background: var(--accent);
    color: white;
}
.voice-btn.playing {
    animation: pulse 1.5s infinite;
}

.analysis-actions {
    align-items: center;
}

.analysis-action-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.analysis-action-btn ion-icon {
    font-size: 17px;
}

.analysis-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--accent);
}

.action-email-btn,
.action-consult-btn {
    background: var(--accent);
    color: #fff;
    border-color: transparent;
}

.action-email-btn:hover,
.action-consult-btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.analysis-action-btn.voice-btn {
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent);
    border-color: rgba(124, 58, 237, 0.3);
}

.analysis-action-btn.voice-btn:hover {
    background: var(--accent);
    color: #fff;
}

.scroll-top-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1200;
}

.scroll-top-btn.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0); }
    100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Flowy Copyright Animation */
.copyright-flowy {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.copyright-text {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    background: linear-gradient(
        90deg,
        var(--text-secondary) 0%,
        var(--accent) 25%,
        var(--accent) 75%,
        var(--text-secondary) 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: flowyWave 3s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes flowyWave {
    0% {
        background-position: 200% 0;
        transform: translateY(0) scaleY(1);
    }
    25% {
        transform: translateY(-2px) scaleY(1.05);
    }
    50% {
        background-position: -200% 0;
        transform: translateY(0) scaleY(1);
    }
    75% {
        transform: translateY(-2px) scaleY(1.05);
    }
    100% {
        background-position: 200% 0;
        transform: translateY(0) scaleY(1);
    }
}
