:root {
    --primary: #EF4444;
    --primary-light: #FEE2E2;
    --secondary: #3B82F6;
    --secondary-light: #DBEAFE;
    --success: #10B981;
    --warning: #F59E0B;
    --bg-gray: #F3F4F6;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card-shadow {
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}

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

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

/* Auth Styling Enhancements */
.auth-form input::placeholder {
    color: #9CA3AF;
    font-weight: 400;
}

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

/* Utility for dynamic content injection */
#app-root {
    transition: opacity 0.3s ease;
}

.loading-dots:after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px;
}

header {
    background: var(--surface);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand img {
    height: 32px;
}

main {
    padding: 20px;
    flex: 1;
}

/* Auth Page */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: 0 20px;
}

.header-logo {
    height: 42px;
    width: 42px;
    margin-right: 14px;
}

.auth-logo {
    width: 140px;
    height: 140px;
    margin-bottom: 24px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.auth-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
    text-transform: uppercase;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.auth-form {
    width: 100%;
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--text);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #FAFAFA;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.btn-primary:active {
    background: var(--primary-dark);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 24px;
    border-top: 1px solid var(--border);
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* Animations */
.animate-fade {
    animation: fadeIn 0.4s ease forwards;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}

.stat-value {
    font-weight: 700;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.menu-item {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.menu-item svg {
    color: var(--primary);
}

/* --- Knowledge Base Premium Styles --- */
.knowledge-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.knowledge-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Icon Container Gradients */
.icon-heart { background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%); }
.icon-brain { background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%); }
.icon-pill { background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%); }
.icon-food { background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%); }
.icon-chart { background: linear-gradient(135deg, #E0E7FF 0%, #C7D2FE 100%); }
.icon-scan { background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%); }
.icon-emergency { background: linear-gradient(135deg, #FEE2E2 0%, #FCA5A5 100%); }
.icon-faq { background: linear-gradient(135deg, #CFFAFE 0%, #A5F3FC 100%); }

.icon-glow {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Animated border on hover */
.card-border-animate {
    position: relative;
    overflow: hidden;
}

.card-border-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.card-border-animate:hover::before {
    left: 100%;
}

/* --- Data Input Styles --- */
.input-field {
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.input-field:focus-within {
    border-color: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.input-field input {
    background: transparent;
    border: none;
    outline: none;
}

.btn-gradient {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
}

.btn-gradient:hover {
    box-shadow: 0 15px 30px -5px rgba(239, 68, 68, 0.5);
    transform: translateY(-2px);
}

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

.status-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.pulse-animation {
    animation: pulse-glow 2s ease-in-out infinite;
}

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

.btn-gradient {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}
