/* --- Global Reset & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #fdfdfd; /* Slightly off-white background */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: #2E7D32; /* Darker Green for headings */
}

a {
    text-decoration: none;
    color: #4CAF50; /* Primary Green */
}

a:hover {
    color: #388E3C; /* Darker shade of primary green */
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0; /* Adjusted padding, section will handle vertical */
}

section {
    padding: 60px 0;
    border-bottom: 1px solid #e0e0e0;
}
section:last-of-type { /* Ensure main CTA and other last sections don't have bottom border if not needed */
    border-bottom: none;
}

/* --- Navigation Bar --- */
#main-nav {
    background-color: #ffffff;
    padding: 15px 0; /* Padding handled by .nav-container now for centering */
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky; /* Makes nav sticky */
    top: 0;
    z-index: 1000;
}

#main-nav .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%; /* Controls width of nav content */
    max-width: 1100px; /* Max width of nav content */
    margin: 0 auto; /* Centers nav content */
}

#main-nav .logo-container h1 a {
    font-size: 1.8em;
    font-weight: 700;
    color: #2E7D32;
}

#main-nav .nav-links {
    list-style: none;
    display: flex;
}

#main-nav .nav-links li {
    margin-left: 25px;
}

#main-nav .nav-links li a {
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: color 0.3s ease;
}

#main-nav .auth-buttons button {
    margin-left: 15px;
    padding: 10px 18px;
    cursor: pointer;
    border: none;
    border-radius: 25px; /* Pill shaped buttons */
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#main-nav #login-btn {
    background-color: transparent;
    border: 2px solid #4CAF50;
    color: #4CAF50;
}
#main-nav #login-btn:hover {
    background-color: #4CAF50;
    color: white;
}

#main-nav #signup-btn {
    background-color: #4CAF50;
    color: white;
}
 #main-nav #signup-btn:hover {
    background-color: #388E3C;
}

/* --- Hero Section --- */
#hero {
    /* Remember to change this placeholder to a local image: url('../images/hero-background.jpg') */
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3)), url('https://via.placeholder.com/1920x1080.png?text=Lush+Medicinal+Garden') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 100px 0; /* Use container for side padding */
    border-bottom: none; /* Remove border for hero */
}

#hero h2 {
    font-size: 3em; /* Larger headline */
    margin-bottom: 20px;
    color: white;
    font-weight: 700;
}

#hero p {
    font-size: 1.3em;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#hero #hero-cta-btn {
    padding: 15px 35px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #FFC107; /* Accent color - Yellow/Gold */
    color: #333;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-cta-link-button { /* Add the class for better targeting if needed */
    display: inline-block; /* Important for anchor tags to respect padding/margins like buttons */
    padding: 15px 35px;
    font-size: 1.1em;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #333; /* Text color */
    background-color: #FFC107; /* Accent color - Yellow/Gold */
    border: none; /* Anchors don't have borders by default, but good to ensure */
    border-radius: 30px;
    text-decoration: none; /* Remove underline from link */
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#hero #hero-cta-btn:hover,
.hero-cta-link-button:hover {
    background-color: #FFA000; /* Darker accent */
    color: #333; /* Ensure text color remains if needed */
    transform: translateY(-3px);
    text-decoration: none; /* Ensure underline doesn't reappear on hover */
}

#hero #hero-cta-btn:hover {
    background-color: #FFA000; /* Darker accent */
    transform: translateY(-3px);
}

/* --- Introduction Section --- */
#introduction {
    text-align: center;
    background-color: #F0F4F0; /* Light green tint */
}
#introduction h3 {
    font-size: 2.2em;
    margin-bottom: 20px;
}
#introduction p {
    font-size: 1.1em;
    max-width: 750px;
    margin: 0 auto; /* Centering the paragraph */
    color: #555;
}

/* --- Featured Plants Section --- */
#featured-plants h3 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 40px;
}

.plant-cards {
    display: grid; /* Using grid for better alignment */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive columns */
    gap: 30px;
}

.plant-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden; /* To contain image radius */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.plant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.plant-card img {
    width: 100%;
    height: 200px; /* Fixed height for images */
    object-fit: cover; /* Ensures image covers the area */
    display: block;
}

.plant-card-content {
    padding: 20px;
    text-align: center;
    flex-grow: 1; /* Allows content to take available space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.plant-card-content h4 {
    margin: 0 0 10px 0;
    font-size: 1.4em;
    color: #388E3C;
}

.plant-card-content p {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

.plant-card-content a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 20px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}
.plant-card-content a:hover {
    background-color: #388E3C;
    color: white;
}

/* --- "How It Works" Section --- */
#how-it-works {
    background-color: #E8F5E9; /* Lightest green */
}
#how-it-works h3 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 40px;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}
.feature-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}
.feature-item img.feature-icon { /* Placeholder for icons */
    width: 60px;
    height: 60px;
    margin-bottom: 15px;
    /* background-color: #ddd;  Placeholder background if not using actual images */
    /* border-radius: 50%; */
    display: inline-block;
}
.feature-item h4 {
    font-size: 1.5em;
    margin-bottom: 10px;
}
.feature-item p {
    font-size: 1em;
    color: #555;
}

/* --- Call to Action (CTA) Section --- */
#main-cta {
    background-color: #2E7D32; /* Darker Green */
    color: white;
    text-align: center;
    border-bottom: none; /* Ensure no border if it's the last content section */
}
#main-cta h3 {
    font-size: 2.2em;
    margin-bottom: 15px;
    color: white;
}
#main-cta p {
    margin-bottom: 30px;
    font-size: 1.1em;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
#main-cta button {
    padding: 15px 35px;
    font-size: 1.1em;
    cursor: pointer;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.3s ease, background-color 0.3s ease;
}
#main-cta #signup-cta-btn {
    background-color: #FFC107; /* Accent Color */
    color: #333;
}
#main-cta #signup-cta-btn:hover {
    background-color: #FFA000;
    transform: translateY(-3px);
}
#main-cta #browse-cta-btn {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    margin-left: 15px;
}
 #main-cta #browse-cta-btn:hover {
    background-color: white;
    color: #2E7D32;
    transform: translateY(-3px);
}

/* --- Footer --- */
footer {
    background-color: #1B5E20; /* Darkest Green */
    color: #e0e0e0; /* Lighter text for contrast */
    text-align: center;
    padding: 40px 0; /* Use container for side padding */
}
footer p {
    margin: 8px 0;
}
footer a {
    color: #A5D6A7; /* Light green for links */
    margin: 0 10px;
    transition: color 0.3s ease;
}
footer a:hover {
    color: #FFC107; /* Accent color on hover */
}

/* --- Hamburger Menu for Mobile --- */
.menu-toggle {
    display: none; /* Hidden by default on larger screens */
    flex-direction: column;
    cursor: pointer;
    padding: 5px; /* Add some padding for easier clicking */
}
.menu-toggle span {
    height: 3px;
    width: 25px;
    background: #2E7D32;
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Styles for when the mobile menu is active (toggled by JS) */
#main-nav .nav-links.active,
#main-nav .auth-buttons.active {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: white; /* Add background to overlay content */
    position: absolute;
    top: 70px; /* Adjust based on nav height */
    left: 0;
    padding: 10px 0;
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
#main-nav .nav-links.active li,
#main-nav .auth-buttons.active button {
    margin: 10px auto; /* Center items */
    width: 80%;
    text-align: center;
}
#main-nav .auth-buttons.active button {
    display: block; /* Ensure buttons take full width available in their container */
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    #main-nav .nav-links, 
    #main-nav .auth-buttons {
        display: none; /* Initially hide for JS toggle */
    }
    
    #main-nav .nav-container {
         flex-wrap: wrap; 
    }
    .menu-toggle {
        display: flex; /* Show hamburger icon on mobile */
    }

    #hero h2 { font-size: 2.2em; }
    #hero p { font-size: 1.1em; }

    .plant-cards { grid-template-columns: 1fr; } /* Stack cards on mobile */
    .features-grid { grid-template-columns: 1fr; } /* Stack features on mobile */

    #main-cta button {
        display: block;
        width: 80%;
        margin: 10px auto;
    }
    #main-cta #browse-cta-btn {
        margin-left: auto; /* Reset margin for stacked buttons */
    }
    #main-nav .nav-actions-right {
        display: flex;
        align-items: center;
    }
    
    #main-nav .chatbot-icon {
        margin-left: 20px; /* Space between auth buttons and chat icon */
        color: #4CAF50; /* Match primary link color */
        display: flex; /* For aligning SVG if needed */
        align-items: center;
        transition: color 0.3s ease;
    }
    
    #main-nav .chatbot-icon svg {
        width: 28px; /* Control size of SVG */
        height: 28px;
        fill: currentColor; /* SVG inherits color from parent <a> tag */
    }
    
    #main-nav .chatbot-icon:hover {
        color: #388E3C; /* Darker green on hover */
    }
    
    
    /* --- Mobile Menu Adjustments for .nav-actions-right --- */
    /* Styles for when the mobile menu is active (toggled by JS) */
    #main-nav .nav-links.active,
    #main-nav .nav-actions-right.active { /* Updated selector to include .nav-actions-right */
        display: flex;
        flex-direction: column;
        width: 100%;
        background-color: white;
        position: absolute;
        top: 70px; /* Adjust based on nav height */
        left: 0;
        padding: 10px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        align-items: center; /* Center items in the column */
    }
    
    /* Ensure individual items within .nav-actions-right.active are also styled for mobile menu */
    #main-nav .nav-actions-right.active .auth-buttons {
        display: flex;
        flex-direction: column; /* Stack login/signup buttons */
        align-items: center;
        width: 100%; /* Take full width of their container */
    }
    
    #main-nav .nav-actions-right.active .auth-buttons button {
        margin: 8px auto; /* Spacing for stacked buttons */
        width: 80%; /* Consistent button width */
    }
    
    #main-nav .nav-actions-right.active .chatbot-icon {
        margin: 15px auto; /* Spacing for chat icon in mobile menu */
        width: auto; /* Let SVG define its width, centered by parent */
    }
    
    
    /* --- Responsive Adjustments - Ensure .nav-actions-right is hidden initially on mobile --- */
    @media (max-width: 768px) {
        #main-nav .nav-links, 
        #main-nav .nav-actions-right { /* Updated selector */
            display: none; /* Initially hide for JS toggle */
        }
        
        /* ... (other existing @media query styles) ... */
    }

    /* === Plant Detection Page Styles === */
    #detection-page {
        padding-top: 40px;
        padding-bottom: 60px;
    }
    
    .detection-header {
        text-align: center;
        margin-bottom: 40px;
    }
    
    .detection-header h2 {
        font-size: 2.5em;
        margin-bottom: 10px;
    }
    
    .detection-header p {
        font-size: 1.1em;
        color: #555;
        max-width: 700px;
        margin: 0 auto;
    }
    
    .upload-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding: 30px;
        background-color: #f9f9f9;
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.07);
        margin-bottom: 40px;
    }
    
    .upload-button {
        display: inline-block;
        padding: 12px 25px;
        background-color: #4CAF50;
        color: white;
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        border-radius: 25px;
        cursor: pointer;
        transition: background-color 0.3s ease;
        text-align: center;
    }
    
    .upload-button:hover {
        background-color: #388E3C;
    }
    
    #plant-image-upload {
        display: none; /* Hide the default file input */
    }
    
    #image-preview-container {
        margin-top: 10px;
        text-align: center;
        min-height: 50px; /* Reserve some space */
    }
    
    #image-preview {
        max-width: 100%;
        max-height: 300px;
        border-radius: 8px;
        border: 2px dashed #ccc;
        padding: 5px;
        object-fit: contain; /* Ensure the whole image is visible */
    }
    
    #image-name {
        display: block;
        margin-top: 8px;
        font-style: italic;
        color: #777;
    }
    
    #detect-plant-btn {
        padding: 12px 30px;
        font-size: 1.1em;
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        background-color: #FFC107; /* Accent color */
        color: #333;
        border: none;
        border-radius: 25px;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.2s ease;
    }
    
    #detect-plant-btn:disabled {
        background-color: #e0e0e0;
        color: #999;
        cursor: not-allowed;
    }
    
    #detect-plant-btn:not(:disabled):hover {
        background-color: #FFA000;
        transform: translateY(-2px);
    }
    
    .results-section {
        margin-top: 30px;
        padding: 20px;
        background-color: #f0f4f0;
        border-radius: 12px;
    }
    
    .results-section h3 {
        text-align: center;
        margin-bottom: 25px;
        font-size: 2em;
    }
    
    #loading-indicator {
        text-align: center;
        padding: 20px;
    }
    
    .spinner {
        border: 6px solid #f3f3f3; /* Light grey */
        border-top: 6px solid #4CAF50; /* Primary Green */
        border-radius: 50%;
        width: 50px;
        height: 50px;
        animation: spin 1s linear infinite;
        margin: 20px auto;
    }
    
    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    .result-content-grid {
        display: grid;
        grid-template-columns: 1fr; /* Stack by default */
        gap: 30px;
        align-items: flex-start; /* Align items to the top of their grid cell */
    }
    
    @media (min-width: 768px) {
        .result-content-grid {
            grid-template-columns: 1fr 1.5fr; /* Two columns on larger screens */
        }
    }
    
    .model-placeholder, .info-placeholder {
        padding: 15px;
        background-color: #fff;
        border-radius: 8px;
        box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    }
    
    .model-placeholder p strong, .info-placeholder p strong {
        display: block;
        margin-bottom: 10px;
        font-size: 1.2em;
        color: #2E7D32;
    }
    
    #3d-model-area img {
        width: 100%;
        height: auto;
        border-radius: 6px;
        background-color: #e9e9e9; /* Placeholder background */
    }
    
    #plant-name-result {
        font-size: 1.8em;
        color: #388E3C;
        margin-bottom: 20px;
        text-align: center;
    }
    
    #plant-description-result {
        line-height: 1.8;
        color: #444;
    }
    
    #not-medicinal-message, #error-message {
        text-align: center;
        padding: 20px;
        background-color: #fff3cd; /* Light yellow for info/warning */
        border: 1px solid #ffeeba;
        color: #856404;
        border-radius: 8px;
    }
    
    #error-message {
        background-color: #f8d7da; /* Light red for error */
        border-color: #f5c6cb;
        color: #721c24;
    }

    
}
