/* Modern Health & Wellness Portal - Sovann Health (សុខភាពយើង) */
@import url('https://fonts.googleapis.com/css2?family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --font-khmer: 'Kantumruy Pro', sans-serif;
    --font-en: 'Outfit', sans-serif;

    /* Light Mode Palette */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.82);
    --border-color: #e2e8f0;
    --border-glass: rgba(226, 232, 240, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Brand Theme Colors */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --primary-gradient: linear-gradient(135deg, #0d9488 0%, #0284c7 100%);
    
    --secondary: #0284c7;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #8b5cf6;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 14px -2px rgba(13, 148, 136, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 25px rgba(13, 148, 136, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-full: 9999px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-body: #0b1120;
    --bg-surface: #131c31;
    --bg-surface-glass: rgba(19, 28, 49, 0.85);
    --border-color: #1e293b;
    --border-glass: rgba(30, 41, 59, 0.7);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --primary-light: rgba(13, 148, 136, 0.2);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 30px -5px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-khmer);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography Helpers */
.en-font {
    font-family: var(--font-en);
}

.text-primary-color {
    color: var(--primary);
}

.text-secondary-color {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

/* Container */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Glass Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-glass);
    transition: var(--transition);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
    animation: heartPulse 2.5s infinite;
}

@keyframes heartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-en);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.nav-link {
    padding: 8px 16px;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-emergency {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-emergency:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    padding: 3.5rem 0 2.5rem;
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 2.5rem;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 1.25rem;
}

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

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 560px;
}

.hero-search-box {
    background: var(--bg-surface);
    border: 2px solid var(--border-color);
    padding: 6px 8px 6px 18px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    max-width: 520px;
}

.hero-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.hero-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-khmer);
    font-size: 0.95rem;
    color: var(--text-primary);
    width: 100%;
}

.hero-search-box button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-family: var(--font-khmer);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.hero-search-box button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.hero-media {
    position: relative;
}

.hero-img-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-glass);
}

.hero-img-wrapper img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.hero-img-wrapper:hover img {
    transform: scale(1.03);
}

.floating-stat-card {
    position: absolute;
    bottom: -18px;
    left: -18px;
    background: var(--bg-surface-glass);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 14px;
}

.floating-stat-card .icon-box {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #dcfce7;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-family: var(--font-khmer);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
}

.btn-primary:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-primary);
}

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

/* Daily Tip Highlight Banner */
.daily-tip-card {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(2, 132, 199, 0.08));
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin: 2rem 0 3.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.daily-tip-content {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tip-bulb-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* Category Pills Filter */
.categories-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 2rem;
    scrollbar-width: thin;
}

.category-pill {
    padding: 9px 20px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.category-pill:hover, .category-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

/* Article Cards Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 3.5rem;
}

.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(13, 148, 136, 0.3);
}

.article-thumb {
    position: relative;
    height: 210px;
    overflow: hidden;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-thumb img {
    transform: scale(1.06);
}

.article-category-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.75);
    color: white;
    backdrop-filter: blur(8px);
}

.article-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.article-title a:hover {
    color: var(--primary);
}

.article-summary {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Interactive Tools Showcase Section */
.tools-section {
    padding: 4rem 0;
    background: linear-gradient(180deg, transparent, rgba(13, 148, 136, 0.04));
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 3rem;
}

.section-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 10px;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.tool-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* Calculator Forms */
.calc-group {
    margin-bottom: 1.25rem;
}

.calc-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.calc-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: var(--bg-body);
    font-family: var(--font-en);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.calc-input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.calc-result-box {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    text-align: center;
    display: none;
}

.calc-result-box.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.calc-val {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: var(--font-en);
}

.calc-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    margin: 8px 0;
}

/* Symptom Checker Wizard */
.symptom-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

.symptom-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 1.5rem 0;
}

.symptom-tag-item {
    cursor: pointer;
    user-select: none;
}

.symptom-tag-item input {
    display: none;
}

.symptom-tag-pill {
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--border-color);
    background: var(--bg-body);
    font-size: 0.92rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.symptom-tag-item input:checked + .symptom-tag-pill {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* Emergency Hotlines Cards */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.emergency-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

.emergency-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.emergency-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.emergency-card h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.emergency-phone {
    font-family: var(--font-en);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--danger);
    display: block;
    margin-bottom: 2px;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.disclaimer-card {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Modal Search */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalSlide 0.25s ease;
}

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

.modal-search-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
}

.modal-search-input {
    border: none;
    background: transparent;
    font-family: var(--font-khmer);
    font-size: 1.1rem;
    color: var(--text-primary);
    width: 100%;
    outline: none;
}

.modal-search-results {
    max-height: 380px;
    overflow-y: auto;
    padding: 1rem 1.5rem;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-desc {
        margin: 0 auto 2rem;
    }
    .hero-search-box {
        margin: 0 auto;
    }
    .floating-stat-card {
        bottom: 10px;
        left: 10px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 76px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .nav-menu.show {
        display: flex;
    }
    .mobile-toggle {
        display: block;
    }
    .hero-title {
        font-size: 2rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .daily-tip-card {
        flex-direction: column;
        align-items: flex-start;
    }
}
