/* ============================================================
   MAMACARE — Styles
   ============================================================
   Patient-facing companion app for mamaTrack
   Theme: Rose Pink with Glassmorphism
   ============================================================ */

/* =========================
   CSS Variables
   ========================= */
:root {
    /* Primary Rose Pink */
    --pink: #E91E63;
    --pink-light: #F48FB1;
    --pink-lighter: #FCE4EC;
    --pink-dark: #C2185B;
    --pink-gradient: linear-gradient(135deg, #F8BBD9 0%, #F48FB1 50%, #E91E63 100%);
    
    /* Glass colors */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(233, 30, 99, 0.15);
    
    /* Accent Gold */
    --gold: #FFB300;
    --gold-light: #FFE082;
    --gold-lighter: #FFF8E1;
    
    /* Teal */
    --teal: #00ACC1;
    --teal-light: #4DD0E1;
    --teal-lighter: #E0F7FA;
    
    /* Neutrals */
    --white: #FFFFFF;
    --off-white: #FAFAFA;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Semantic */
    --success: #059669;
    --success-bg: #ECFDF5;
    --warning: #D97706;
    --warning-bg: #FFFBEB;
    --danger: #DC2626;
    --danger-bg: #FEF2F2;
    --info: var(--teal);
    --info-bg: var(--teal-lighter);
    
    /* WhatsApp */
    --whatsapp: #25D366;
    --whatsapp-dark: #128C7E;
    
    /* Legacy plum aliases for compatibility */
    --plum: var(--pink);
    --plum-light: var(--pink-light);
    --plum-lighter: var(--pink-lighter);
    --plum-dark: var(--pink-dark);
    
    /* Layout */
    --nav-height: 64px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    
    /* Typography */
    --font-sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(233, 30, 99, 0.1);
    --shadow-lg: 0 8px 24px rgba(233, 30, 99, 0.15);
    
    /* Radius */
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================
   Reset & Base
   ========================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #FFF0F5 0%, #FFE4EC 25%, #FCE4EC 50%, #F8BBD9 100%);
    background-attachment: fixed;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100dvh;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--safe-top);
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(244, 143, 177, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(233, 30, 99, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 179, 0, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

body.loaded {
    transition: background 0.3s ease;
}

body.modal-open {
    overflow: hidden;
}

/* =========================
   Typography
   ========================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    color: var(--pink-dark);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p { margin-bottom: 0.75rem; }
strong { font-weight: 700; }

a {
    color: var(--pink);
    text-decoration: none;
}

/* =========================
   Layout
   ========================= */
.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100dvh;
    min-height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#content {
    padding: 1rem;
    padding-bottom: calc(var(--nav-height) + 2rem);
    min-height: calc(100vh - var(--nav-height));
}

.view {
    animation: fadeIn 0.25s ease;
}

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

/* View Header */
.view-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.view-header h2 {
    margin-bottom: 0.25rem;
}

.view-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* =========================
   Bottom Navigation
   ========================= */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    height: var(--nav-height);
    padding-bottom: var(--safe-bottom);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    box-shadow: 0 -4px 30px rgba(233, 30, 99, 0.1);
}

#bottom-nav.hidden {
    display: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    color: var(--gray-400);
    font-size: 0.7rem;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    flex: 1;
    border-radius: var(--radius);
}

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

.nav-item span {
    font-weight: 600;
}

.nav-item.active {
    color: var(--pink);
    background: var(--pink-lighter);
}

.nav-item:active {
    background: var(--pink-lighter);
    transform: scale(0.95);
}

/* =========================
   Buttons
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg { width: 20px; height: 20px; }

.btn-primary {
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(233, 30, 99, 0.3);
}

.btn-primary:hover, .btn-primary:active {
    background: linear-gradient(135deg, var(--pink-dark) 0%, #AD1457 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.4);
}

.btn-secondary {
    background: rgba(233, 30, 99, 0.1);
    color: var(--pink);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(233, 30, 99, 0.15);
}

.btn-ghost {
    background: transparent;
    color: var(--plum);
    border: 1px solid var(--gray-200);
}

.btn-ghost:hover {
    background: var(--gray-50);
}

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

.btn-danger:hover {
    background: #B91C1C;
}

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

.btn-whatsapp:hover {
    background: var(--whatsapp-dark);
}

.btn-lg {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    width: 100%;
}

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

/* =========================
   Forms — Mobile-First Vertical Layout
   ========================= */
.form-field {
    margin-bottom: 1.25rem;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.06);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--pink);
    background: white;
    box-shadow: 0 0 0 4px var(--pink-lighter), 0 4px 12px rgba(233, 30, 99, 0.12);
    transform: translateY(-1px);
}

.form-field input[readonly] {
    background: var(--gray-50);
    color: var(--gray-500);
}

.form-section {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.form-row {
    margin-bottom: 1.25rem;
}

.form-row.two-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 480px) {
    .form-row.two-col {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

.form-row.two-col .form-field {
    margin-bottom: 0;
}

/* Pill/Chip Selection — Tap-Friendly */
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    min-width: 60px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-500);
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.pill-option:hover {
    border-color: var(--pink-light);
    background: white;
}

.pill-option:active {
    transform: scale(0.96);
}

.pill-option.selected {
    color: white;
    background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
    border-color: var(--pink);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.pill-option input[type="radio"],
.pill-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Toggle Pills (Yes/No) */
.toggle-pills {
    display: flex;
    gap: 0.5rem;
}

.toggle-pills .pill-option {
    flex: 1;
    text-align: center;
}

/* Checkbox Cards */
.checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 14px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.checkbox-item:hover {
    border-color: var(--pink-light);
    background: white;
}

.checkbox-item:active {
    transform: scale(0.98);
}

.checkbox-item.checked,
.checkbox-item:has(input:checked) {
    background: linear-gradient(135deg, var(--pink-lighter) 0%, #FFF0F5 100%);
    border-color: var(--pink);
}

.checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: var(--pink);
    flex-shrink: 0;
}

.checkbox-item span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* Section Labels */
.section-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--pink-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.25rem 0 0.75rem;
    padding-left: 0.25rem;
}

.section-label:first-child {
    margin-top: 0;
}

/* =========================
   Code Entry Screen
   ========================= */
.code-entry-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 2rem);
    padding: 2rem 1rem;
    text-align: center;
}

.code-entry-screen .logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.code-entry-screen h1 {
    font-family: var(--font-display);
    color: var(--plum);
    margin-bottom: 0.5rem;
}

.code-entry-screen .subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.code-input-wrapper {
    width: 100%;
    max-width: 280px;
    margin-bottom: 1.5rem;
}

.code-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.5rem;
    font-family: monospace;
    text-align: center;
    letter-spacing: 0.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    text-transform: uppercase;
}

.code-input:focus {
    outline: none;
    border-color: var(--plum);
    box-shadow: 0 0 0 3px rgba(74, 35, 90, 0.15);
}

.code-hint {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 1rem;
}

/* =========================
   Pairing Screen
   ========================= */
.pairing-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 2rem);
    padding: 2rem 1rem;
    text-align: center;
}

.pairing-screen h1 {
    margin-bottom: 0.5rem;
}

.pairing-screen .subtitle {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.pairing-methods {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pairing-method {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.pairing-method:hover {
    border-color: var(--plum);
    background: var(--plum-lighter);
}

.pairing-method .method-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--plum-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--plum);
}

.pairing-method .method-icon svg {
    width: 24px;
    height: 24px;
}

.pairing-method .method-info {
    flex: 1;
    text-align: left;
}

.pairing-method .method-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.pairing-method .method-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
}

.code-display {
    background: var(--plum-lighter);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin: 1rem 0 2rem;
}

.code-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.code-value {
    font-size: 1.5rem;
    font-family: monospace;
    color: var(--plum);
    font-weight: 700;
    letter-spacing: 0.15em;
}

/* =========================
   Home View - Progress Ring
   ========================= */
.pregnancy-ring-card {
    background: linear-gradient(135deg, var(--plum), var(--plum-light));
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.ring-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.ring-bg {
    stroke: rgba(255,255,255,0.2);
}

.ring-progress {
    stroke: var(--gold);
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-weeks {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.ring-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.ring-info h2 {
    color: var(--white);
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.ring-info .trimester-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.ring-info .edd-label {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 0;
}

/* =========================
   Stats Grid
   ========================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-tile {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.stat-tile:hover {
    border-color: var(--plum-light);
    transform: translateY(-2px);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-icon.bp { background: #FEE2E2; color: #DC2626; }
.stat-icon.weight { background: #E0E7FF; color: #4F46E5; }
.stat-icon.kicks { background: #FCE7F3; color: #DB2777; }

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

/* =========================
   Quick Actions
   ========================= */
.quick-actions {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.quick-actions h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

.action-list {
    display: flex;
    flex-direction: column;
}

.action-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0.5rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.action-item:last-child {
    border-bottom: none;
}

.action-item:hover {
    background: var(--gray-50);
}

.action-item svg:first-child {
    width: 20px;
    height: 20px;
    color: var(--plum);
    margin-right: 0.75rem;
}

.action-item svg:last-child {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

.action-item span {
    flex: 1;
    font-weight: 500;
}

.action-item.highlight {
    background: var(--plum-lighter);
    border-radius: var(--radius);
    border-bottom: none;
}

/* =========================
   Tip Card
   ========================= */
.tip-card {
    background: var(--gold-lighter);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.tip-icon {
    font-size: 1.5rem;
}

.tip-content {
    font-size: 0.9rem;
    color: var(--gray-700);
}

/* =========================
   Log View
   ========================= */
.log-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.log-history h3 {
    color: var(--gray-700);
    font-size: 1rem;
    margin-bottom: 1rem;
}

#log-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
}

.log-entry.warn {
    background: var(--danger-bg);
    border-color: #FCA5A5;
}

.log-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--plum-lighter);
    color: var(--plum);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.log-dot svg {
    width: 16px;
    height: 16px;
}

.log-dot.danger {
    background: #FCA5A5;
    color: #991B1B;
}

.log-content {
    flex: 1;
}

.log-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.log-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

.empty-message {
    text-align: center;
    color: var(--gray-400);
    padding: 2rem 1rem;
    font-size: 0.9rem;
}

/* =========================
   Education View
   ========================= */
.edu-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.pill {
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.pill:hover {
    border-color: var(--plum);
}

.pill.active {
    background: var(--plum);
    color: var(--white);
    border-color: var(--plum);
}

.edu-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edu-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    cursor: pointer;
}

.edu-card-header {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.edu-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.edu-info {
    flex: 1;
}

.edu-info h3 {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--gray-800);
}

.edu-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

.edu-tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.edu-tag {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.edu-tag.current {
    background: var(--gold-lighter);
    color: var(--gold);
}

.edu-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1rem;
    border-top: 0 solid var(--gray-100);
}

.edu-body.open {
    max-height: 500px;
    padding: 1rem;
    border-top: 1px solid var(--gray-100);
}

.edu-body p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.edu-body ul, .edu-body ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.edu-body li {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
}

/* =========================
   Message View
   ========================= */
.midwife-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.message-compose {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.wa-preview {
    background: #DCF8C6;
    border-radius: var(--radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.wa-preview-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #128C7E;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.wa-preview-label svg {
    width: 14px;
    height: 14px;
}

.wa-preview-bubble {
    font-size: 0.9rem;
    color: var(--gray-800);
    white-space: pre-wrap;
}

.message-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.quick-messages {
    margin-bottom: 1.5rem;
}

.quick-messages h3 {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.quick-msg-list {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.quick-msg-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.quick-msg-item:last-child {
    border-bottom: none;
}

.quick-msg-item:hover {
    background: var(--gray-50);
}

.quick-msg-item svg:first-child {
    width: 20px;
    height: 20px;
    color: var(--plum);
    margin-right: 0.75rem;
}

.quick-msg-item span {
    flex: 1;
    font-weight: 500;
}

.quick-msg-item svg:last-child {
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

/* Audio Recorder */
.audio-section {
    margin-bottom: 1.5rem;
}

.audio-section h3 {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.audio-recorder {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.audio-pulse {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--plum);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.audio-pulse svg {
    width: 28px;
    height: 28px;
}

.audio-pulse:hover {
    transform: scale(1.05);
}

.audio-pulse.recording {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(220, 38, 38, 0); }
}

.audio-info {
    flex: 1;
}

#timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--gray-800);
}

#rec-status {
    font-size: 0.8rem;
    color: var(--gray-500);
}

#audio-playback {
    margin-top: 1rem;
}

#audio-player {
    width: 100%;
}

#audio-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

#audio-actions .btn {
    flex: 1;
}

.emergency-call {
    margin-top: 1rem;
}

/* =========================
   Notes View
   ========================= */
.import-note {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.note-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem;
    border-left: 4px solid var(--gray-300);
    box-shadow: var(--shadow-sm);
}

.note-card.midwife {
    border-left-color: var(--plum);
    background: var(--plum-lighter);
}

.note-card.patient {
    border-left-color: var(--teal);
}

.note-card.system {
    border-left-color: var(--gold);
}

.note-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.note-header svg {
    width: 16px;
    height: 16px;
}

.note-body {
    font-size: 0.9rem;
    color: var(--gray-800);
}

.note-date {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
}

/* =========================
   Danger Signs View
   ========================= */
.danger-header {
    background: var(--danger-bg);
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.danger-header h2 {
    color: var(--danger);
}

.danger-signs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sign-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.sign-item:hover {
    border-color: var(--plum-light);
}

.sign-item.selected {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.sign-item svg:first-child {
    width: 24px;
    height: 24px;
    color: var(--danger);
}

.sign-info {
    flex: 1;
}

.sign-label {
    font-weight: 600;
    color: var(--gray-800);
}

.sign-detail {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.sign-check {
    width: 20px;
    height: 20px;
    color: var(--gray-300);
}

.sign-item.selected .sign-check {
    color: var(--danger);
}

.danger-action {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-card {
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
}

.result-card.safe {
    background: var(--success-bg);
}

.result-card.safe svg {
    width: 48px;
    height: 48px;
    color: var(--success);
    margin-bottom: 0.5rem;
}

.result-card.safe h4 {
    color: var(--success);
}

.result-card.danger {
    background: var(--danger-bg);
}

.result-card.danger h4 {
    color: var(--danger);
}

/* =========================
   Modal
   ========================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-close svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.modal-body {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.modal-footer .btn {
    flex: 1;
}

/* QR Scanner Modal */
.qr-scanner-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.qr-scanner-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-viewfinder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid var(--white);
    border-radius: var(--radius);
}

/* =========================
   Toast
   ========================= */
#toast-container {
    position: fixed;
    bottom: calc(var(--nav-height) + 1rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#toast-container.show {
    opacity: 1;
}

.toast {
    background: var(--gray-800);
    color: var(--white);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
}

/* =========================
   Loading
   ========================= */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1200;
}

#loading.show {
    display: flex;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--plum);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loading-text {
    color: var(--gray-600);
    font-size: 0.9rem;
}

/* =========================
   Offline Banner
   ========================= */
body.offline::before {
    content: '📴 You are offline';
    position: fixed;
    top: var(--safe-top);
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1000;
}

/* =========================
   Settings Specifics
   ========================= */
.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.reset-warning {
    background: var(--danger-bg);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 2rem;
}

.reset-warning h4 {
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.reset-warning p {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

/* =========================
   Utility Classes
   ========================= */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* =========================
   Responsive
   ========================= */
@media (min-width: 640px) {
    #content {
        padding: 1.5rem;
    }
    
    .pregnancy-ring-card {
        padding: 2rem;
    }
    
    .modal {
        border-radius: var(--radius-lg);
        margin: 2rem;
        max-height: calc(100vh - 4rem);
    }
    
    .modal-overlay {
        align-items: center;
    }
}
