/*
 * style.css
 * Desain Sistem & Tata Letak Dasar (Mobile-First)
 * Posyandu Cendrawasih, Kota Tasikmalaya
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Palet Warna Utama (Mint Green & Soft Blue Healthcare Theme) */
    --color-primary: #1ABC9C;         /* Mint Green */
    --color-primary-light: #E8F8F5;   /* Mint Green Sangat Terang */
    --color-secondary: #3498DB;       /* Soft Blue */
    --color-secondary-light: #EBF5FB; /* Soft Blue Terang */
    --color-background: #F4F6F7;      /* Abu-abu Terang Bersih */
    --color-white: #FFFFFF;
    --color-card-bg: #FFFFFF;
    
    /* Warna Status Status Gizi */
    --color-success: #2ECC71;         /* Normal - Hijau */
    --color-success-light: #E8F8F5;
    --color-warning: #F1C40F;         /* Gizi Kurang / Risiko Stunting - Kuning */
    --color-warning-light: #FEF9E7;
    --color-orange: #E67E22;          /* Gizi Buruk / Risiko Tinggi - Orange */
    --color-orange-light: #FDF2E9;
    --color-danger: #E74C3C;          /* Stunting / Bahaya - Merah */
    --color-danger-light: #FDEDEC;
    
    /* Warna Netral & Tipografi */
    --color-text-dark: #2C3E50;
    --color-text-muted: #7F8C8D;
    --color-border: #BDC3C7;
    --color-border-light: #EAEDED;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.08);
    
    /* Tipografi */
    --font-primary: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    /* Ukuran */
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --max-mobile-width: 480px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-primary);
    background-color: #2C3E50; /* Background gelap di sekitar simulator mobile di desktop */
    color: var(--color-text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Simulator Ponsel (Mobile First Wrapper) */
#app-container {
    width: 100%;
    max-width: var(--max-mobile-width);
    height: 100vh;
    background-color: var(--color-background);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Mencegah simulator luar ter-scroll */
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

#page-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Hanya halaman konten yang bisa di-scroll */
    padding-bottom: 90px; /* Jarak agar konten terbawah tidak tertutup bottom-nav */
    scrollbar-width: none;
}

#page-container::-webkit-scrollbar {
    display: none;
}

@media (min-height: 700px) and (min-width: 500px) {
    #app-container {
        height: 850px;
        border-radius: 36px;
        border: 12px solid #1A252F;
    }
}

#app-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari and Opera */
}

/* Struktur Halaman SPA */
.page {
    display: none; /* Disembunyikan secara default, diatur via JS */
    width: 100%;
    min-height: 100%;
    padding-bottom: 20px; /* Diubah menjadi normal karena scroll diatur page-container */
    animation: fadeIn var(--transition-speed) ease-in-out;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* Animasi Perpindahan Halaman */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tipografi Kustom */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--color-text-dark);
    font-weight: 700;
}

p {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-dark);
}

/* Splash Screen (Khusus) */
#splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
    color: var(--color-white);
    padding: 30px;
    text-align: center;
}

.splash-logo {
    width: 110px;
    height: 110px;
    background-color: var(--color-white);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-bottom: 25px;
    animation: pulse 2s infinite;
}

.splash-logo svg {
    width: 60px;
    height: 60px;
    fill: var(--color-primary);
}

.splash-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.splash-subtitle {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.4;
    margin-bottom: 40px;
}

/* Grid & Utilities */
.container {
    padding: 20px;
    width: 100%;
}

.flex-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

/* Scroll Lock */
.no-scroll {
    overflow: hidden;
}

/* Spinner Modern */
.loader-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--color-white);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
