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

:root {
    /* HSL Primary Hue (LeanLife Green) */
    --hue-primary: 152;

    /* Color Palette */
    --clr-primary-green: #C5F3D6;
    --clr-accent-green: #A5E332;
    --clr-accent-green-hover: #8fca24;
    --clr-bg-base: #EFE6DA;
    --clr-text-dark: #000000;
    --clr-text-light: #FFFFFF;
    
    /* Semantic Colors */
    --clr-glass: rgba(255, 255, 255, 0.78);
    --clr-glass-dark: rgba(0, 0, 0, 0.04);
    --clr-border-glass: rgba(255, 255, 255, 0.65);
    --clr-border-dark: rgba(0, 0, 0, 0.1);
    --clr-accent-translucent: rgba(165, 227, 50, 0.15);
    --clr-primary-translucent: rgba(18, 130, 109, 0.15);
    
    /* Alerts & Statuses */
    --clr-success: #28a745;
    --clr-warning: #ffc107;
    --clr-danger: #dc3545;
    --clr-info: #17a2b8;
    
    /* Typography */
    --font-brand: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Elevation & Shapes */
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --radius-round: 50%;
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.04);
    --shadow-glass: 0 8px 32px 0 rgba(197, 243, 214, 0.15);
    --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
}

html, body, main, section, .view-section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body {
    font-family: var(--font-body);
    background: radial-gradient(circle at 50% 50%, var(--clr-bg-base) 0%, rgba(246, 241, 233, 1) 55%, rgba(238, 230, 216, 1) 100%);
    background-attachment: fixed;
    color: var(--clr-text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-brand);
    font-weight: 700;
}

/* Base Layout Container */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

/* Background floating elements */
.floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    font-size: 2rem;
    opacity: 0.15;
    animation: floatAround 20s infinite ease-in-out;
}

.floating-icon:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-icon:nth-child(2) { top: 25%; right: 15%; animation-delay: 2s; font-size: 3rem; }
.floating-icon:nth-child(3) { bottom: 20%; left: 15%; animation-delay: 4s; }
.floating-icon:nth-child(4) { bottom: 15%; right: 25%; animation-delay: 6s; }
.floating-icon:nth-child(5) { top: 50%; left: 40%; animation-delay: 8s; }
.floating-icon:nth-child(6) { top: 80%; right: 5%; animation-delay: 10s; }
.floating-icon:nth-child(7) { top: 5%; right: 45%; animation-delay: 12s; }
.floating-icon:nth-child(8) { bottom: 45%; left: 5%; animation-delay: 14s; }

@keyframes floatAround {
    0%, 100% { transform: translateY(0) translateX(0) rotate(0deg); }
    50% { transform: translateY(-40px) translateX(30px) rotate(180deg); }
}

/* Glassmorphism Styles */
.glass-card {
    background: var(--clr-glass);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--clr-border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2rem;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    box-shadow: 0 12px 40px 0 rgba(165, 227, 50, 0.15);
    transform: translateY(-4px);
}

.glass-card-interactive {
    cursor: pointer;
}

/* Brand logo styling */
.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 80px; /* Zoomed out to a compact size */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4)) drop-shadow(0 2px 10px rgba(13, 190, 133, 0.6)) drop-shadow(0 0 15px rgba(165, 227, 50, 0.3));
    transition: var(--transition-smooth);
}

.logo-img:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6)) drop-shadow(0 2px 16px rgba(13, 190, 133, 0.8)) drop-shadow(0 0 20px rgba(165, 227, 50, 0.5));
}

/* Global Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #0DBE85 0%, #12826D 50%, #0A5849 100%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15), inset 0 -1px 0 rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, background 0.3s ease;
}

.navbar.header-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.navbar #user-display-name {
    color: #FFFFFF;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-brand);
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    padding: 0.5rem 0;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.nav-links a:hover {
    color: #FFFFFF;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: var(--clr-accent-green);
    box-shadow: 0 0 8px var(--clr-accent-green);
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-links a:hover::after, .nav-links a.active::after {
    transform: translateX(-50%) scale(1);
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Navbar specific button overrides */
.navbar .btn-outline {
    border-color: rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.navbar .btn-outline:hover {
    background: #FFFFFF;
    color: var(--clr-text-dark);
    border-color: #FFFFFF;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.navbar .btn-primary {
    background: var(--clr-accent-green);
    color: var(--clr-text-dark);
    border: none;
    box-shadow: 0 0 12px rgba(165, 227, 50, 0.3);
}

.navbar .btn-primary:hover {
    background: #bbf446;
    box-shadow: 0 0 20px rgba(165, 227, 50, 0.6);
}

/* Buttons */
.btn {
    font-family: var(--font-brand);
    font-weight: 600;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--clr-accent-green);
    color: var(--clr-text-dark);
    box-shadow: 0 4px 14px rgba(165, 227, 50, 0.3);
}

.btn-primary:hover {
    background-color: var(--clr-accent-green-hover);
    box-shadow: 0 6px 20px rgba(165, 227, 50, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--clr-primary-green);
    color: var(--clr-text-dark);
}

.btn-secondary:hover {
    background-color: #aeeec2;
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--clr-text-dark);
    border: 2px solid var(--clr-text-dark);
}

.btn-outline:hover {
    background-color: var(--clr-text-dark);
    color: var(--clr-text-light);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--clr-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #bd2130;
}

/* Main Views Wrapper */
.view-section {
    display: none;
    padding: 2rem 5%;
    flex-grow: 1;
    animation: fadeIn 0.5s ease-out forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LANDING HERO PAGE --- */
.landing-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
    min-height: 80vh;
    padding-top: 1rem;
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-text h1 {
    font-size: 3.8rem;
    line-height: 1.1;
    letter-spacing: -1px;
}

.hero-text .title-highlight {
    background: linear-gradient(135deg, var(--clr-accent-green), #56ab2f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.hero-text p {
    font-size: 1.25rem;
    color: #4a4a4a;
    font-weight: 400;
    max-width: 90%;
}

.hero-ctas {
    display: flex;
    gap: 1.2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Hero Carousel */
.hero-carousel-container {
    position: relative;
    height: 540px;
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    position: relative;
    height: 100%;
    width: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 10;
}

.carousel-card {
    width: 95%;
    height: 95%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
    position: relative;
    background: white;
}

.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-logo-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, hsl(var(--hue-primary), 60%, 15%), hsl(var(--hue-primary), 65%, 8%));
    gap: 20px;
    padding: 3rem 2rem;
    width: 95%;
    height: 95%;
    border-radius: var(--radius-xl);
    color: #ffffff;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.4), 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.carousel-logo-card h3 {
    font-size: 2.5rem;
    text-align: center;
    color: #ffffff;
    font-family: var(--font-brand);
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.carousel-logo-card p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: center;
    max-width: 80%;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.carousel-logo-card img {
    width: 240px;
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.carousel-card-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 1.5rem 2.8rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, rgba(0, 0, 0, 0) 100%);
    color: white;
    font-family: var(--font-brand);
}

.carousel-card-caption h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.carousel-card-caption p {
    font-size: 0.95rem;
    opacity: 0.9;
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 20;
}

.carousel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.carousel-indicator.active {
    background-color: var(--clr-accent-green);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(165, 227, 50, 0.6);
}

/* Landing Statistics */
.landing-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
    width: 100%;
    box-sizing: border-box;
}

.stat-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 1.5rem 1rem !important;
    min-height: 140px;
    height: 100%;
    box-sizing: border-box;
}

.stat-icon {
    font-size: 2rem;
    color: #12826D;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 2px 6px rgba(18, 130, 109, 0.15));
}

.stat-num {
    font-size: clamp(1.3rem, 2.2vw, 2rem);
    font-family: var(--font-brand);
    font-weight: 800;
    color: var(--clr-text-dark);
    word-wrap: break-word;
    max-width: 100%;
    line-height: 1.2;
}

.mobile-menu-header, .mobile-menu-buttons {
    display: none !important;
}

.stat-label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 500;
}

/* Clickable Feature Cards (Landing) */
.features-section-title {
    text-align: center;
    margin-top: 6rem;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 6rem;
}

.feature-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 380px;
    border: 1px solid var(--clr-border-glass);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    background: var(--clr-glass);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(165, 227, 50, 0.2);
    border-color: var(--clr-accent-green);
}

.feature-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.feature-card-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    filter: brightness(0.65) saturate(0.9);
}

.feature-card:hover .feature-card-bg img {
    transform: scale(1.1);
    filter: brightness(0.5);
}

.feature-card-content {
    position: relative;
    z-index: 2;
    color: white;
}

.feature-card-content h3 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.feature-card-content p {
    font-size: 0.9rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.feature-card-icon {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--clr-accent-green);
    text-shadow: 0 2px 8px rgba(165, 227, 50, 0.4);
}

/* --- AUTHENTICATION MODULE --- */
.auth-container {
    max-width: 480px;
    margin: 4rem auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-family: var(--font-brand);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.6);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--clr-accent-green);
    background: white;
    box-shadow: 0 0 0 3px var(--clr-accent-translucent);
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 600;
}

/* --- USER DASHBOARD --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2.2fr 0.8fr;
    gap: 2rem;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Dashboard Summary Card */
.dashboard-welcome {
    background: linear-gradient(135deg, var(--clr-primary-green), var(--clr-accent-green));
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--clr-text-light);
}

.welcome-info h2 {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
    color: var(--clr-text-light);
}

.welcome-info p {
    color: rgba(255, 255, 255, 0.95);
}

.streak-badge {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-soft);
}

.streak-icon {
    font-size: 2rem;
    color: #f77f00;
    animation: flamePulse 2s infinite alternate ease-in-out;
}

@keyframes flamePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(247, 127, 0, 0.2)); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 10px rgba(247, 127, 0, 0.6)); }
}

.streak-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
}

.streak-label {
    font-size: 0.75rem;
    color: #666;
}

/* Stats Progress Grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.dash-stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.dash-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.dash-stat-card .icon {
    font-size: 1.6rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-stat-val {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-brand);
}

.dash-stat-progress {
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.dash-stat-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-water { background-color: #2196f3; }
.fill-steps { background-color: #8bc34a; }
.fill-calories { background-color: #e91e63; }
.fill-sleep { background-color: #673ab7; }

/* Dashboard Quick Actions */
.quick-actions-bar {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid var(--clr-border-glass);
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-brand);
    font-weight: 600;
    transition: var(--transition-fast);
}

.quick-action-btn:hover {
    border-color: var(--clr-accent-green);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

/* AI Coaching Section */
.ai-coach-banner {
    border-left: 6px solid var(--clr-accent-green);
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.ai-coach-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--clr-primary-green);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.2rem;
    border: 2px solid white;
    box-shadow: var(--shadow-soft);
    position: relative;
    flex-shrink: 0;
}

.ai-coach-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: var(--clr-success);
    border-radius: 50%;
    border: 2px solid white;
}

.ai-coach-speech {
    flex-grow: 1;
}

.ai-coach-speech h4 {
    margin-bottom: 4px;
    color: var(--clr-text-dark);
}

.ai-coach-speech p {
    font-style: italic;
    font-size: 0.95rem;
    color: #444;
}

/* --- DAILY WELLNESS LOG SECTION --- */
.wellness-log-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.wellness-log-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.log-section-title {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--clr-accent-green);
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Water droplet tracker styling */
.droplets-container {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 1.5rem 0;
}

.droplet {
    font-size: 2.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
    opacity: 0.35;
    filter: grayscale(1);
    transform: scale(0.9);
}

.droplet:hover {
    transform: scale(1.15) translateY(-2px);
    opacity: 0.8;
}

.droplet.active {
    opacity: 1;
    filter: grayscale(0);
    transform: scale(1.1);
    animation: dropBounce 0.4s ease-out;
}

@keyframes dropBounce {
    0% { transform: scale(0.6); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1.1); }
}

.water-gauge-wrapper {
    margin-top: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    height: 32px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.water-gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196f3, #00bcd4);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.water-gauge-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--clr-text-dark);
    z-index: 10;
    text-shadow: 0 0 4px white;
}

/* Mood Emoji Selection */
.mood-picker {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.mood-btn {
    flex: 1;
    min-width: 64px;
    text-align: center;
    background: white;
    border: 1px solid var(--clr-border-glass);
    padding: 0.8rem 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.mood-btn span:first-child {
    font-size: 1.8rem;
    transition: var(--transition-fast);
}

.mood-btn span:last-child {
    font-size: 0.75rem;
    font-weight: 500;
    color: #555;
}

.mood-btn:hover {
    transform: translateY(-2px);
    border-color: var(--clr-accent-green);
    background: var(--clr-accent-translucent);
}

.mood-btn.active {
    background-color: var(--clr-accent-green);
    border-color: var(--clr-accent-green);
}

.mood-btn.active span:first-child {
    transform: scale(1.2);
}

/* Meals Section Styling */
.meal-row {
    display: grid;
    grid-template-columns: 100px 1.5fr 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.meal-row h4 {
    font-family: var(--font-brand);
    font-size: 1.1rem;
}

/* Submission Animations */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(239, 230, 218, 0.95);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
}

.success-check-icon {
    font-size: 5rem;
    color: var(--clr-accent-green);
    background: white;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(165, 227, 50, 0.3);
    animation: scaleInCheck 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleInCheck {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Countdown Processing Panel */
.analysis-progress-card {
    border-top: 6px solid #2196f3;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid rgba(33, 150, 243, 0.15);
    border-top-color: #2196f3;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

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

.countdown-timer-box {
    display: flex;
    gap: 10px;
    margin: 1rem 0;
}

.timer-unit {
    background: white;
    border: 1px solid var(--clr-border-glass);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: var(--shadow-soft);
}

.speedup-badge {
    background: var(--clr-accent-green);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-fast);
}

.speedup-badge:hover {
    background-color: var(--clr-accent-green-hover);
    transform: scale(1.05);
}

/* --- FRANNIE'S PERSONALIZED REPORT --- */
.ai-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.report-summary-boxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.score-gauge-box {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.gauge-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--clr-accent-green) 0% 85%, #eee 85% 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.gauge-circle::after {
    content: '';
    position: absolute;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: white;
}

.gauge-value {
    position: relative;
    z-index: 10;
    font-size: 1.8rem;
    font-weight: 800;
    font-family: var(--font-brand);
}

.ai-report-details {
    display: grid;
    grid-template-columns: 1.30fr 0.7fr;
    gap: 2rem;
}

.report-analysis-tabs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.analysis-bubble {
    border-left: 4px solid var(--clr-accent-green);
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.analysis-bubble h4 {
    margin-bottom: 4px;
    color: var(--clr-text-dark);
}

.analysis-bubble p {
    font-size: 0.95rem;
    color: #444;
}

/* Custom SVG Chart layouts */
.svg-chart-container {
    height: 200px;
    width: 100%;
    margin-top: 1rem;
    position: relative;
}

.chart-pie-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 180px;
}

/* --- SPEAK WITH COACH --- */
.coach-profile-header {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.coach-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--clr-primary-green);
    box-shadow: var(--shadow-soft);
}

.coach-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whatsapp-chat-box {
    text-align: center;
    padding: 2.5rem;
    border-top: 6px solid #25d366;
    margin-bottom: 2rem;
}

.whatsapp-icon {
    font-size: 4rem;
    color: #25d366;
    margin-bottom: 1rem;
}

.consult-requests-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* --- HEALTH & WELLNESS COMMUNITY --- */
.community-layout {
    display: grid;
    grid-template-columns: 0.25fr 0.75fr;
    gap: 2rem;
}

.community-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-item {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-fast);
}

.cat-item:hover, .cat-item.active {
    background-color: var(--clr-primary-green);
    color: var(--clr-text-light);
    font-weight: 600;
}

.community-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    padding: 1.5rem;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #ccc;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-meta h4 {
    font-size: 0.95rem;
}

.post-meta span {
    font-size: 0.75rem;
    color: #777;
}

.post-body {
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    gap: 2rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    padding-top: 0.8rem;
    font-size: 0.9rem;
    color: #666;
}

.post-action-btn {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.post-action-btn:hover {
    color: var(--clr-accent-green-hover);
}

.comment-section {
    background: rgba(0,0,0,0.02);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-top: 1rem;
}

.comment-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- NOTICE BOARD --- */
.events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.event-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 320px;
    position: relative;
    overflow: hidden;
}

.event-countdown {
    background: var(--clr-accent-green);
    color: var(--clr-text-dark);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    align-self: flex-start;
    margin-bottom: 1rem;
}

/* --- USER PROFILE --- */
.profile-completion-box {
    margin-bottom: 2rem;
}

.completion-bar-wrapper {
    height: 12px;
    background: rgba(0,0,0,0.05);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 6px;
}

.completion-bar-fill {
    height: 100%;
    background-color: var(--clr-accent-green);
    width: 0%;
    transition: width 0.8s ease-in-out;
}

/* --- SUPER ADMIN DASHBOARD --- */
.admin-tab-nav {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid rgba(0,0,0,0.06);
    padding-bottom: 8px;
    margin-bottom: 2rem;
}

.admin-tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-family: var(--font-brand);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-tab-btn.active {
    color: var(--clr-accent-green-hover);
    border-bottom: 2px solid var(--clr-accent-green);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.admin-table th {
    background-color: rgba(0,0,0,0.02);
    font-family: var(--font-brand);
}

/* --- FOOTER --- */
footer {
    background-color: rgba(239, 230, 218, 0.9);
    padding: 2.5rem 5%;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text p {
        max-width: 100%;
    }
    
    .hero-ctas {
        justify-content: center;
    }
    
    .landing-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-grid, .wellness-log-grid, .wellness-log-form, .community-layout, .ai-report-details {
        grid-template-columns: 1fr;
    }
    
    .events-grid, .consult-requests-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 1rem !important;
    }

    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 4% !important;
        width: 100%;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .logo-img {
        height: 34px;
    }

    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        color: #ffffff;
        font-size: 1.5rem;
        cursor: pointer;
        z-index: 110;
        transition: var(--transition-fast);
        outline: none;
    }

    .navbar nav {
        position: fixed;
        inset: 0 0 0 auto;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(13, 190, 133, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 105;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
        box-shadow: -10px 0 30px rgba(0,0,0,0.3);
        border-left: 1px solid rgba(255,255,255,0.1);
        padding: calc(5rem + env(safe-area-inset-top, 0px)) calc(1.5rem + env(safe-area-inset-right, 0px)) calc(1.5rem + env(safe-area-inset-bottom, 0px)) calc(1.5rem + env(safe-area-inset-left, 0px));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        visibility: hidden; /* Prevent side swipe swing */
    }

    .navbar.mobile-nav-active nav {
        transform: translateX(0);
        visibility: visible;
    }

    .mobile-menu-header {
        display: flex !important;
    }

    .mobile-menu-buttons {
        display: block !important;
    }

    .nav-links {
        flex-direction: column;
        gap: 1.8rem;
        align-items: center;
        width: 100%;
        padding: 0;
        margin-top: 1rem;
    }

    .nav-links a {
        color: #ffffff !important;
        font-size: 1.25rem;
        font-weight: 600;
        padding: 0.6rem 0;
        display: block;
    }

    /* Hide desktop version buttons completely on mobile */
    .navbar .nav-buttons {
        display: none !important;
    }

    .navbar.mobile-nav-active .mobile-menu-btn {
        transform: rotate(90deg);
        color: var(--clr-accent-green);
    }
    
    .floating-bg {
        display: none !important;
    }

    .hero-carousel-container {
        height: 400px !important;
    }

    .carousel-card, .carousel-logo-card {
        height: 100% !important;
        width: 100% !important;
    }

    .carousel-logo-card {
        padding: 1.5rem 1.25rem !important;
        gap: 12px !important;
    }

    .carousel-logo-card img {
        width: 140px !important;
    }

    .carousel-logo-card h3 {
        font-size: 1.6rem !important;
    }

    .carousel-logo-card p {
        font-size: 0.85rem !important;
        max-width: 90% !important;
    }

    .landing-stats-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
        gap: 0.8rem !important;
        width: 100% !important;
        margin-top: 2rem !important;
    }

    .stat-card {
        padding: 1.2rem 0.5rem !important;
        min-height: 120px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .stat-icon {
        font-size: 1.6rem !important;
        margin-bottom: 0.2rem !important;
    }

    .stat-num {
        font-size: clamp(1.1rem, 3.8vw, 1.35rem) !important;
    }

    .score-gauge-box {
        padding: 0.8rem !important;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .droplets-container {
        flex-wrap: wrap;
        gap: 16px;
    }
    
    .report-summary-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .meal-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    /* Layout improvements for mobile dashboard and lists */
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .admin-subviews-container {
        padding: 1rem !important;
    }
    .wellness-log-form form {
        padding: 1.2rem !important;
    }

    /* Responsive swipeable tables */
    .admin-table-container, .table-container, .appointments-list, .events-list {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-md);
    }
    .admin-table-container table, .table-container table {
        min-width: 650px;
    }

    /* Touch target specifications - minimum 44x44px */
    .btn, button, input[type="button"], input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem 1.2rem !important;
    }

    /* Fluid typography rules for headers */
    h1, .hero-text h1 {
        font-size: clamp(2rem, 8vw, 3.5rem) !important;
    }
    h2 {
        font-size: clamp(1.6rem, 6vw, 2.5rem) !important;
    }
}

@media (max-width: 600px) {
    .hero-carousel-container {
        height: 330px !important;
    }
    .carousel-card, .carousel-logo-card {
        height: 100% !important;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr !important;
    }
    .dashboard-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}

@media (max-width: 480px) {
    .hero-ctas {
        flex-direction: column !important;
        gap: 0.8rem !important;
        width: 100% !important;
    }
    .hero-ctas .btn, .hero-ctas a {
        width: 100% !important;
        justify-content: center !important;
    }
    .hero-carousel-container {
        height: 280px !important;
    }
    .carousel-logo-card {
        padding: 1rem !important;
        gap: 8px !important;
    }
    .carousel-logo-card img {
        width: 110px !important;
    }
    .carousel-logo-card h3 {
        font-size: 1.25rem !important;
    }
    .carousel-logo-card p {
        font-size: 0.75rem !important;
        max-width: 95% !important;
    }
}

/* Card Branding Watermark */
.card-watermark {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.card-watermark img {
    height: 18px;
    width: auto;
    object-fit: contain;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.card-watermark span {
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--clr-text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
