/* ========================================
   RENAL COMPANION LANDING PAGE
   Components CSS - Advanced UI Elements
   ======================================== */

/* ========================================
   SEQUENTIAL FEATURE DISCOVERY
   ======================================== */

.feature-sequential {
    display: flex;
    flex-direction: column;
    gap: var(--space-24);
    margin-top: var(--space-12);
}

.feature-showcase {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: center;
    padding: var(--space-12);
    background: white;
    border-radius: var(--radius-3xl);
    border: 1px solid var(--neutral-200);
    transition: all var(--transition-slow);
}

@media (min-width: 1024px) {
    .feature-showcase {
        grid-template-columns: 1.1fr 0.9fr;
    }

    .feature-showcase.alt-layout {
        grid-template-columns: 0.9fr 1.1fr;
    }

    .feature-showcase.alt-layout .feature-detail {
        order: 2;
    }

    .feature-showcase.alt-layout .feature-visual {
        order: 1;
    }
}

.feature-label {
    display: inline-block;
    padding: var(--space-1) var(--space-4);
    background: rgba(16, 165, 165, 0.1);
    color: var(--primary-700);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}


.feature-detail h3 {
    font-size: 2.25rem;
    margin-bottom: var(--space-4);
    color: var(--neutral-900);
}

.lead-text {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--neutral-600);
    margin-bottom: var(--space-8);
}

.feature-highlights {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.feature-highlights li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    color: var(--neutral-700);
}

.feature-highlights li::before {
    content: '→';
    flex-shrink: 0;
    color: var(--primary-500);
    font-weight: 700;
}

.tech-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.tech-badge {
    padding: var(--space-2) var(--space-4);
    background: var(--neutral-50);
    color: var(--neutral-600);
    font-size: 0.813rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
}

/* Animations for scroll reveal */
.reveal-on-scroll {
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.reveal-on-scroll.reveal-active {
    opacity: 1;
}



/* Animated Mockup */
.animated-mockup {
    position: relative;
    padding: var(--space-6);
}

.mockup-screen {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-2xl);
}

.search-demo {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.search-bar {
    padding: var(--space-3) var(--space-4);
    background: var(--neutral-100);
    border-radius: var(--radius-md);
    font-size: 0.938rem;
    color: var(--neutral-600);
    margin-bottom: var(--space-4);
}

.search-bar.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

.food-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--neutral-50);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.nutrient-badge {
    padding: var(--space-1) var(--space-3);
    background: var(--success);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.nutrient-badge.warning {
    background: var(--warning);
}

/* Chat Demo Styling - ENHANCED PROFESSIONAL VERSION */
.chat-demo-container {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--radius-3xl);
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    max-width: 420px;
    margin: 0 auto;
    border: 1px solid var(--neutral-200);
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    background: var(--gradient-primary);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-avatar {
    position: relative;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary-600);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.avatar-ring {
    position: absolute;
    inset: -4px;
    border: 2px solid white;
    border-radius: var(--radius-full);
    opacity: 0.6;
    animation: avatarPulse 2s ease-in-out infinite;
}

@keyframes avatarPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.3;
    }
}

.chat-header-info {
    flex: 1;
}

.chat-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

.chat-status {
    font-size: 0.813rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.chat-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: var(--radius-full);
    display: inline-block;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Chat Messages Container */
.chat-messages {
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-height: 280px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    opacity: 0;
    transform: translateY(10px);
}

.chat-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message-content {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-xl);
    font-size: 0.938rem;
    line-height: 1.6;
    box-shadow: var(--shadow-sm);
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #0D7373 0%, #10A5A5 100%);
    color: white;
    border-bottom-right-radius: var(--radius-xs);
}

.chat-message.assistant {
    position: relative;
    padding-left: 44px;
}

.chat-message.assistant .message-content {
    background: white;
    color: var(--neutral-800);
    border: 1px solid var(--neutral-200);
    border-bottom-left-radius: var(--radius-xs);
}

.ai-avatar {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(13, 115, 115, 0.25);
}

.message-time {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: var(--space-1);
    font-weight: 500;
}

.message-badges {
    margin-top: var(--space-2);
    display: flex;
    gap: var(--space-2);
}

.badge-clinical {
    font-size: 0.75rem;
    padding: var(--space-1) var(--space-2);
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-left: 44px;
    opacity: 0;
}

.ai-avatar-small {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
    box-shadow: 0 4px 8px rgba(13, 115, 115, 0.25);
    position: absolute;
    inset-inline-start: var(--space-6);
    top: 50%;
    transform: translateY(-50%);
}

.typing-dots {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-xl);
    padding: var(--space-3) var(--space-5);
    display: flex;
    gap: var(--space-1);
    box-shadow: var(--shadow-sm);
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--neutral-400);
    border-radius: var(--radius-full);
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mockup Header & Budgeting */
.mockup-header-demo {
    margin-bottom: var(--space-4);
    padding: var(--space-2) 0;
}

.mockup-header-demo span {
    font-size: 0.875rem;
    color: var(--neutral-600);
    font-weight: 600;
    display: block;
    margin-bottom: var(--space-2);
}

.budget-progress-demo {
    width: 100%;
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill-demo {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s ease-in-out;
}

/* Clinical Formula */
.clinical-formula {
    background: var(--neutral-50);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    border: 2px solid var(--neutral-200);
}

.clinical-formula h4 {
    margin-bottom: var(--space-4);
    color: var(--clinical-800);
}

.formula-box {
    background: var(--neutral-900);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}

.formula-box code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: #10B981;
    line-height: 1.8;
}

.formula-explanation {
    font-size: 0.938rem;
    color: var(--neutral-600);
    font-style: italic;
}

/* Inference Diagram */
.inference-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-6);
}

.inference-node {
    padding: var(--space-4) var(--space-6);
    background: white;
    border: 2px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    min-width: 150px;
    /* Increased and unified min-width */
    height: 70px;
    /* Fixed height for perfect consistency */
    display: flex;
    align-items: center;
    justify-content: center;
}

.inference-node-highlight {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-lg);
    -webkit-text-fill-color: white !important;
    /* Force visibility override */
}

.inference-node-result {
    background: var(--gradient-success);
    color: white;
    border-color: transparent;
    -webkit-text-fill-color: white !important;
}

.inference-arrow {
    font-size: 1.5rem;
    color: var(--primary-700);
    font-weight: 700;
}

/* Scanner Demo */
.scanner-demo {
    position: relative;
    padding: var(--space-8);
}

.scan-frame {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-2xl);
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #10B981, transparent);
    animation: scan 2s ease-in-out infinite;
}

@keyframes scan {

    0%,
    100% {
        top: 20%;
    }

    50% {
        top: 80%;
    }
}

/* Visual Recognition Demo */
.visual-recognition-demo {
    position: relative;
    padding: var(--space-8);
    background: var(--neutral-50);
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

.camera-ui {
    max-width: 320px;
    margin: 0 auto;
    background: #000;
    border-radius: var(--radius-3xl);
    padding: var(--space-4);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
    border: 8px solid var(--neutral-800);
}

.camera-frame {
    position: relative;
    aspect-ratio: 4/5;
    background: url('https://images.unsplash.com/photo-1571771894821-ad9902410947?auto=format&fit=crop&w=800&q=80');
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.object-detection-box {
    position: absolute;
    top: 30%;
    left: 20%;
    width: 60%;
    height: 40%;
    border: 2px solid var(--primary-400);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 20px rgba(16, 165, 165, 0.4);
    animation: detectPulse 2s ease-in-out infinite;
}

.object-detection-box::before,
.object-detection-box::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 4px solid var(--primary-500);
}

.object-detection-box::before {
    top: -4px;
    left: -4px;
    border-right: none;
    border-bottom: none;
}

.object-detection-box::after {
    bottom: -4px;
    right: -4px;
    border-left: none;
    border-top: none;
}

.detection-label {
    position: absolute;
    top: -45px;
    left: 0;
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    white-space: nowrap;
}

.weight-tag {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
}

.action-overlay {
    margin-top: var(--space-4);
    display: flex;
    justify-content: center;
}

.add-btn {
    padding: var(--space-3) var(--space-8);
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.938rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

@keyframes detectPulse {

    0%,
    100% {
        border-color: var(--primary-400);
        transform: scale(1);
    }

    50% {
        border-color: var(--primary-200);
        transform: scale(1.02);
    }
}

.camera-shutter {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
}

.camera-shutter.active {
    animation: shutterFlash 0.3s ease-out;
}

@keyframes shutterFlash {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
    }
}

/* Camera Status */
.camera-status {
    text-align: center;
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: all 0.3s ease;
}

/* Scan Indicator */
.scan-indicator {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.crosshair {
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-400);
    border-radius: 50%;
    position: relative;
    animation: scanPulse 2s ease-in-out infinite;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: var(--primary-400);
}

.crosshair::before {
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    transform: translateY(-50%);
}

.crosshair::after {
    left: 50%;
    top: 10%;
    bottom: 10%;
    width: 2px;
    transform: translateX(-50%);
}

.scan-indicator.analyzing .crosshair {
    animation: scanRotate 1.5s linear infinite, scanPulse 2s ease-in-out infinite;
}

@keyframes scanPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes scanRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Quantity Selector */
.quantity-selector {
    padding: var(--space-4);
    background: white;
    border-radius: var(--radius-lg);
    margin-top: var(--space-3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quantity-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
}

.quantity-slider {
    height: 8px;
    background: var(--neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.quantity-slider-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.quantity-value {
    text-align: center;
    font-size: 0.938rem;
    font-weight: 700;
    color: var(--primary-700);
}

.scan-result {
    background: rgba(255, 255, 255, 0.95);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.938rem;
    box-shadow: var(--shadow-lg);
}

.scan-result strong {
    color: var(--danger);
}

/* Impact Stat */
.impact-stat {
    background: linear-gradient(135deg, var(--warning), #F97316);
    color: white;
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    text-align: center;
    margin-top: var(--space-6);
}

.big-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    font-family: var(--font-heading);
    margin-bottom: var(--space-2);
}

.impact-stat p {
    color: white;
    font-size: 1rem;
}

/* Chart Preview */
.chart-preview {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.trend-chart {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.chart-label {
    text-align: center;
    font-size: 0.875rem;
    color: var(--neutral-600);
    margin-top: var(--space-2);
}

/* ========================================
   TECHNOLOGY SECTION
   ======================================== */

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-16);
}

.tech-card {
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
    text-align: center;
    transition: all var(--transition-base);
}

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

.tech-icon {
    margin-bottom: var(--space-4);
}

.tech-card h3 {
    margin-bottom: var(--space-3);
    color: var(--primary-700);
}

.tech-card p {
    font-size: 0.938rem;
}

/* Architecture Diagram */
.architecture-diagram {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    margin: var(--space-16) 0;
    box-shadow: var(--shadow-lg);
}

.diagram-title {
    text-align: center;
    margin-bottom: var(--space-8);
    color: var(--clinical-800);
}

.arch-layers {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    max-width: 600px;
    margin: 0 auto;
}

.arch-layer {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    text-align: center;
}

.arch-layer.presentation {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.arch-layer.domain {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-500));
    color: white;
}

.arch-layer.data {
    background: linear-gradient(135deg, var(--clinical-800), var(--clinical-600));
    color: white;
}

.arch-layer h4 {
    color: white;
    margin-bottom: var(--space-2);
}

.arch-layer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.arch-arrow {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-700);
    font-weight: 700;
}

.arch-note {
    margin-top: var(--space-8);
    padding: var(--space-4);
    background: var(--neutral-50);
    border-left: 4px solid var(--primary-700);
    border-radius: var(--radius-md);
    font-size: 0.938rem;
}

/* Code Showcase */
.code-showcase {
    background: var(--neutral-900);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    margin-top: var(--space-12);
}

.code-showcase h3 {
    color: white;
    margin-bottom: var(--space-6);
}

.code-showcase pre {
    background: #1a1a1a;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    overflow-x: auto;
    margin-bottom: var(--space-4);
}

.code-showcase code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.8;
    color: #10B981;
}

.code-caption {
    color: var(--neutral-400);
    font-size: 0.875rem;
    font-style: italic;
}

/* ========================================
   VALIDATION SECTION
   ======================================== */

.validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-12);
}

.validation-card {
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-xl);
    border: 2px solid var(--neutral-200);
}

.validation-badge {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    background: var(--gradient-success);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-4);
}

.validation-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.validation-list li {
    padding-left: var(--space-4);
    position: relative;
    font-size: 0.938rem;
}

.validation-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

.research-callout {
    background: linear-gradient(135deg, var(--clinical-800), var(--clinical-600));
    color: white;
    padding: var(--space-12);
    border-radius: var(--radius-2xl);
    text-align: center;
}

.research-callout h3 {
    color: white;
    margin-bottom: var(--space-4);
}

.research-callout p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto var(--space-6) auto;
}

/* ========================================
   RESEARCHERS SECTION
   ======================================== */

.citation-box {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin-bottom: var(--space-12);
    box-shadow: var(--shadow-lg);
}

.citation-text {
    background: var(--neutral-50);
    border-left: 4px solid var(--primary-700);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin: var(--space-4) 0;
}

.citation-text p {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.8;
}

.research-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
}

.research-item {
    padding: var(--space-6);
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--neutral-200);
}

.research-item h4 {
    margin-bottom: var(--space-3);
}

/* ========================================
   DOWNLOAD SECTION
   ======================================== */

.download-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: start;
    margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
    .download-container {
        grid-template-columns: 2fr 1fr;
    }
}

.download-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    box-shadow: var(--shadow-2xl);
    text-align: center;
}

.download-icon {
    margin-bottom: var(--space-6);
    color: var(--primary-700);
}

.download-info {
    margin: var(--space-6) 0;
    color: var(--neutral-700);
    line-height: 2;
}

.download-btn {
    width: 100%;
    margin-bottom: var(--space-6);
}

.install-guide {
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: left;
}

.install-guide summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--primary-700);
}

.install-guide ol {
    margin-top: var(--space-4);
    padding-left: var(--space-6);
}

.install-guide li {
    margin-bottom: var(--space-2);
    font-size: 0.938rem;
}

.qr-section {
    text-align: center;
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.qr-section h4 {
    margin-bottom: var(--space-4);
}

.qr-placeholder {
    margin: var(--space-4) 0;
}

.qr-caption {
    font-size: 0.875rem;
    color: var(--neutral-600);
}

.github-link {
    text-align: center;
    padding: var(--space-6);
    background: var(--neutral-50);
    border-radius: var(--radius-lg);
}

.github-link a {
    color: var(--primary-700);
    font-weight: 600;
    text-decoration: underline;
}

/* ========================================
   CLINICAL CHALLENGE SECTION - ENHANCED
   ======================================== */

.clinical-challenge-section {
    background: linear-gradient(180deg, white 0%, var(--neutral-50) 100%);
    position: relative;
    overflow: hidden;
}

.impact-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-12);
}

.stat-card-enhanced {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    position: relative;
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.stat-card-enhanced:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl);
}

.stat-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.stat-card-enhanced:hover .stat-glow {
    opacity: 1;
}

.stat-content {
    position: relative;
    z-index: 2;
}

.stat-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-2);
    font-family: var(--font-display);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value.primary-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value.warning-text {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-value.danger-text {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-desc {
    color: var(--neutral-600);
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.stat-cite {
    display: block;
    font-size: 0.75rem;
    color: var(--neutral-400);
    font-style: italic;
}

/* Clinical Gap Grid */
.clinical-gap-container {
    background: white;
    border-radius: var(--radius-3xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--neutral-200);
}

.gap-header h3 {
    margin-bottom: var(--space-8);
    color: var(--neutral-800);
    position: relative;
    display: inline-block;
}

.gap-header h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.gap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-6);
}

.clinical-gap-card {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    transition: all 0.3s ease;
}

.clinical-gap-card:hover {
    background: white;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.gap-icon-wrapper {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
    box-shadow: var(--shadow-sm);
}

.gap-content h4 {
    margin-bottom: var(--space-1);
    color: var(--neutral-800);
}

.gap-content p {
    font-size: 0.9rem;
    color: var(--neutral-600);
    margin-bottom: var(--space-3);
    line-height: 1.4;
}

.gap-impact {
    display: inline-block;
}

.impact-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    background: var(--neutral-200);
    color: var(--neutral-700);
}

/* Severity Coding */
.clinical-gap-card.severity-high {
    border-left: 4px solid #EF4444;
}

.clinical-gap-card.severity-high .gap-icon-wrapper {
    color: #EF4444;
    background: #FEF2F2;
}

.clinical-gap-card.severity-high .impact-badge {
    background: #FEF2F2;
    color: #B91C1C;
}

.clinical-gap-card.severity-medium {
    border-left: 4px solid #F59E0B;
}

.clinical-gap-card.severity-medium .gap-icon-wrapper {
    color: #F59E0B;
    background: #FFFBEB;
}

.clinical-gap-card.severity-medium .impact-badge {
    background: #FFFBEB;
    color: #B45309;
}

.clinical-gap-card.severity-low {
    border-left: 4px solid #3B82F6;
}

.clinical-gap-card.severity-low .gap-icon-wrapper {
    color: #3B82F6;
    background: #EFF6FF;
}

.clinical-gap-card.severity-low .impact-badge {
    background: #EFF6FF;
    color: #1D4ED8;
}

/* ========================================
   MURSHID AI ENHANCEMENT - PREMIUM
   ======================================== */

.ai-sparkle-group {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-sparkle-group .sparkle {
    position: absolute;
    color: #10B981;
    filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.ai-sparkle-group .s1 {
    width: 24px;
    height: 24px;
    animation: floatAI 4s ease-in-out infinite;
}

.ai-sparkle-group .s2 {
    width: 14px;
    height: 14px;
    top: -6px;
    right: -6px;
    animation: floatAI 3s ease-in-out infinite 0.5s;
    opacity: 0.9;
    color: #34D399;
}

.ai-sparkle-group .s3 {
    width: 10px;
    height: 10px;
    bottom: -2px;
    left: -6px;
    animation: floatAI 5s ease-in-out infinite 1.2s;
    opacity: 0.7;
    color: #6EE7B7;
}

.ai-sparkle-group.mini {
    scale: 0.75;
}

@keyframes floatAI {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    33% {
        transform: translateY(-4px) rotate(10deg) scale(1.05);
    }

    66% {
        transform: translateY(2px) rotate(-10deg) scale(0.95);
    }
}

.reasoning-box-premium {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xl) 0;
    padding: var(--space-4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 200px; /* Reduced from 240px */
    max-width: 100%; /* Ensure it doesn't overflow parent */
    margin-bottom: var(--space-4);
    flex: 1; /* Allow flexible resizing */
}

.reasoning-aura {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.15) 0%, transparent 65%);
    animation: auraPulse 4s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes auraPulse {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
        filter: blur(10px);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.15);
        filter: blur(15px);
    }
}

.reasoning-content-inner {
    position: relative;
    z-index: 2;
    width: 100%; /* Ensure content respects container width */
}

.reasoning-status-text {
    font-size: 0.85rem; /* Slightly reduced for mobile fit */
    font-weight: 600;
    color: var(--neutral-800);
    margin-bottom: var(--space-3);
    display: block;
    transition: opacity 0.4s ease;
    opacity: 1;
    white-space: normal; /* Force wrapping */
    overflow-wrap: break-word; /* Prevent overflow */
    word-break: break-word; /* Ensure long words break */
    line-height: 1.4;
}

.reasoning-progress-track {
    width: 100%;
    height: 6px;
    background: var(--neutral-100);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), #10B981, var(--primary-500));
    background-size: 200% 100%;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
    animation: shimmerProgress 2s linear infinite;
}

@keyframes shimmerProgress {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: 0% 0;
    }
}

.chat-message.assistant.hidden {
    display: none;
    opacity: 0;
}

.typing-indicator.hidden {
    display: none;
    opacity: 0;
}

.chat-message.assistant.visible,
.typing-indicator.visible {
    display: flex !important;
    opacity: 1 !important;
    animation: fadeInSlideUp 0.5s ease-out forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ========================================
   CLINICAL INFORMATICS & AUTHORITY
   ======================================== */

.informatics-section {
    position: relative;
    overflow: hidden;
}

.section-padding-t {
    padding-top: var(--space-16);
}

.text-silver {
    color: var(--neutral-400);
}

.engine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-8);
    margin-top: var(--space-12);
}

.engine-step-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-8);
    border-radius: var(--radius-2xl);
    position: relative;
    transition: all var(--transition-base);
}

.engine-step-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-400);
    transform: translateY(-5px);
}

.step-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-8);
    font-size: 2.5rem;
    font-weight: 800;
    opacity: 0.1;
    color: var(--primary-400);
}

.engine-step-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-3);
    color: var(--primary-300);
}

.engine-step-card p {
    color: var(--neutral-400);
    line-height: 1.6;
}

/* Analytics Highlight */
.analytics-highlight {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: center;
    background: rgba(16, 165, 165, 0.05);
    border-radius: var(--radius-3xl);
    padding: var(--space-12);
    margin-top: var(--space-16);
    border: 1px solid rgba(16, 165, 165, 0.1);
}

.analytics-content h3 {
    font-size: 2rem;
    margin-bottom: var(--space-2);
}

.analytics-sub {
    color: var(--primary-400);
    font-weight: 700;
    font-size: 0.813rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
}

@media (min-width: 1024px) {
    .analytics-highlight {
        grid-template-columns: 1fr 1fr;
    }
}

.analytics-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.ana-feat h4 {
    color: var(--primary-300);
    font-size: 1rem;
    margin-bottom: var(--space-2);
}

.ana-feat p {
    font-size: 0.875rem;
    color: var(--neutral-400);
}

.analytics-visual {
    background: #0a0a0a;
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.math-backdrop {
    font-family: var(--font-mono);
    color: var(--primary-400);
    font-size: 0.813rem;
}

.math-backdrop code {
    opacity: 0.7;
}

.regression-line-demo {
    height: 150px;
    margin-top: var(--space-4);
    background: linear-gradient(to top right, transparent 48%, var(--primary-500) 50%, transparent 52%);
    position: relative;
    opacity: 0.3;
}

/* Compliance Matrix */
.compliance-matrix-container {
    max-width: 900px;
    margin: 0 auto;
}

.table-wrapper {
    margin-top: var(--space-8);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.compliance-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.compliance-table th,
.compliance-table td {
    padding: var(--space-5) var(--space-6);
    text-align: left;
    border-bottom: 1px solid var(--neutral-100);
}

.compliance-table th {
    background: var(--neutral-50);
    color: var(--neutral-800);
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.compliance-table tr:last-child td {
    border-bottom: none;
}

.compliance-table td:first-child {
    font-weight: 600;
    color: var(--neutral-900);
    width: 40%;
}

.compliance-table td:last-child {
    color: var(--neutral-600);
    font-size: 0.938rem;
    line-height: 1.5;
}

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

    .compliance-table th,
    .compliance-table td {
        padding: var(--space-4);
    }
}

/* ========================================
   DOWNLOAD MODAL
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-2xl);
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--neutral-400);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--neutral-100);
    color: var(--neutral-900);
}

.modal-icon {
    margin: 0 auto var(--space-6);
    color: var(--primary-600);
}

.modal-content h3 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--neutral-900);
    margin-bottom: var(--space-4);
    font-family: var(--font-heading);
}

.modal-content p {
    font-size: 1.1rem;
    color: var(--neutral-600);
    line-height: 1.6;
    margin-bottom: var(--space-8);
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

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

/* ========================================
   PREMIUM DOWNLOAD SECTION
   ======================================== */

.download-premium {
    padding: var(--space-24) 0;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.download-premium::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(16, 165, 165, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.download-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: flex-start;
}

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

/* Glass Panel Base */
.glass-panel {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-3xl);
    padding: var(--space-8);
}

/* Installation Steps */
.installation-guide h3 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: var(--space-8);
    text-align: center;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-5);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-base);
}

.step-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

[dir="rtl"] .step-item:hover {
    transform: translateX(-10px);
}

.step-number {
    width: 36px;
    height: 36px;
    background: white;
    color: var(--primary-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.step-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
}

/* Download Card (Right Column) */
.download-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255, 255, 255, 0.95) 100%);
    padding: var(--space-12);
    border-radius: var(--radius-3xl);
    color: var(--primary-900);
    box-shadow: 0 30px 60px rgba(0, 77, 77, 0.15), 0 10px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.download-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at top right, rgba(16, 165, 165, 0.1), transparent 70%);
    pointer-events: none;
}

.download-card h2 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: var(--space-4);
    color: var(--primary-700);
    letter-spacing: -0.02em;
}

.download-card .subtitle {
    font-size: 1rem;
    color: var(--neutral-600);
    margin-bottom: var(--space-10);
    max-width: 420px;
    font-weight: 500;
    line-height: 1.5;
}

.info-box.glass-panel-light {
    width: 100%;
    margin-bottom: var(--space-10);
    display: flex;
    flex-direction: column;
    gap: 0;
    background: rgba(16, 165, 165, 0.03);
    border: 1px solid rgba(16, 165, 165, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
}

.download-card .info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px dashed rgba(16, 165, 165, 0.15);
}

.download-card .info-item:last-child {
    border-bottom: none;
}

.download-card .info-label {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-weight: 700;
    color: var(--primary-700);
    font-size: 0.9375rem;
}

.download-card .info-label svg {
    width: 22px;
    height: 22px;
    color: var(--primary-500);
    stroke-width: 2.5;
}

.download-card .info-value {
    font-weight: 600;
    color: var(--neutral-800);
    font-size: 0.9375rem;
}

/* Premium Download Button */
.btn-premium-download {
    width: 100%;
    padding: var(--space-5);
    background: var(--success);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    transition: all var(--transition-base);
    border: none;
    cursor: pointer;
    margin-bottom: var(--space-6);
}

.btn-premium-download:hover {
    background: #059669;
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(16, 185, 129, 0.4);
}

.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-600);
    padding: var(--space-3);
    background: var(--neutral-100);
    border-radius: var(--radius-lg);
    width: 100%;
}

.secure-badge svg {
    color: var(--success);
    width: 16px;
    height: 16px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .download-card h2 {
        font-size: 2.25rem;
    }

    .glass-panel {
        padding: var(--space-6);
    }

    .step-item {
        gap: var(--space-4);
    }
}