/* --- COLORS & VARS --- */
:root {
    /* Palette: Vibrant & Scientific */
    --bg-dark: #0B0E14;
    --card-bg: rgba(30, 35, 45, 0.7);
    --primary: #FF5F6D;  /* Pinkish Orange */
    --primary-grad: linear-gradient(135deg, #FF5F6D 0%, #FFC371 100%);
    --accent: #00C9FF;   /* Science Blue */
    --accent-grad: linear-gradient(135deg, #00C9FF 0%, #92FE9D 100%);
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --border-light: rgba(255, 255, 255, 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 100px;
}

/* --- FONTS --- */
h1, h2, h3, .logo-text { font-family: 'Fredoka', sans-serif; letter-spacing: 0.5px; }

/* --- BACKGROUND FX --- */
.glow-orb {
    position: fixed; width: 300px; height: 300px; border-radius: 50%;
    filter: blur(90px); opacity: 0.3; z-index: -1; animation: float 8s ease-in-out infinite alternate;
}
.orb-1 { background: var(--primary); top: -50px; left: -100px; }
.orb-2 { background: var(--accent); bottom: 100px; right: -100px; animation-delay: -4s; }

@keyframes float { from { transform: translateY(0); } to { transform: translateY(40px); } }

/* --- CONTAINER --- */
.app-container { max-width: 480px; margin: 0 auto; padding: 20px; }

/* --- HEADER --- */
.app-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.logo-wrapper { display: flex; align-items: center; gap: 12px; }
.logo-box { 
    width: 45px; height: 45px; 
    background: var(--primary-grad); 
    border-radius: 14px; 
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: white;
    box-shadow: 0 8px 20px rgba(255, 95, 109, 0.3);
}
.logo-text { font-size: 1.4rem; font-weight: 700; line-height: 1; margin-bottom: 2px; }
.status-badge { font-size: 0.7rem; background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 20px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 5px; }
.pulse-dot { width: 6px; height: 6px; background: #00ff88; border-radius: 50%; box-shadow: 0 0 5px #00ff88; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

.user-avatar { width: 40px; height: 40px; background: #2A2F3E; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); border: 1px solid var(--border-light); }

/* --- CARDS --- */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 24px; padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.tag-pill { background: var(--accent); color: #000; font-size: 0.7rem; font-weight: 800; padding: 4px 10px; border-radius: 20px; text-transform: uppercase; margin-bottom: 10px; display: inline-block; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }

/* --- INPUTS --- */
.input-container { position: relative; margin-bottom: 15px; }
input {
    width: 100%;
    background: #1A1F2B;
    border: 2px solid #2A2F3E;
    border-radius: 16px;
    padding: 18px 50px 18px 20px;
    color: white; font-size: 1.1rem; font-family: 'Fredoka', sans-serif;
    outline: none; transition: 0.3s;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 95, 109, 0.1); }
.btn-scan { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; }

/* --- BUTTONS --- */
.btn-primary, .btn-accent {
    width: 100%; border: none; padding: 18px; border-radius: 16px;
    color: white; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-primary { background: var(--primary-grad); box-shadow: 0 8px 25px rgba(255, 95, 109, 0.4); }
.btn-accent { background: var(--accent-grad); box-shadow: 0 8px 25px rgba(0, 201, 255, 0.4); color: #00334e; }
.btn-primary:active, .btn-accent:active { transform: scale(0.96); }

/* --- VIDEO AREA --- */
.video-frame { border-radius: 16px; overflow: hidden; position: relative; padding-bottom: 56.25%; height: 0; background: #000; margin-bottom: 15px; border: 2px solid rgba(255,255,255,0.1); }
.video-frame iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.mission-status { background: rgba(0, 255, 136, 0.1); border: 1px solid rgba(0, 255, 136, 0.2); padding: 15px; border-radius: 16px; display: flex; align-items: center; gap: 15px; }
.mission-status i { color: #00ff88; font-size: 1.5rem; }
.mission-status h4 { font-size: 0.9rem; color: white; margin-bottom: 2px; }
.mission-status p { font-size: 0.8rem; color: var(--text-muted); }

/* --- CERTIFICATE --- */
.cert-header-icon { font-size: 3rem; color: #FFD700; text-align: center; margin-bottom: 10px; filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); }
.input-lg { font-size: 1.2rem; text-align: center; margin-bottom: 20px; }

/* --- TOOLS GRID --- */
.tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.tool-card { background: rgba(255,255,255,0.03); padding: 20px; border-radius: 18px; text-align: center; border: 1px solid transparent; transition: 0.3s; }
.tool-card:hover { background: rgba(255,255,255,0.08); border-color: var(--accent); transform: translateY(-3px); }
.emoji { font-size: 2.5rem; margin-bottom: 5px; }
.refill-btn { display: flex; justify-content: space-between; padding: 15px 20px; background: #1F2937; color: white; text-decoration: none; border-radius: 16px; border: 1px solid var(--border-light); font-weight: 600; font-size: 0.9rem; }

/* --- BOTTOM NAV --- */
.bottom-nav {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 420px;
    background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(20px);
    border-radius: 25px; padding: 10px 20px;
    display: flex; justify-content: space-between;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4); border: 1px solid var(--border-light);
    z-index: 100;
}
.nav-btn {
    background: none; border: none; color: #64748B;
    display: flex; flex-direction: column; align-items: center;
    font-size: 0.7rem; font-weight: 600; width: 70px; cursor: pointer; transition: 0.3s;
}
.nav-btn i { font-size: 1.4rem; margin-bottom: 4px; }
.nav-btn.active { color: white; }
.nav-btn.active i { color: var(--primary); transform: translateY(-5px); text-shadow: 0 5px 15px var(--primary); }

/* --- LOCK STATE --- */
.nav-btn.locked { opacity: 0.6; }
.nav-btn.locked .icon-wrapper { position: relative; }
.lock-badge { position: absolute; top: -5px; right: -8px; background: #EF4444; width: 14px; height: 14px; border-radius: 50%; font-size: 8px; color: white; display: flex; align-items: center; justify-content: center; border: 1px solid #0F172A; }
.alert { padding: 12px; background: rgba(239, 68, 68, 0.2); border: 1px solid #EF4444; border-radius: 12px; color: #FCA5A5; display: flex; align-items: center; gap: 8px; margin-bottom: 15px; font-size: 0.9rem; }
.hidden { display: none !important; }
.fade-in { animation: fade 0.5s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- NEW: SCIENCE TRIGGER BUTTON --- */
.science-trigger {
    background: linear-gradient(to right, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 15px;
}
.science-trigger:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent);
}
.icon-pulse {
    width: 40px; height: 40px;
    background: rgba(255, 215, 0, 0.2);
    border-radius: 50%;
    color: #FFD700;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    animation: glow 2s infinite alternate;
}
@keyframes glow { from { box-shadow: 0 0 5px rgba(255,215,0,0.2); } to { box-shadow: 0 0 15px rgba(255,215,0,0.6); } }

.text-content h4 { font-size: 1rem; color: white; margin-bottom: 2px; }
.text-content p { font-size: 0.8rem; color: var(--accent); }
.science-trigger .arrow { margin-left: auto; color: var(--text-muted); }

/* --- NEW: FULL SCREEN MODAL (ENSIKLOPEDIA) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex; align-items: flex-end; /* Muncul dari bawah di HP */
    opacity: 0; transition: opacity 0.3s;
    pointer-events: none; /* Biar tembus kalau hidden */
}
.modal-overlay.visible { opacity: 1; pointer-events: auto; }

.modal-content {
    background: #151921;
    width: 100%; max-width: 500px;
    margin: 0 auto;
    border-top-left-radius: 30px; border-top-right-radius: 30px;
    padding: 30px;
    position: relative;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.visible .modal-content { transform: translateY(0); }

@media (min-width: 500px) {
    .modal-overlay { align-items: center; justify-content: center; }
    .modal-content { border-radius: 30px; transform: scale(0.9); }
    .modal-overlay.visible .modal-content { transform: scale(1); }
}

.btn-close {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 35px; height: 35px; border-radius: 50%; cursor: pointer;
}

.modal-header { text-align: center; margin-bottom: 30px; }
.modal-header h2 { font-size: 1.8rem; background: var(--accent-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.illustration-box {
    background: rgba(255,255,255,0.05); border-radius: 20px; padding: 30px;
    text-align: center; margin-bottom: 20px;
}
.chemical-reaction { font-size: 3rem; }

.fact-box {
    background: rgba(0, 201, 255, 0.1); border-left: 4px solid #00C9FF;
    padding: 15px; border-radius: 10px; margin: 20px 0;
}
.fact-box h4 { color: #00C9FF; margin-bottom: 5px; }

.chemical-formula {
    font-family: 'Courier New', monospace;
    text-align: center; background: #000; padding: 10px; border-radius: 8px;
    border: 1px dashed var(--text-muted); color: var(--primary); margin: 20px 0;
}