:root {
    --primary: #2d3436;
    --accent: #0984e3; 
    --accent-light: #74b9ff;
    --bg: #f0f7ff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text: #2d3436;
    --text-muted: #636e72;
    --border: #dfe6e9;
    --shadow-bold: 0 20px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
    --primary: #dfe6e9;
    --bg: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.95);
    --text: #f0f6fc;
    --text-muted: #8b949e;
    --border: #30363d;
    --shadow-bold: 0 20px 40px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* Header */
header {
    height: 70px;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card-bg);
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.1rem; font-weight: 800; color: var(--accent); letter-spacing: 1px; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }
.lang-selector { display: flex; background: var(--border); border-radius: 20px; padding: 2px; }
.lang-selector button { border: none; background: none; padding: 4px 10px; border-radius: 18px; font-size: 0.75rem; font-weight: 700; cursor: pointer; color: var(--text-muted); }
.lang-selector button.active { background: var(--accent); color: white; }
.icon-btn { background: none; border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Hero */
.hero-section { max-width: 800px; margin: 4rem auto 2.5rem; text-align: center; padding: 0 2rem; }
.hero-badge { 
    display: inline-block; 
    padding: 0.5rem 1.2rem; 
    background: var(--accent); /* Changed to primary accent color for better visibility */
    color: white; /* High contrast text */
    font-weight: 800; 
    border-radius: 30px; 
    font-size: 0.8rem; 
    margin-bottom: 1.5rem; 
    letter-spacing: 1px;
}

.hero-title { font-size: 3rem; font-weight: 800; line-height: 1.2; margin-bottom: 1.5rem; word-break: keep-all; }
.hero-title span { color: var(--accent); }

.hero-subtitle { 
    font-size: 1.15rem; 
    color: var(--text-muted); 
    max-width: 800px; /* Increased width to prevent wrapping */
    margin: 0 auto; 
    word-break: keep-all; /* Prevents awkward line breaks in Korean */
}

/* Tool Card */
.tool-section { max-width: 500px; margin: 0 auto; padding: 0 2rem; }
.card-glass { background: var(--card-bg); border: 1px solid var(--border); border-radius: 32px; padding: 2.5rem; box-shadow: var(--shadow-bold); text-align: center; }

/* Water Visualization */
.water-container {
    width: 150px;
    height: 250px;
    background: #e1f5fe;
    margin: 0 auto 2rem;
    border-radius: 20px 20px 30px 30px;
    position: relative;
    overflow: hidden;
    border: 5px solid white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.water-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%; /* Dynamic */
    background: var(--accent);
    transition: height 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.water-wave::before {
    content: "";
    position: absolute;
    width: 200%;
    height: 100%;
    top: -10px;
    left: -50%;
    background: rgba(255,255,255,0.2);
    border-radius: 40%;
    animation: wave 5s infinite linear;
}

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

.percentage-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    z-index: 10;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.stats-row { display: flex; justify-content: space-around; margin-bottom: 2rem; }
.stat-item small { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }
.stat-item span { font-size: 1.5rem; font-weight: 800; color: var(--accent); }

.action-grid { display: flex; gap: 1rem; margin-bottom: 2rem; }
.add-btn { flex: 1; padding: 1rem; border: none; border-radius: 16px; font-weight: 700; cursor: pointer; background: var(--bg); color: var(--accent); border: 1px solid var(--accent-light); }
.add-btn:hover { background: var(--accent); color: white; transform: translateY(-2px); }
#reset-today { background: var(--text-muted); color: white; border: none; flex: 0.8; }

.settings-box { border-top: 1px solid var(--border); padding-top: 1.5rem; text-align: left; }
.settings-box label { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.goal-input { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.goal-input input { flex: 1; padding: 0.8rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-weight: 700; }
#save-goal { padding: 0 1.2rem; border-radius: 12px; border: none; background: var(--accent); color: white; font-weight: 700; cursor: pointer; }

/* History */
.history-section { max-width: 500px; margin: 3rem auto; padding: 0 2rem; }
.history-list { background: var(--card-bg); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.history-item { padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.history-item:last-child { border: none; }
.hist-val { font-weight: 800; color: var(--accent); }
.hist-bar-container { flex: 1; margin: 0 1.5rem; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.hist-bar { height: 100%; background: var(--accent); border-radius: 4px; }
.hist-date { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; }

/* Compliance */
.compliance-info { max-width: 500px; margin: 4rem auto; padding: 0 2rem; display: grid; gap: 1rem; }
.info-card { background: rgba(0,0,0,0.03); padding: 1.2rem; border-radius: 16px; font-size: 0.85rem; }
.info-card h4 { margin-bottom: 0.4rem; color: var(--text); font-size: 0.9rem; }
.info-card p { color: var(--text-muted); }

footer { padding: 4rem 2rem; text-align: center; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }
.footer-logo { font-weight: 800; margin-bottom: 0.5rem; }

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .action-grid { flex-direction: column; }
}
