/* --- General Styling & Variables --- */
:root {
    --primary-green: #2E7D32;
    --deep-green: #1B5E20;
    --light-green: #E8F5E9;
    --text-dark: #212121;
    --text-light: #FAFAFA;
    --background-color: #FFFFFF;
    --card-background: #F1F8E9;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-dark);
}

/* --- Header & Navigation --- */
header {
    background-color: var(--background-color);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.leaf-icon {
    font-size: 2rem;
    color: var(--primary-green);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deep-green);
    text-decoration: none;
    margin-left: 0.5rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-green);
}

/* --- Buttons --- */
.btn-primary {
    background-color: var(--deep-green);
    color: var(--text-light);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-primary:hover {
    background-color: #003300;
    transform: translateY(-2px);
}

.btn-large {
    font-size: 1.1rem;
    font-weight: bold;
}

.btn-secondary {
    background: none;
    border: 2px solid var(--deep-green);
    color: var(--deep-green);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.btn-secondary:hover {
    background-color: var(--deep-green);
    color: var(--text-light);
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

/* --- Sections --- */
section {
    padding: 4rem 10%;
}

/* Hero Section */
#home {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--light-green);
}

.hero-content h1 {
    font-size: 3rem;
    color: var(--deep-green);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 1rem auto 2rem;
}

/* Calculator Section */
#calculator {
    background-color: var(--background-color);
    text-align: center;
}

.user-type-selector {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.user-type-card {
    background-color: var(--light-green);
    padding: 2rem;
    border-radius: 12px;
    cursor: pointer;
    width: 250px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.user-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.user-type-card .icon {
    font-size: 3rem;
}

/* Forms */
.calculator-form {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-top: 3rem;
    text-align: left;
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--light-green);
    margin-bottom: 2rem;
}

.tab-link {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #9E9E9E;
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    color: var(--primary-green);
    border-bottom-color: var(--primary-green);
}

.tab-content {
    animation: fadeIn 0.5s;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input, .form-group select {
    padding: 0.75rem;
    border: 1px solid #BDBDBD;
    border-radius: 8px;
    font-size: 1rem;
}

/* Consumption Tab Specifics */
.product-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.remove-product-btn {
    background-color: #ef5350;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-weight: bold;
    cursor: pointer;
}

.full-width {
    grid-column: 1 / -1;
}

/* Dashboard & Results Section */
#dashboard {
    background-color: var(--light-green);
    padding: 2rem;
    border-radius: 12px;
    text-align: left;
    animation: fadeIn 0.8s;
}

#dashboard h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: var(--deep-green);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-container canvas {
    max-width: 500px;
    margin: 0 auto;
}

/* Blogs Section */
#blogs {
    background-color: var(--card-background);
    text-align: center;
}

.blogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: left;
    margin-top: 2rem;
}

.blog-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.blog-card h3 {
    color: var(--primary-green);
}

.blog-card a {
    color: var(--deep-green);
    font-weight: 600;
    text-decoration: none;
}

/* Ad Placeholder */
.ad-placeholder {
    padding: 2rem;
    background-color: #e0e0e0;
    text-align: center;
    margin: 2rem 10%;
    border-radius: 8px;
    border: 2px dashed #9E9E9E;
}
.ad-placeholder p {
    margin: 0;
    color: #616161;
    font-weight: 600;
}

/* --- Footer & Subscription --- */
footer {
    background-color: var(--deep-green);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 5%;
}

#subscription {
    background-color: var(--primary-green);
    padding: 3rem 10%;
    text-align: center;
    color: var(--text-light);
}
#subscription h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
#subscription p {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
.subscription-form {
    display: flex;
    justify-content: center;
    gap: 1rem;
}
.subscription-form input {
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    width: 300px;
}

/* --- Modals (Login/Sign Up) --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #9E9E9E;
    cursor: pointer;
}

.modal-form input {
    width: calc(100% - 2rem);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #BDBDBD;
    border-radius: 8px;
}
.modal-form p {
    text-align: center;
    margin-top: 1rem;
}
.modal-form a {
    color: var(--primary-green);
    font-weight: 600;
    cursor: pointer;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 900px) {
    .nav-links, .auth-buttons { display: none; } /* In a real app, you'd add a hamburger menu */
    .form-grid { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr; }
    section { padding: 3rem 5%; }
    .subscription-form { flex-direction: column; align-items: center; }
    .subscription-form input { width: 100%; max-width: 300px; }
}