:root {
    --green-main: #355c34;
    --green-dark: #2f6b3a;
    --green-light: #eaf7e8;
    --green-card: #cfeccc;
    --text-dark: #1a2715;
    --bg: #d7e7d3;
    --at-secondary: #4f7f5a; /* Added missing variable for landing page gradient */
}

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

body {
    margin: 0;
    padding: 0;
    color: #203421;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden; /* Prevents global horizontal stretching */
}

/* Farm BG - Full screen background for main containers with parallax */
.farm-bg {
    position: relative;
    min-height: 100vh !important;
    background-image: url('/static/farm-bg.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: scroll !important;
}

.farm-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 60, 30, 0.4) 0%, rgba(45, 90, 63, 0.35) 100%);
    z-index: 1;
}

.farm-bg > * {
    position: relative;
    z-index: 2;
}

/* ================= HEADER ================= */
.home-page header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 70px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.home-page header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.home-page header .logo h3 {
    color: var(--green-main);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
}

.logo img,
#loginModal .modal-box img,
#signupModal .modal-box img {
    width: 100px;
    height: auto;
    display: block;
}

header .logo img {
    width: 90px;
    height: auto;
}

nav button {
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid var(--green-main);
    background: transparent;
    color: var(--green-main);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
}

nav button:hover {
    background: var(--green-main);
    color: #fff;
}

nav .primary {
    background: var(--green-main);
    color: #fff;
}

nav .primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
}

/* CTA Buttons in Hero */
.cta-buttons {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-buttons button {
    padding: 14px 32px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.cta-buttons .btn-primary {
    background: var(--green-main);
    color: #fff;
    border: 2px solid var(--green-main);
}

.cta-buttons .btn-primary:hover {
    background: var(--green-dark);
    border-color: var(--green-dark);
    transform: translateY(-2px);
}

.cta-buttons .btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.cta-buttons .btn-outline:hover {
    background: #fff;
    color: var(--green-main);
}

/* ================= HERO ================= */
.hero {
    text-align: center;
    padding: 120px 20px 80px;
    min-height: auto;
    z-index: 2;
    background: rgba(255, 255, 255, 0.15) !important;
}

.hero h1 {
    font-size: 52px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 25px;
    line-height: 1.2;
}

.hero p {
    max-width: 750px;
    margin: auto;
    font-size: 20px;
    line-height: 1.6;
    color: #ffffff;
}

.hero span {
    margin-top: 35px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
}

/* ================= SECTIONS ================= */
section {
    padding: 80px 90px;
}

.section-title {
    text-align: center;
    margin-bottom: 55px;
}

.section-title h2 {
    font-size: 48px !important;
    margin-bottom: 12px;
    font-weight: 800;
    color: #ffffff !important;
    text-shadow: 3px 3px 6px #000000, -3px -3px 6px #000000, 3px -3px 6px #000000, -3px 3px 6px #000000;
}

.section-title p {
    font-size: 20px;
    color: #ffffff !important;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 2px 2px 4px #000000;
}

/* ================= FEATURES ================= */
.features {
    padding: 80px 90px;
    background: transparent !important;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: #ffffff !important;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 220px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #2D5A43;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 28px;
    color: #fff;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 700;
    color: #2D5A43;
}

.feature-card p {
    font-size: 15px;
    line-height: 1.6;
    color: #6b7280;
    max-width: 260px;
    text-align: center;
}

/* ================= HOW IT WORKS ================= */
.how-it-works {
    padding: 80px 90px;
    background: transparent !important;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.step-card {
    background: #ffffff !important;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: none;
    text-align: center;
}

.step-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2D5A43;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 24px;
    margin: 0 auto 20px;
}

.step-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 700;
    color: #2D5A43;
}

.step-card p {
    font-size: 15px;
    line-height: 1.6;
    color: #6b7280;
}

/* ================= FOOTER ================= */
footer {
    text-align: center;
    padding: 30px 25px;
    background: #355c34;
    color: #fff;
    font-size: 14px;
}

footer p {
    margin: 0;
}

footer a {
    color: #8bc34a;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/*========== MODAL =============*/
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-box {
    background: rgba(255, 255, 255, 0.7);
    padding: 30px;
    width: 320px;
    border-radius: 14px;
    position: relative;
}

.modal-box h2 {
    margin-bottom: 15px;
}

.modal-box input {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
}

.modal-box button {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    background: var(--green-main);
    color: white;
    border: none;
    cursor: pointer;
}

.close {
    text-align: right;
    cursor: pointer;
    font-size: 14px;
}

/*=============== AUTH PAGE STYLE =============*/
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: rgba(247, 255, 246, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
    position: relative;
}

.auth-card .close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #777;
}

.auth-card img {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.auth-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--green-dark);
}

.auth-card p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.auth-card form {
    text-align: left;
}

.auth-card label {
    display: block;
    margin: 15px 0 5px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
}

.auth-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f8f8;
    font-size: 16px;
    margin-bottom: 10px;
}

.auth-card button {
    width: 100%;
    margin-top: 20px;
    padding: 14px;
    background: var(--green-main);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-card button:hover {
    background: var(--green-dark);
}

.auth-card .links {
    margin-top: 20px;
    font-size: 14px;
}

.auth-card .terms {
    font-size: 14px;
    color: #777;
    margin-top: 20px;
}

@media (min-width: 768px) {
    .auth-card {
        max-width: 600px;
        padding: 50px;
    }
}

/* ================= DASHBOARD LAYOUT (FIXED) ================= */
.dashboard-container { 
    display: flex; 
    min-height: 100vh; 
    width: 100%;
    background: var(--green-light); /* Override landing page background */
    position: relative;
    z-index: 5;
}

.dashboard-sidebar { 
    width: 260px; 
    min-width: 260px;
    background: var(--green-main); 
    color: #fff; 
    display: flex; 
    flex-direction: column; 
    padding: 20px; 
    height: 100vh;
    position: sticky;
    top: 0;
}

.dashboard-sidebar .logo { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    margin-bottom: 40px; 
}

.dashboard-sidebar .logo .logo-img { width: 100px; height: auto; }

.dashboard-sidebar .logo h2 { font-size: 30px; color: var(--green-light); margin: 0; }

.dashboard-sidebar a { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 12px; 
    color: #e6f5ea; 
    text-decoration: none; 
    border-radius: 8px; 
    margin-bottom: 8px; 
    transition: background 0.2s; 
}

.dashboard-sidebar a.active, .dashboard-sidebar a:hover { background: var(--green-dark); }

.dashboard-sidebar .account { 
    margin-top: auto; 
    font-size: 14px; 
    opacity: 0.8; 
    text-align: center; 
    padding-top: 20px; 
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
}

.dashboard-main { 
    flex-grow: 1; 
    min-width: 0; /* Important fix for flex-child grid overflow */
    padding: 30px; 
    background: var(--green-light); 
}

.dashboard-topbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    padding-bottom: 15px; 
    border-bottom: 2px solid var(--green-card); 
}

/* ================= DASHBOARD TABLES ================= */
.data-table-container { width: 100%; overflow-x: auto; }

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-bottom: 20px; 
    background: #fff; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    border-radius: 8px;
    overflow: hidden;
}

.data-table th, .data-table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }

.data-table th { 
    background: var(--green-main); 
    color: #fff; 
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.data-table tr:hover { background: var(--green-light); }
.data-table tr:nth-child(even) { background: #fafafa; }

/* ================= DASHBOARD HEADINGS ================= */
.dashboard-content h2 { 
    color: var(--green-dark); 
    margin-top: 30px; 
    margin-bottom: 15px; 
    font-size: 24px;
    font-weight: 600;
    border-left: 4px solid var(--green-main);
    padding-left: 12px;
}

.dashboard-content h2:first-child { margin-top: 0; }

/* ================= STAT CARDS ================= */
.stats-row { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 20px; 
    margin-bottom: 25px; 
    width: 100% !important;
    max-width: 100% !important;
}

@media (max-width: 900px) {
    .stats-row { 
        grid-template-columns: repeat(2, 1fr) !important; 
    }
}

@media (max-width: 600px) {
    .stats-row { 
        grid-template-columns: 1fr !important; 
    }
}

.stat-card { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px; 
    background: #fff; 
    border-radius: 10px; 
    border-left: 5px solid transparent; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

.stat-card.green { border-left-color: #2D5A27; }
.stat-card.blue { border-left-color: #00CFE8; }
.stat-card.orange { border-left-color: #FF9F43; }
.stat-label { color: #888; font-size: 0.9rem; font-weight: 600; text-transform: uppercase; }
.stat-value { font-size: 1.8rem; margin: 5px 0 0 0; color: #333; }
.stat-icon-box { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }

.green .stat-icon-box { background: #e8f5e9; color: #2d5a27; }
.blue .stat-icon-box { background: #e0f7fa; color: #00cfe8; }
.orange .stat-icon-box { background: #fff3e0; color: #ff9f43; }

/* ================= CHARTS SECTION ================= */
.charts-section { 
    display: grid; 
    grid-template-columns: 2fr 1fr; 
    gap: 20px; 
    margin-bottom: 25px; 
}

.chart-card, .weather-card { background: #fff; padding: 20px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.chart-container { height: 250px; }
.weather-days { display: flex; flex-direction: column; gap: 15px; }
.day-item { display: flex; align-items: center; gap: 15px; }
.day-name { width: 40px; font-weight: 600; }
.temp { color: #666; }

/* ================= PREDICTION GRID ================= */
.prediction-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 15px; 
    margin-bottom: 25px; 
}

.crop-card { background: #fff; padding: 15px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.crop-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.crop-header i { color: #2D5A27; }
.crop-header h4 { margin: 0; }
.progress-container { width: 100%; height: 6px; background: #eee; border-radius: 10px; margin-bottom: 8px; }
.progress-bar { height: 100%; background: #2D5A27; border-radius: 10px; }
.percent { font-size: 0.85rem; color: #666; }
.crop-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 0.85rem; color: #888; }

/* ================= TABLES GRID ================= */
.tables-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.card-header h3 { margin: 0; }
.view-all { color: #2D5A27; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.view-all:hover { text-decoration: underline; }

/* ================= STATUS PILLS ================= */
.status-pill { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.status-pill.pending { background: #fff3e0; color: #ff9f43; }
.status-pill.accepted { background: #e8f5e9; color: #2d5a27; }
.status-pill.rejected { background: #ffebee; color: #c62828; }

.badge { background: #c62828; color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; margin-left: 5px; }
.empty-msg { text-align: center; color: #999; padding: 20px; font-style: italic; }

/* ================= PROFILE CARD ================= */
.profile-card { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--text-dark); font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
.btn-submit { background: var(--green-main); color: #fff; border: none; padding: 12px 24px; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: 500; }
.btn-submit:hover { background: var(--green-dark); }

/* ================= HOME PAGE (PUBLIC LANDING) ================= */
.home-page { min-height: 100vh; position: relative; overflow-x: hidden; }

.home-page::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
}

.home-page header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 5px 60px 5px;
    position: relative; 
    z-index: 10; 
    background: transparent;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 8px 16px rgba(0,0,0,0.3);
}

.home-page .logo { display: flex; flex-direction: row; align-items: center; gap: 0; }
.home-page .logo h3 { color: #355c34; font-size: 32px; font-weight: 700; letter-spacing: 1px; }
.home-page .logo img { width: 120px; height: auto; }

.home-page nav { display: flex; gap: 12px; }
.home-page nav button { padding: 12px 26px; border-radius: 10px; border: 2px solid #355c34; background: transparent; color: #355c34; cursor: pointer; transition: all 0.3s; font-weight: 600; font-size: 15px; }
.home-page nav button:hover { background: #355c34; color: #ffffff; border-color: #355c34; }
.home-page nav button.primary { background: #355c34; color: #ffffff; border-color: #355c34; }
.home-page nav button.primary:hover { background: #2f6b3a; }

/* Landing Hero Section */
.home-page .hero { text-align: center; padding: 140px 20px 80px; position: relative; z-index: 1; min-height: calc(100vh - 80px); display: flex; flex-direction: column; justify-content: center; align-items: center; max-width: 100%; overflow: hidden; background: transparent; }
.home-page .hero .hero-content { max-width: 900px; width: 100%; }
.home-page .hero h1 { font-size: 56px; color: #355c34; margin-bottom: 20px; line-height: 1.2; max-width: 800px; margin-left: auto; margin-right: auto; }
.home-page .hero p { color: #fff; font-size: 22px; max-width: 750px; margin: 0 auto 0; line-height: 1.6; text-shadow: 2px 2px 4px rgba(0,0,0,0.8), -1px -1px 2px rgba(0,0,0,0.8); }
.home-page .hero .cta-buttons { display: flex; justify-content: center; gap: 20px; margin-top: 40px; flex-wrap: wrap; }
.home-page .hero .cta-buttons a { padding: 16px 36px !important; font-size: 17px !important; border-radius: 10px !important; cursor: pointer; transition: all 0.3s; font-weight: 600 !important; text-decoration: none !important; display: inline-block !important; }
.home-page .hero .btn-primary { background-color: #355c34 !important; color: #ffffff !important; border: none !important; }
.home-page .hero .btn-primary:hover { transform: translateY(-3px); }
.home-page .hero .btn-outline { background-color: #fff !important; color: #355c34 !important; border: 2px solid #355c34 !important; }
.home-page .hero .btn-outline:hover { background-color: #355c34 !important; color: #ffffff !important; border-color: #355c34 !important; }

/* Features Section (Home) */
.home-page .features { 
    background: url('/static/farm-bg.png') no-repeat center center; 
    background-size: cover;
    background-attachment: fixed;
    padding: 80px 30px; 
    position: relative; 
}
.home-page .features::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}
.home-page .features > * {
    position: relative;
    z-index: 2;
}
.home-page .section-title { text-align: center; margin-bottom: 50px; max-width: 800px; margin-left: auto; margin-right: auto; }
.home-page .section-title h2 { font-size: 38px; color: var(--green-dark); margin-bottom: 15px; text-shadow: 2px 2px 4px rgba(0,0,0,0.8), -1px -1px 2px rgba(0,0,0,0.8); }
.home-page .section-title p { font-size: 18px; color: #355c34; max-width: 650px; margin: 0 auto; line-height: 1.6; text-shadow: 2px 2px 4px rgba(0,0,0,0.8), -1px -1px 2px rgba(0,0,0,0.8); }
.home-page .features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.home-page .feature-card { background: rgba(255, 255, 255, 0.9); padding: 40px 30px; border-radius: 16px; text-align: center; transition: all 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.08); border: 1px solid rgba(60, 124, 59, 0.15); }
.home-page .feature-card:hover { transform: translateY(-6px); box-shadow: 0 12px 30px rgba(0,0,0,0.12); }
.home-page .feature-icon { width: 75px; height: 75px; margin: 0 auto 22px; background: var(--green-main); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; color: white; }
.home-page .feature-card h3 { font-size: 21px; color: var(--green-dark); margin-bottom: 14px; font-weight: 600; }
.home-page .feature-card p { font-size: 15px; color: #555; line-height: 1.6; }

/* How It Works Section */
.home-page .how-it-works { 
    background: url('/static/farm-bg.png') no-repeat center center; 
    background-size: cover;
    background-attachment: fixed;
    padding: 80px 30px; 
    position: relative;
}
.home-page .how-it-works::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}
.home-page .how-it-works > * {
    position: relative;
    z-index: 2;
}
.home-page .how-it-works .section-title { max-width: 800px; margin-left: auto; margin-right: auto; }
.home-page .steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 35px; max-width: 1100px; margin: 0 auto; }
.home-page .step-card { text-align: center; padding: 40px 30px; background: var(--green-light); border-radius: 16px; }
.home-page .step-number { width: 60px; height: 60px; margin: 0 auto 22px; background: var(--green-main); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; }
.home-page .step-card h3 { font-size: 22px; color: var(--green-dark); margin-bottom: 14px; font-weight: 600; }
.home-page .step-card p { font-size: 15px; color: #555; line-height: 1.6; }

/* Footer */
.home-page footer { background: var(--green-dark); color: white; padding: 35px 50px; text-align: center; }
.home-page footer p { margin: 0; font-size: 15px; }
.home-page footer a { color: #8bc34a; text-decoration: none; }
.home-page footer a:hover { text-decoration: underline; }

/* ========== RESPONSIVE STYLES FOR LANDING PAGE ========== */
@media (max-width: 992px) {
    .home-page .features-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;
    }
    
    .home-page .steps-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .home-page header {
        padding: 15px 20px;
    }
    
    .home-page .logo h3 {
        font-size: 18px;
    }
    
    .home-page .logo img {
        width: 38px;
    }
    
    .home-page nav button {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .home-page .hero {
        padding: 120px 15px 50px;
    }
    
    .home-page .hero h1 {
        font-size: 32px;
        padding: 0 10px;
    }
    
    .home-page .hero p {
        font-size: 16px;
        padding: 0 10px;
    }
    
    .home-page .cta-buttons {
        flex-direction: column;
        align-items: center;
        padding: 0 20px;
    }
    
    .home-page .cta-buttons a {
        width: 100%;
        max-width: 240px;
        text-align: center;
    }
    
    .home-page .features, 
    .home-page .how-it-works {
        padding: 50px 15px;
    }
    
    .home-page .section-title h2 {
        font-size: 26px;
    }
    
    .home-page .section-title p {
        font-size: 15px;
    }
    
    .home-page .features-grid, 
    .home-page .steps-grid {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    
    .home-page footer {
        padding: 25px 15px;
    }
}

@media (max-width: 480px) {
    .home-page .hero h1 {
        font-size: 26px;
    }
    
    .home-page .hero p {
        font-size: 14px;
    }
    
    .home-page nav button.primary {
        display: none;
    }
}
.home-page footer a { color: white; text-decoration: underline; }

/* ================= PREMIUM CALENDAR STYLES ================= */
.calendar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.calendar-modal-content {
    background: white;
    border-radius: 14px;
    width: 340px;
    padding: 20px;
}

.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; cursor: pointer; font-size: 14px; }
.calendar-day.planting { background-color: #e8f5e0; font-weight: bold; }
.calendar-day.harvest { background-color: #fff8e1; font-weight: bold; }

/* ================= ADVANCED CROP PREDICTION GRID ================= */
.crop-prediction-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    width: 100%;
}

.prediction-card {
    background: #f0f9eb;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #b7d5b0;
    transition: transform 0.2s;
}

.prediction-card:hover { transform: translateY(-2px); }

/* ================= GRID SYSTEM FIXES ================= */
.top-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
}

.bottom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

/* ================= RESPONSIVE ADJUSTMENTS ================= */
@media (max-width: 1100px) {
    .charts-section, .top-grid, .tables-grid { grid-template-columns: 1fr; }
    .home-page .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    header, section { padding: 20px; }
    .dashboard-container { flex-direction: column; }
    .dashboard-sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
    }
    .dashboard-main { padding: 15px; }
    .home-page .features-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .home-page .steps-grid { grid-template-columns: 1fr; }
    .home-page .hero h1 { font-size: 32px; }
    .home-page .hero p { font-size: 16px; }
    .home-page .hero { padding: 50px 20px 60px; }
    .home-page .section-title h2 { font-size: 28px; }
    .home-page header { padding: 15px 20px; }
    .home-page .logo h3 { font-size: 22px; }
    .home-page .features, .home-page .how-it-works { padding: 50px 20px; }
}

@media (max-width: 480px) {
    .home-page .features-grid { grid-template-columns: 1fr; }
    .home-page .hero .cta-buttons { flex-direction: column; }
    .home-page .hero .cta-buttons a { width: 100%; }
    .stats-row { grid-template-columns: 1fr; }
    .home-page .feature-card { padding: 25px 20px; }
}

/* Modal Close Fix */
#signupModal .modal-box .close,
#loginModal .modal-box .close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
}

/* Overlay Utility */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}
.overlay.show { display: flex; }