:root {
    --bg-color: #FDFBF7;
    --card-bg: #FFFFFF;
    --accent-color: #8FD8D2;
    --text-color: #4A3B32;
    --text-muted: #9E8F85;
    --shadow: 0 10px 30px rgba(74, 59, 50, 0.08);
    --neon-green: #A3E4D7; 
    --neon-yellow: #F9E79F; 
    --neon-red: #F5B7B1; 
    --neon-blue: #AED6F1; 
    --border-color: #F0EAE1;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
}

.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background: rgba(253, 251, 247, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}
.logo { font-size: 24px; font-weight: 800; letter-spacing: 2px; color: var(--text-color); }
.nav-links a { text-decoration: none; color: var(--text-muted); margin-left: 20px; font-weight: 600; transition: color 0.3s; }
.nav-links a:hover { color: var(--accent-color); }

.hero-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('images/hero_bg.png') center/cover no-repeat;
    position: relative;
    text-align: center;
}
.hero-section::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(253, 251, 247, 0.6);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}
.hero-text-box {
    background: rgba(255, 255, 255, 0.85);
    padding: 50px;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.5);
    display: inline-block;
}
.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--text-color);
    word-break: keep-all;
}
.highlight {
    color: var(--accent-color);
}
.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 400;
}
.cta-button {
    display: inline-block;
    background: var(--text-color);
    color: #fff;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s, background 0.3s;
    box-shadow: var(--shadow);
}
.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(143, 216, 210, 0.5);
    background: #7BCBCA;
}

.cta-group {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 35px;
    width: 100%;
    min-height: 100px;
}
.qr-container {
    position: absolute;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}
.qr-container:hover {
    transform: translateY(-3px);
}
.qr-container img {
    width: 75px;
    height: 75px;
}
.qr-container span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.simulator-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 100px 20px 60px 20px;
    background: #F4F1EA;
}
.main-container {
    display: flex;
    width: 100%;
    max-width: 1100px;
    height: auto;
    background-color: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-title {
    text-align: center;
    margin-bottom: 20px;
}
.section-title h2 { font-size: 2.5rem; margin-bottom: 10px; color: var(--text-color); }
.section-title p { font-size: 1.1rem; color: var(--text-muted); }
.section-title p { font-size: 1.1rem; color: var(--text-muted); }

.split-view {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.left-pane {
    flex: 1.2;
    position: relative;
    background-color: #F4EFE6;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 30px;
    transition: background-color 0.8s ease;
}
.left-pane.awake-state { background-color: #FCECE8; }

.baby-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.baby-container {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(74, 59, 50, 0.2);
    position: relative;
    z-index: 2;
}
.baby-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 20px;
}

.ripple {
    position: absolute;
    bottom: -15px; 
    left: 5%;
    width: 90%;
    height: 60px;
    border-radius: 50%;
    border: 5px solid var(--accent-color);
    box-shadow: 0 0 15px var(--accent-color);
    opacity: 0;
    z-index: 3;
    pointer-events: none;
}

@keyframes ripple-anim {
    0% { transform: scale(0.9); opacity: 0.9; }
    100% { transform: scale(1.4); opacity: 0; }
}

.vibrate-low .ripple { animation: ripple-anim 1.5s infinite ease-out; border-color: var(--neon-green); }
.vibrate-mid .ripple { animation: ripple-anim 1s infinite ease-out; border-color: var(--neon-yellow); }
.vibrate-high .ripple { animation: ripple-anim 0.6s infinite ease-out; border-color: var(--neon-blue); }

.ripple:nth-child(2) { animation-delay: 0.3s; }
.ripple:nth-child(3) { animation-delay: 0.6s; }

.status-overlay {
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-color);
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    backdrop-filter: blur(5px);
    border: 2px solid white;
    z-index: 10;
    margin-bottom: 10px;
}

.right-pane {
    flex: 0.8;
    background-color: var(--bg-color);
    border-left: 1px solid var(--border-color);
    padding: 30px 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.controller-container {
    width: 100%;
    max-width: 400px;
}

.controller-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.controller-top-bar h3 {
    margin: 0;
    font-size: 1.6rem;
}
.vital-monitor {
    background: #EAFAF1;
    border: 1px solid #2ECC71;
    color: #2ECC71;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}
.vital-monitor.crying {
    background: #FDEDEC;
    border-color: #E74C3C;
    color: #E74C3C;
}

@keyframes pulse-calm {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
@keyframes pulse-fast {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1); }
}
.heart-icon {
    display: inline-block;
    animation: pulse-calm 1.5s infinite;
}
.vital-monitor.crying .heart-icon {
    animation: pulse-fast 0.4s infinite;
}

.controller-container h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: 1px;
}

/* Awake Effects */
.crying-indicator {
    position: absolute;
    top: 33%;
    left: 38%;
    background: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #E74C3C;
    box-shadow: 0 5px 15px rgba(231,76,60,0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
    border: 2px solid #E74C3C;
    animation: bounce-crying 1s infinite alternate;
}
@keyframes bounce-crying {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}
.left-pane.awake-state .crying-indicator {
    opacity: 1;
}
.left-pane.awake-state .baby-container img {
    filter: sepia(0.3) saturate(1.3) hue-rotate(-10deg);
}

/* Button Pulse Animation */
@keyframes pulse-alert {
    0% { box-shadow: 0 0 0 0 rgba(143, 216, 210, 0.7); transform: scale(1); }
    70% { box-shadow: 0 0 0 10px rgba(143, 216, 210, 0); transform: scale(1.02); }
    100% { box-shadow: 0 0 0 0 rgba(143, 216, 210, 0); transform: scale(1); }
}
.btn-low.pulse-alert {
    animation: pulse-alert 1.5s infinite;
    background: rgba(143, 216, 210, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.status-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}
.status-title {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    font-weight: 600;
}
#status {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}
.led-indicator {
    width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 10px;
}
.led-off { background-color: #E0E0E0; }
.led-low { background-color: #2ECC71; box-shadow: 0 0 10px rgba(46, 204, 113, 0.5); }
.led-mid { background-color: #F1C40F; box-shadow: 0 0 10px rgba(241, 196, 15, 0.5); }
.led-high { background-color: #3498DB; box-shadow: 0 0 10px rgba(52, 152, 219, 0.5); }

.timer-box {
    margin-top: 15px; font-size: 14px; color: #45B39D; font-weight: 700; display: none; background: #E8F8F5; padding: 10px; border-radius: 8px; border: 1px solid #D1F2EB;
}

.info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 24px;
}
.info-item {
    background: var(--card-bg); border-radius: 12px; padding: 10px; text-align: center; border: 1px solid var(--border-color); box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.info-label { color: var(--text-muted); margin-bottom: 4px; font-size: 11px; font-weight: 600; }
#scale, #wifi { font-weight: 700; color: var(--text-color); font-size: 16px; }

/* Auto Detect Box */
.auto-detect-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFF;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.auto-detect-info { text-align: left; }
.auto-detect-title { font-size: 14px; font-weight: 700; color: var(--text-color); margin-bottom: 4px; }
.auto-detect-desc { font-size: 11px; color: var(--text-muted); }

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(20px); }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }


.btn-grid { display: grid; gap: 10px; }
.btn {
    background: #FFFFFF; border: 1px solid #EAECEE; color: var(--text-muted); padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.btn:hover { background: #F8F9F9; }
.btn:active { transform: scale(0.98); }
.btn-off.active { border-color: #E74C3C; color: #E74C3C; background: #FDEDEC; }
.btn-low.active { border-color: #2ECC71; color: #2ECC71; background: #EAFAF1; }
.btn-mid.active { border-color: #F1C40F; color: #D4AC0D; background: #FEF9E7; }
.btn-high.active { border-color: #3498DB; color: #3498DB; background: #EBF5FB; }

.reset-btn {
    background: transparent; border: 1px dashed #E74C3C; color: #E74C3C; margin-top: 20px; padding: 10px; font-size: 12px; font-weight: 600; width: 100%; border-radius: 10px; cursor: pointer; transition: all 0.2s;
}
.reset-btn:hover { background: #FDEDEC; }
.update-link { display: block; text-align: center; margin-top: 15px; color: var(--text-muted); text-decoration: none; font-size: 12px; font-weight: 600; }
.update-link:hover { color: var(--text-color); }

footer {
    text-align: center; padding: 40px; color: var(--text-muted); border-top: 1px solid var(--border-color); font-size: 14px;
}

@media (max-width: 900px) {
    .main-container { 
        flex-direction: column; 
    }
    .left-pane {
        width: 100%;
        padding: 15px 10px;
    }
    .right-pane {
        width: 100%;
        padding: 15px 15px 25px 15px;
        border-left: none; 
        border-top: 1px solid var(--border-color); 
    }
    .baby-wrapper {
        max-width: 250px;
        margin: 0 auto;
    }
    .status-overlay {
        font-size: 0.95rem;
        padding: 8px 16px;
        margin-bottom: 10px;
    }
    .crying-indicator {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    .hero-content h1 { 
        font-size: 2.2rem; 
    }
    .hero-content p {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 30px;
    }
    .hero-text-box {
        padding: 30px 15px;
    }
    .hero-action {
        flex-direction: column;
        gap: 20px;
    }
    .qr-widget {
        margin-left: 0;
        margin-top: 20px;
    }
    .section-title h2 { font-size: 2rem; }
    .simulator-section { padding-top: 60px; }
    .navbar { padding: 15px 20px; }
}
