:root {
    --primary: #27ae60;
    --dark: #2c3e50;
    --bg: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 25px rgba(0,0,0,0.06);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #e0e0e0;
    margin: 0;
    display: flex;
    justify-content: center;
    color: var(--dark);
}

.app-container {
    width: 100%;
    max-width: 450px;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    padding-bottom: 90px;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
}

/* HEADER */
.main-header {
    background: var(--white);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #eee;
}
.logo-area { display: flex; align-items: center; gap: 12px; }
.logo-box { width: 40px; height: 40px; background: #e8f5e9; color: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px;}
.main-header h1 { font-size: 18px; margin: 0; font-weight: 800; color: #2d3436; }
.main-header p { font-size: 11px; margin: 0; color: #636e72; }
.user-avatar i { font-size: 32px; color: #dfe6e9; }

/* SECTIONS & ANIMATION */
.page-section { display: none; padding: 20px; animation: slideUp 0.4s ease; }
.page-section.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* HERO */
.hero-banner {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(39, 174, 96, 0.2);
}

.hero-text {
    position: relative;
    z-index: 2;
}

.hero-banner h2 { margin: 0 0 5px 0; font-size: 22px; }
.hero-banner p { margin: 0; font-size: 13px; opacity: 0.9; }

.hero-silhouette {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: auto;
    opacity: 0.8;
    z-index: 1;
    pointer-events: none;
    /* filter: brightness(0) invert(1); */
}

/* MENU UTAMA */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}
.menu-item {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.1s;
    border: 1px solid white;
}
.menu-item:active { transform: scale(0.97); }
.icon-box {
    width: 60px; height: 60px; border-radius: 50%;
    margin: 0 auto 10px auto; display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: white;
}
.bg-blue { background: #3498db; } .bg-orange { background: #f39c12; }
.menu-item span { font-weight: 600; font-size: 14px; color: #555; }

/* KATEGORI SCROLL */
.category-section { margin-bottom: 25px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-title-row h3 { margin: 0; font-size: 15px; color: #2d3436; font-weight: 700; }
.link-view { font-size: 12px; color: #27ae60; cursor: pointer; }

.horizontal-scroll-container {
    display: flex; overflow-x: auto; gap: 15px; padding-bottom: 10px;
    scrollbar-width: none;
}
.horizontal-scroll-container::-webkit-scrollbar { display: none; }

.news-card {
    min-width: 200px; max-width: 200px;
    background: white; padding: 15px; border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); cursor: pointer; transition: 0.2s; border: 1px solid #f0f0f0;
}
.news-card:active { transform: scale(0.95); }

.news-badge {
    display: inline-block; padding: 4px 10px; border-radius: 20px;
    font-size: 10px; font-weight: 700; color: white; margin-bottom: 8px;
}
.news-badge.blue { background: #3498db; }
.news-badge.red { background: #e74c3c; }
.news-badge.green { background: #27ae60; }
.news-badge.orange { background: #e67e22; }
.news-badge.purple { background: #9b59b6; }

.news-card h4 { margin: 0 0 5px 0; font-size: 14px; line-height: 1.4; color: #2d3436; font-weight: 700; }
.news-card p { margin: 0; font-size: 11px; color: #95a5a6; line-height: 1.4; }

/* INPUT FORM */
.card { background: white; padding: 25px; border-radius: 20px; box-shadow: var(--shadow); }
.input-group.hidden { display: none; }
input, select {
    width: 100%; padding: 15px; margin: 8px 0 20px 0;
    border: 2px solid #f1f2f6; border-radius: 12px;
    font-size: 16px; outline: none; transition: 0.3s;
    background: #fdfdfd; box-sizing: border-box; font-family: 'Inter', sans-serif;
}
input:focus, select:focus { border-color: var(--primary); background: white; }
.row { display: flex; gap: 15px; } .col { flex: 1; }
label { font-size: 12px; font-weight: 700; color: #636e72; text-transform: uppercase; }

.btn-analyze {
    width: 100%; background: var(--primary); color: white; border: none;
    padding: 18px; border-radius: 14px; font-size: 16px; font-weight: 700;
    cursor: pointer; box-shadow: 0 8px 20px rgba(39, 174, 96, 0.3); transition: 0.2s;
}

/* TAMBAHKAN INI DI BAGIAN HISTORY CARD */
.history-card {
    /* Style lama tetap ada, tambah ini: */
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    position: relative; /* Untuk efek klik */
}

.history-card:active {
    transform: scale(0.98); /* Efek membal saat ditekan */
    background: #fdfdfd;
}

/* Biar user tau ini bisa diklik, kasih ikon kecil di pojok kanan */
.history-card::after {
    content: '\f054'; /* Kode icon panah kanan FontAwesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #dfe6e9;
    font-size: 14px;
}

/* HISTORY & NAV (Sama) */
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-clear { background: #ffebee; color: #c62828; border: none; padding: 8px 15px; border-radius: 20px; font-weight: 600; cursor: pointer; font-size: 12px;}
.history-card {
    background: white; padding: 18px; border-radius: 14px; margin-bottom: 15px;
    box-shadow: var(--shadow); border-left: 6px solid #ddd;
}
.h-date { font-size: 10px; color: #b2bec3; font-weight: 700; letter-spacing: 1px; display: block; margin-bottom: 5px; }
.h-title { font-size: 16px; font-weight: 800; color: #2d3436; margin-bottom: 4px; }
.h-status { font-size: 13px; font-weight: 600; }

/* FILTER BOX STYLE */
.filter-box {
    margin-bottom: 15px;
}

.filter-box select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background-color: white;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    outline: none;
    transition: 0.3s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232c3e50%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 15px top 50%;
    background-size: 10px auto;
}

.filter-box select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.bottom-nav {
    position: fixed; bottom: 0; width: 100%; max-width: 450px;
    background: white; display: flex; justify-content: space-around;
    padding: 15px 0 20px 0; border-top: 1px solid #eee; z-index: 100;
}
.nav-item { text-decoration: none; color: #b2bec3; text-align: center; font-size: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; }
.nav-item i { font-size: 22px; transition: 0.3s; }
.nav-item.active { color: var(--primary); }

/* MODALS */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
    z-index: 999; visibility: hidden; opacity: 0; transition: 0.3s;
    display: flex; align-items: flex-end; justify-content: center;
}
.modal-overlay.active { visibility: visible; opacity: 1; }
.modal-sheet {
    background: white; width: 100%; max-width: 450px; height: 92vh;
    border-radius: 25px 25px 0 0; padding: 25px;
    transform: translateY(100%); transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column; box-sizing: border-box;
}
.modal-overlay.active .modal-sheet { transform: translateY(0); }
.drag-handle { width: 50px; height: 5px; background: #e0e0e0; border-radius: 10px; margin: 0 auto 20px auto; }
.scrollable-content { flex: 1; overflow-y: auto; padding-bottom: 20px; }

/* Report Styles */
.report-header { text-align: center; padding: 25px; border-radius: 18px; color: white; margin-bottom: 25px; background: #bdc3c7; }
.report-header h1 { 
    margin: 5px 0 0 0; /* Ubah margin bottom jadi 0 biar rapet sama teks normal */
    font-size: 48px; 
    font-weight: 800; 
}

/* TAMBAHAN STYLE BARU */
.ref-text {
    margin: 2px 0 15px 0;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    font-family: monospace; /* Biar angkanya tegas */
    background: rgba(0,0,0,0.1);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
}

.report-header h3 { margin: 0; font-size: 18px; font-weight: 500; }
.level-badge { display: inline-block; background: rgba(255,255,255,0.25); padding: 6px 16px; border-radius: 30px; font-size: 12px; margin-top: 10px; font-weight: 700; }
.bg-success { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.bg-warning { background: linear-gradient(135deg, #f39c12, #f1c40f); }
.bg-danger  { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.bg-critical{ background: linear-gradient(135deg, #8e44ad, #9b59b6); }

.meter-box { margin-bottom: 30px; }
.meter-label { display: flex; justify-content: space-between; font-size: 10px; color: #888; margin-bottom: 8px; font-weight: 700; text-transform: uppercase; }
.meter-track { height: 14px; background: #f1f2f6; border-radius: 10px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 10px; width: 0%; transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1); }
.fill-success { background: #27ae60; } .fill-warning { background: #f39c12; }
.fill-danger { background: #c0392b; } .fill-critical { background: #8e44ad; }

.report-card { border: 1px solid #f0f0f0; border-radius: 16px; margin-bottom: 20px; background: #fff; }
.card-head { background: #f8f9fa; padding: 12px 18px; font-size: 13px; font-weight: 700; color: #444; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.card-body { padding: 18px; }

.symptom-list { list-style: none; padding: 0; margin: 0; }
.symptom-list li { font-size: 14px; color: #333; padding: 8px 0; border-bottom: 1px dashed #f0f0f0; display: flex; align-items: center; gap: 10px; }
.symptom-list li i { color: #e74c3c; font-size: 12px; }

.explain-text { font-size: 14px; line-height: 1.6; color: #555; margin-bottom: 15px; }
.risk-alert { background: #fff8e1; border-left: 4px solid #ffc107; padding: 12px; font-size: 13px; color: #8d6e1f; border-radius: 6px; }

.diet-col p { background: #f9f9f9; padding: 10px; border-radius: 8px; margin-top: 5px; font-size: 13px; }
.action-alert { background: #2d3436; color: white; padding: 18px; border-radius: 16px; display: flex; gap: 15px; align-items: center; }

/* ARTICLE CONTENT (TYPOGRAPHY) */
.art-full-title { font-size: 24px; font-weight: 800; color: #2d3436; margin-bottom: 5px; line-height: 1.3;}
.art-full-tag { display: inline-block; background: #e8f5e9; color: var(--primary); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 25px; }
.art-full-body { font-size: 16px; line-height: 1.8; color: #2d3436; text-align: left; }
.art-full-body h4 { font-size: 18px; font-weight: 700; margin-top: 25px; margin-bottom: 10px; color: #27ae60; border-left: 4px solid #27ae60; padding-left: 10px; }
.art-full-body p { margin-bottom: 15px; }
.art-full-body ul { padding-left: 20px; margin-bottom: 20px; }
.art-full-body li { margin-bottom: 8px; }

/* --- BRANDING (SILUET & LOGO FOOTER) --- */
.brand-footer {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid #f0f0f0;
}

.brand-footer p {
    font-size: 10px;
    color: #95a5a6;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.brand-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.brand-logos img {
    height: 45px;
    width: auto;
    object-fit: contain;
}

.divider-line {
    width: 1px;
    height: 30px;
    background: #e0e0e0;
}

.brand-text {
    font-size: 11px;
    color: var(--dark);
    line-height: 1.4;
    display: block;
}
.modal-footer { display: flex; gap: 10px; padding-top: 10px; }

/* STYLE TOMBOL WA (BARU) */
.btn-wa {
    flex: 2; /* Lebarnya sama kayak tombol simpan */
    background: #25D366; /* Warna WA */
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-wa:active { background: #128C7E; }

.btn-save { flex: 1.5; background: var(--dark); color: white; border: none; padding: 15px; border-radius: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px;}
.btn-close { flex: 1; border: 2px solid #eee; background: white; color: #636e72; padding: 15px; border-radius: 12px; font-weight: 700; cursor: pointer; font-size: 12px;}