/* Base Styles & Variables */
:root {
    --primary-color: #1e3799;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --protein-color: #10b981; /* Green */
    --calorie-color: #0ea5e9; /* Light Blue */
    --water-color: #3b82f6;   /* Royal Blue */
    --exercise-color: #f59e0b; /* Amber/Yellow for Exercise  */
    --nav-height: 60px;
    --bottom-nav-height: 65px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height); 
}

/* Watermark: Background fixed centered [cite: 110, 111] */
.main-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 80px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.03);
    z-index: -1;
    white-space: nowrap;
    pointer-events: none;
    text-transform: uppercase;
}

/* Sticky Navbar [cite: 90] */
.navbar {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px); 
    border-bottom: 1px solid #e2e8f0;
    z-index: 1000;
    padding: 0 15px;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Container & Cards [cite: 94] */
.container {
    padding: 15px;
}

.goal-card, .water-section, .discipline-section, .action-grid {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

h2, h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #475569;
}

/* Progress Bars Logic [cite: 96, 97] */
.progress-item {
    margin-bottom: 15px;
}

.label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.fill {
    height: 100%;
    transition: width 0.5s ease-in-out; [cite: 100]
}

.protein-fill { background-color: var(--protein-color); }
.calorie-fill { background-color: var(--calorie-color); }
.exercise-fill { background-color: var(--exercise-color); }

/* Grid System (Water & Exercise) [cite: 102] */
.water-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.glass {
    aspect-ratio: 1/1;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

/* Water Active State [cite: 103] */
.glass.active {
    background-color: var(--water-color);
    border-color: var(--water-color);
    color: white;
}

/* Exercise Active State */
.glass.exercise-active {
    background-color: #fef3c7;
    border-color: var(--exercise-color);
    color: var(--exercise-color);
    transform: scale(1.05);
}

/* Summary Buttons Layout [cite: 75] */
.summary-flex {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s;
}

.action-btn:active { transform: scale(0.98); }

/* Bottom Nav [cite: 90] */
.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    z-index: 1000;
}

.nav-item {
    text-decoration: none;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
}

.nav-item.active { color: var(--primary-color); }
.nav-item i { font-size: 1.2rem; margin-bottom: 3px; }

/* Loader spinner [cite: 61] */
.loader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 3000;
}
.spinner {
    width: 45px; height: 45px;
    border: 4px solid #f3f3f3; border-top: 4px solid var(--primary-color);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Mobile Optimizations */
@media (max-width: 380px) {
    .water-grid { gap: 6px; }
    .glass { font-size: 0.9rem; }
    .logo { font-size: 1rem; }
}