:root {
    /* Color Palette */
    --primary-green: #6BAF92;
    --secondary-green: #A7D7C5;
    --dark-green: #4A8B71;
    --earth-brown: #E8DCCB;
    --dark-brown: #8D7B68;
    --sky-blue: #CDE7F0;
    --text-dark: #2C3E50;
    --text-light: #F7F9F9;
    --white: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, 0.8);

    /* Spacing & Radius */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-soft: 0 10px 30px rgba(107, 175, 146, 0.15);
    --shadow-hover: 0 15px 35px rgba(107, 175, 146, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--earth-brown);
    background: linear-gradient(135deg, #fdfbf7 0%, #e8dccb 100%);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    /* Prevent scroll initially */
    position: relative;
}

/* Background Particles */
.bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    pointer-events: none;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10vh) translateX(20px);
        opacity: 0;
    }
}

h1,
h2,
h3,
h4 {
    font-family: 'Poppins', sans-serif;
    color: var(--dark-green);
}

/* --- Landing Page --- */
.landing-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
    background: linear-gradient(to bottom, var(--sky-blue), var(--earth-brown));
}

.landing-content {
    z-index: 2;
    opacity: 0;
    /* Animate in */
    transform: translateY(20px);
}

.hero-logo {
    margin-bottom: 2rem;
    filter: drop-shadow(0 5px 15px rgba(107, 175, 146, 0.4));
}

.landing-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 2.5rem;
    color: var(--dark-green);
}

.primary-btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--white);
    background-color: var(--primary-green);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    background-color: var(--dark-green);
}

/* --- Dashboard --- */
.dashboard-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    pointer-events: none;
    /* Disable interaction when hidden */
    transition: opacity 0.8s ease;
}

.dashboard-container.active {
    opacity: 1;
    pointer-events: all;
}

.hidden {
    display: none;
}

/* Top Bar */
.top-bar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.brand {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--dark-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    background-color: var(--secondary-green);
    color: var(--dark-green);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Garden Canvas */
.garden-section {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(to bottom, #eefcfc 0%, #fdfbf7 100%);
}

.garden-canvas {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

#garden-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Controls & Metrics */
.controls-container {
    background: var(--white);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    padding: 2rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 20;
}

.actions-panel h3,
.metrics-panel h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-brown);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.action-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    justify-content: center;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background-color: var(--secondary-green);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    flex-shrink: 0;
}

.action-btn .icon {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.action-btn .label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--dark-green);
}

.action-btn:hover {
    transform: scale(1.1);
    background-color: var(--primary-green);
}

.action-btn:hover .label {
    color: var(--white);
}

.action-btn:active {
    transform: scale(0.95);
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.ring-container {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 251;
    /* 2 * pi * 40 */
    stroke-dashoffset: 251;
    /* Start empty */
    transition: stroke-dashoffset 1s ease-out;
}

.co2-ring {
    stroke: var(--dark-green);
}

.water-ring {
    stroke: var(--sky-blue);
}

.energy-ring {
    stroke: #F4D03F;
}

.metric-value {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: var(--text-dark);
}

.metric-value .unit {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--dark-brown);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--dark-brown);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .landing-content h1 {
        font-size: 2rem;
        padding: 0 1rem;
    }

    .controls-container {
        padding: 1.5rem;
    }

    .action-grid {
        justify-content: flex-start;
    }

    .metrics-grid {
        gap: 0.5rem;
    }

    .ring-container {
        width: 60px;
        height: 60px;
    }

    .metric-value {
        font-size: 0.9rem;
    }
}

/* Interactivity */
.cursor-plant {
    cursor: crosshair;
    /* Fallback */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="%236BAF92" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 19V6M5 12l7-7 7 7"/></svg>') 16 16, auto;
}

.tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
    color: var(--dark-green);
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -100%);
    margin-top: -10px;
    font-weight: 600;
    border: 1px solid var(--secondary-green);
}

.toast {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-green);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 50;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Plant Hover Effect */
#plant-layer g {
    transition: filter 0.3s ease;
    cursor: pointer;
}

#plant-layer g:hover {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
}

/* --- New Garden Elements --- */

/* River */
.river-path {
    fill: none;
    stroke: #4FC3F7;
    stroke-width: 0;
    /* Starts invisible */
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px rgba(79, 195, 247, 0.6));
    transition: stroke-width 2s ease;
}

.river-flow {
    animation: flowRiver 3s infinite linear;
}

@keyframes flowRiver {
    0% {
        stroke-dashoffset: 100;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* Trees */
.tree-trunk {
    fill: #8D7B68;
}

.tree-foliage {
    fill: #2E7D32;
    filter: drop-shadow(2px 2px 0px rgba(0, 0, 0, 0.1));
}

/* Animals / Sky Elements */
.sun {
    fill: #FDB813;
    filter: drop-shadow(0 0 20px rgba(253, 184, 19, 0.6));
    transition: transform 1s ease;
}

.cloud {
    fill: #FFFFFF;
    opacity: 0.8;
    filter: blur(1px);
}

.bird {
    fill: #333;
}

.flower {
    fill: #E91E63;
}

/* Animations */
@keyframes floatCloud {
    from {
        transform: translateX(-100px);
    }

    to {
        transform: translateX(900px);
    }
}

@keyframes flyBird {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(20px, -10px) scale(0.9);
    }

    100% {
        transform: translate(40px, 0) scale(1);
    }
}