/* ============================================
   PARAMIND - Main Stylesheet
   Mobile-First Design with Bottom Navigation
   ============================================ */

/* -------------------- 
   CSS Variables 
   -------------------- */
:root {
    /* Brand Colors - from logo */
    --color-teal: #2B8A9C;
    --color-teal-dark: #237282;
    --color-teal-light: #3DA4B8;
    --color-green: #5CB85C;
    --color-green-dark: #4A9A4A;
    --color-green-light: #72C772;
    
    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-gray-50: #F8F9FA;
    --color-gray-100: #F1F3F5;
    --color-gray-200: #E9ECEF;
    --color-gray-300: #DEE2E6;
    --color-gray-400: #CED4DA;
    --color-gray-500: #ADB5BD;
    --color-gray-600: #6C757D;
    --color-gray-700: #495057;
    --color-gray-800: #343A40;
    --color-gray-900: #212529;
    
    /* Semantic Colors */
    --color-success: var(--color-green);
    --color-warning: #FFC107;
    --color-danger: #DC3545;
    --color-info: var(--color-teal);
    
    /* Typography */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-secondary: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 64px;
    --sidebar-width: 220px;
}

/* -------------------- 
   Base Styles 
   -------------------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* -------------------- 
   Typography 
   -------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-gray-900);
}

/* -------------------- 
   Brand Text 
   -------------------- */
.brand-text {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
}

.brand-para {
    color: var(--color-teal);
}

.brand-mind {
    color: var(--color-green);
}

.navbar-brand .brand-text {
    font-size: 1.5rem;
}

/* -------------------- 
   Buttons 
   -------------------- */
.btn {
    font-family: var(--font-primary);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    transition: all var(--transition-base);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-dark) 100%);
    border: none;
    color: var(--color-white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-teal-light) 0%, var(--color-teal) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border-color: var(--color-teal);
    color: var(--color-teal);
}

.btn-outline-primary:hover {
    background-color: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-white);
}

.btn-outline-secondary {
    border-color: var(--color-gray-300);
    color: var(--color-gray-700);
}

.btn-outline-secondary:hover {
    background-color: var(--color-gray-100);
    border-color: var(--color-gray-400);
    color: var(--color-gray-800);
}

/* -------------------- 
   Form Controls 
   -------------------- */
.form-control,
.form-select {
    font-family: var(--font-primary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-300);
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(43, 138, 156, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
}

/* -------------------- 
   Navigation 
   -------------------- */
.navbar {
    padding: 1rem 0;
    transition: all var(--transition-base);
}

.navbar.fixed-top {
    background-color: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(10px);
}

.nav-link {
    font-weight: 500;
    color: var(--color-gray-700);
    padding: 0.5rem 1rem;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-teal);
}

/* -------------------- 
   Hero Section 
   -------------------- */
.hero-section {
    background: linear-gradient(180deg, var(--color-gray-50) 0%, var(--color-white) 100%);
    padding-top: 90px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%);
    color: var(--color-teal);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-green) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-gray-600);
    max-width: 540px;
    margin-bottom: 2rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Chat Preview Animation */
.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-preview {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.chat-preview-header {
    background: var(--color-gray-100);
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.chat-preview-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-gray-300);
}

.chat-preview-dot:nth-child(1) { background: #FF5F57; }
.chat-preview-dot:nth-child(2) { background: #FFBD2E; }
.chat-preview-dot:nth-child(3) { background: #28CA41; }

.chat-preview-body {
    padding: 1.5rem;
}

.chat-preview-message {
    padding: 1rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.chat-preview-message:nth-child(1) { animation-delay: 0.3s; }
.chat-preview-message:nth-child(2) { animation-delay: 0.8s; }

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

.chat-preview-message.user {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-dark) 100%);
    color: var(--color-white);
    margin-left: 2rem;
}

.chat-preview-message.assistant {
    background: var(--color-gray-100);
    color: var(--color-gray-800);
    margin-right: 2rem;
}

/* -------------------- 
   Features Section 
   -------------------- */
.features-section {
    background: var(--color-white);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--color-gray-600);
    font-size: 1.1rem;
}

.feature-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--color-teal);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--color-teal);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--color-gray-600);
    margin-bottom: 0;
}

/* -------------------- 
   Pricing Section 
   -------------------- */
.pricing-section {
    background: var(--color-gray-50);
}

.pricing-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    height: 100%;
    position: relative;
    transition: all var(--transition-base);
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border: 2px solid var(--color-teal);
    transform: scale(1.02);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-green) 100%);
    color: var(--color-white);
    padding: 0.25rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.pricing-header h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.pricing-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.pricing-amount .price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-gray-900);
}

.pricing-amount .period {
    color: var(--color-gray-600);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.pricing-features li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-gray-100);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* -------------------- 
   Disclaimer Section 
   -------------------- */
.disclaimer-section {
    background: var(--color-gray-50);
}

.disclaimer-box {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-left: 4px solid var(--color-warning);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

/* -------------------- 
   Footer 
   -------------------- */
.footer {
    background: var(--color-gray-900);
    color: var(--color-gray-400);
}

.footer .brand-text {
    font-size: 1.25rem;
}

.footer-link {
    color: var(--color-gray-400);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--color-white);
}

/* -------------------- 
   Auth Pages 
   -------------------- */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(180deg, var(--color-gray-50) 0%, var(--color-white) 100%);
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

.auth-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--color-gray-600);
}

.auth-form .form-control {
    padding: 0.875rem 1rem;
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-gray-500);
    cursor: pointer;
    padding: 0;
}

.password-toggle:hover {
    color: var(--color-gray-700);
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--color-teal);
    text-decoration: none;
}

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

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-gray-200);
}

.auth-footer p {
    margin: 0;
    color: var(--color-gray-600);
}

.auth-footer a {
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
}

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

.auth-disclaimer {
    text-align: center;
}

/* ============================================
   CHAT PAGE - MOBILE FIRST LAYOUT
   ============================================ */

.chat-page {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-gray-50);
}

/* Top Navigation */
.chat-navbar {
    height: var(--header-height);
    min-height: var(--header-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 100;
}

.chat-navbar .brand-text {
    font-size: 1.25rem;
}

.trust-badge {
    background: var(--color-gray-100);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-teal);
}

/* Message Limit Banner */
.message-limit-banner {
    background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%);
    border-bottom: 1px solid var(--color-gray-200);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.message-limit-banner .count {
    font-weight: 600;
    color: var(--color-teal);
}

.message-limit-banner .upgrade-link {
    color: var(--color-teal);
    font-weight: 600;
    text-decoration: none;
}

.message-limit-banner .upgrade-link:hover {
    text-decoration: underline;
}

/* Main Content Area */
.chat-main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

/* Content Views */
.content-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.content-view.active {
    display: flex;
}

/* -------------------- 
   Chat View 
   -------------------- */
#chatView {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#chatView.active {
    display: flex;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    max-width: 600px;
    margin: auto;
    padding: 1.5rem 1rem;
}

.welcome-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.welcome-icon i {
    font-size: 2rem;
    color: var(--color-teal);
}

.welcome-message h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.welcome-message p {
    color: var(--color-gray-600);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.welcome-disclaimer {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    color: var(--color-gray-700);
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.quick-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-prompt-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--color-gray-700);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.quick-prompt-btn:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
    background: var(--color-gray-50);
}

.quick-prompt-btn i {
    color: var(--color-teal);
    font-size: 1.1rem;
}

/* Chat Messages */
.message {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease;
}

.message.user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.message.user .message-avatar {
    background: var(--color-gray-200);
    color: var(--color-gray-600);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-green) 100%);
    color: var(--color-white);
}

.message-content {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    line-height: 1.5;
    font-size: 0.95rem;
    overflow: hidden;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-dark) 100%);
    color: var(--color-white);
    border-bottom-right-radius: var(--radius-sm);
}

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

/* Chat Input */
.chat-input-container {
    padding: 0.75rem 1rem;
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    flex-shrink: 0;
}

.chat-input-wrapper .input-group {
    background: var(--color-gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-gray-200);
    overflow: hidden;
}

.chat-input-wrapper textarea {
    border: none;
    background: transparent;
    resize: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    max-height: 120px;
}

.chat-input-wrapper textarea:focus {
    box-shadow: none;
    outline: none;
}

.chat-input-wrapper .btn {
    border-radius: 0;
    padding: 0.75rem 1rem;
    border: none;
}

.input-disclaimer {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    color: var(--color-gray-500);
    font-size: 0.7rem;
}

/* Loading Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--color-gray-400);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* -------------------- 
   Section Views 
   -------------------- */
.section-view {
    flex: 1;
    overflow-y: auto;
    background: var(--color-gray-50);
}

.section-header {
    background: var(--color-white);
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--color-gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.section-header h1 {
    font-size: 1.25rem;
    margin: 0 0 0.25rem 0;
}

.section-header p {
    font-size: 0.875rem;
    color: var(--color-gray-600);
    margin: 0;
}

.section-content {
    padding: 1rem;
}

/* Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.category-card {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

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

.category-card .icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
}

.category-card .icon i {
    font-size: 1.5rem;
    color: var(--color-teal);
}

.category-card h3 {
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.category-card .count {
    font-size: 0.75rem;
    color: var(--color-gray-500);
}

/* Subcategory List */
.subcategory-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subcategory-item {
    background: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    color: inherit;
}

.subcategory-item:hover {
    border-color: var(--color-teal);
    background: var(--color-gray-50);
}

.subcategory-item .info {
    flex: 1;
}

.subcategory-item h4 {
    font-size: 0.95rem;
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.subcategory-item p {
    font-size: 0.8rem;
    color: var(--color-gray-600);
    margin: 0;
}

.subcategory-item .arrow {
    color: var(--color-gray-400);
    font-size: 1.25rem;
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-teal);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.back-btn:hover {
    color: var(--color-teal-dark);
}

/* Your Patient Form */
.patient-form {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
}

.patient-form .form-group {
    margin-bottom: 1rem;
}

.patient-form label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
    display: block;
}

.patient-form .form-control,
.patient-form .form-select {
    font-size: 0.95rem;
}

.vital-signs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.vital-input {
    background: var(--color-gray-50);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.vital-input label {
    font-size: 0.75rem;
    color: var(--color-gray-600);
    margin-bottom: 0.25rem;
}

.vital-input input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gray-800);
    padding: 0;
}

.vital-input input:focus {
    outline: none;
}

.vital-input input::placeholder {
    color: var(--color-gray-400);
    font-weight: 400;
}

/* -------------------- 
   Bottom Navigation Bar (Mobile)
   -------------------- */
.bottom-nav {
    height: var(--bottom-nav-height);
    min-height: var(--bottom-nav-height);
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.5rem;
    padding-bottom: env(safe-area-inset-bottom);
    flex-shrink: 0;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: var(--color-gray-500);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: none;
    border: none;
    gap: 0.25rem;
}

.nav-item i {
    font-size: 1.35rem;
    transition: transform var(--transition-fast);
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-item:hover {
    color: var(--color-teal);
}

.nav-item.active {
    color: var(--color-teal);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Pro Badge */
.pro-badge {
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-green) 100%);
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

/* Alerts in Chat */
.chat-messages .alert {
    max-width: 90%;
    margin: 1rem auto;
}

/* Modal */
.modal-content {
    border-radius: var(--radius-xl);
}

.modal-header {
    border-bottom: 1px solid var(--color-gray-200);
}

.modal-footer {
    border-top: 1px solid var(--color-gray-200);
}

/* Utilities */
.text-teal {
    color: var(--color-teal) !important;
}

.bg-teal-light {
    background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%) !important;
}

/* ============================================
   DESKTOP/TABLET RESPONSIVE (768px+)
   ============================================ */
@media (min-width: 768px) {
    /* Wrap everything below header in a flex row */
    .chat-page {
        display: grid;
        grid-template-rows: auto auto 1fr;
        grid-template-columns: var(--sidebar-width) 1fr;
        grid-template-areas:
            "header header"
            "banner banner"
            "sidebar main";
    }
    
    .chat-navbar {
        grid-area: header;
    }
    
    .message-limit-banner {
        grid-area: banner;
    }
    
    /* Sidebar Navigation */
    .bottom-nav {
        grid-area: sidebar;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 1rem;
        gap: 0.5rem;
        border-top: none;
        border-right: 1px solid var(--color-gray-200);
        background: var(--color-white);
    }
    
    .nav-item-wrapper {
        flex: none;
    }
    
    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 0.875rem 1rem;
        border-radius: var(--radius-md);
        gap: 0.75rem;
    }
    
    .nav-item i {
        font-size: 1.25rem;
    }
    
    .nav-item span {
        font-size: 0.875rem;
        text-transform: none;
        letter-spacing: 0;
    }
    
    .nav-item:hover {
        background: var(--color-gray-50);
    }
    
    .nav-item.active {
        background: linear-gradient(135deg, rgba(43, 138, 156, 0.1) 0%, rgba(92, 184, 92, 0.1) 100%);
    }
    
    /* Main content area */
    .chat-main-container {
        grid-area: main;
        overflow: hidden;
    }
    
    /* Wider messages on desktop */
    .message {
        max-width: 70%;
    }
    
    .chat-messages {
        padding: 1.5rem 2rem;
    }
    
    .welcome-message {
        padding: 3rem 2rem;
    }
    
    .quick-prompts {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .quick-prompt-btn {
        flex: 0 0 auto;
    }
    
    /* Better grid on larger screens */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
    
    .section-content {
        padding: 1.5rem 2rem;
        max-width: 1000px;
        margin: 0 auto;
    }
    
    .section-header {
        padding: 1.5rem 2rem;
    }
    
    .section-header h1 {
        font-size: 1.5rem;
    }
    
    /* Vital signs 4 columns on desktop */
    .vital-signs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .patient-form {
        max-width: 700px;
        margin: 0 auto;
        padding: 2rem;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chat-messages {
        padding: 2rem 3rem;
    }
}

/* -------------------- 
   Landing Page Mobile
   -------------------- */
@media (max-width: 991.98px) {
    .hero-section {
        text-align: center;
    }
    
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-trust-badges {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 767.98px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .pricing-card.featured {
        transform: none;
    }
}

/* Hint Button Styling */
.hint-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-color: #ffc107;
    color: #ffc107;
    transition: all 0.2s ease;
}

.hint-btn:hover {
    background-color: #ffc107;
    color: #1a1a2e;
    border-color: #ffc107;
}

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

/* Make the toolbar wrap nicely on mobile */
.assessment-toolbar .d-flex {
    justify-content: center;
}

@media (max-width: 400px) {
    .assessment-toolbar .d-flex {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .hint-btn, .assessment-btn {
        width: 100%;
    }
}

/* ============================================
   STREAMING RESPONSE STYLES
   Add this to your existing CSS file
   ============================================ */

/* Streaming cursor animation */
.streaming-cursor {
    display: inline;
    animation: blink 0.7s infinite;
    color: #2b8a9c;
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Ensure streaming text displays properly */
.streaming-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Smooth transition for message content */
.message-content {
    transition: none; /* Remove any transition to make streaming smooth */
}

/* ============================================
   FIX FOR ORPHAN <li> ELEMENTS IN CHAT
   (li tags not wrapped in ul/ol)
   ============================================ */
.message-content > li {
    display: list-item;
    list-style-type: disc;
    list-style-position: inside;
    margin-left: 1rem;
    padding-left: 0.25rem;
}

/* Also fix any properly wrapped lists just in case */
.message-content ul,
.message-content ol {
    margin-left: 1.5rem;
    padding-left: 0.5rem;
}

.message-content li {
    margin-bottom: 0.3rem;
} 

/* -------------------- 
   Compact Navigation Fix
   -------------------- */
.navbar {
    padding: 0.25rem 0 !important;  /* Much smaller padding */
}

.navbar .container {
    flex-wrap: nowrap;
}

/* Spread the nav links across available space */
.navbar-nav {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.navbar-nav .nav-link {
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
    font-size: 0.9rem;
}

.navbar-brand .brand-text {
    font-size: 1.25rem;
}

/* Make the "Get Started" button smaller and prevent text wrapping */
.navbar-nav .btn {
    padding: 0.4rem 0.875rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Ensure proper collapse on mobile */
@media (max-width: 991.98px) {
    .navbar-nav {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 0;
    }
}

/* Chat Toolbar with New Chat button */
.chat-toolbar {
    display: none;
    padding: 0.5rem 1rem;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    justify-content: flex-start;
}

.chat-toolbar.visible {
    display: flex;
}

.chat-toolbar .btn {
    font-size: 0.8rem;
    border-radius: 50px;
    padding: 0.4rem 1rem;
    background: linear-gradient(135deg, #2B8A9C 0%, #5CB85C 100%);
    color: white;
    border: none;
}

.chat-toolbar .btn:hover {
    opacity: 0.9;
    color: white;
}

/* Difficulty selector styles */
.difficulty-selector .btn-check:checked + .btn-outline-success {
    background-color: #28a745;
    color: white;
}
.difficulty-selector .btn-check:checked + .btn-outline-warning {
    background-color: #ffc107;
    color: #212529;
}
.difficulty-selector .btn-check:checked + .btn-outline-danger {
    background-color: #dc3545;
    color: white;
}