/* Custom Sky Blue & White Theme for AgroNook */

/* 1. Color Palette & Core Styles
-------------------------------------------------- */
:root {
    --agronook-primary: #87CEEB; /* A nice Sky Blue */
    --agronook-primary-dark: #4682B4; /* A slightly darker blue for hover */
    --agronook-secondary: #6c757d; /* Standard gray */
    --agronook-light: #ffffff; /* Pure white for backgrounds */
    --agronook-dark: #343a40; /* Dark text color */
    --agronook-accent: #ffc107; /* Warm yellow for accents */
}

/* Primary Color: Green */
.text-primary-agronook {
    color: var(--agronook-primary) !important;
}
.bg-primary-agronook {
    background-color: var(--agronook-primary) !important;
}
.btn-primary-agronook {
    color: white;
    background-color: var(--agronook-primary);
    border-color: var(--agronook-primary);
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Add initial shadow */
}
.btn-primary-agronook:hover {
    background-color: var(--agronook-primary-dark);
    border-color: var(--agronook-primary-dark);
    transform: translateY(-2px);
}
.btn-outline-primary-agronook {
    transition: all 0.3s ease;
    color: var(--agronook-primary);
    border-color: var(--agronook-primary);
}
.btn-outline-primary-agronook:hover {
    color: white;
    background-color: var(--agronook-primary);
}
.btn-outline-primary-agronook:hover {
    transform: translateY(-2px);
}

/* Success/Accent Color */
.text-success-agronook {
    color: var(--agronook-primary) !important;
}
.bg-success-agronook {
    background-color: var(--agronook-primary) !important;
}

body {
    font-family: 'Poppins', sans-serif; /* A modern, clean font */
    color: var(--agronook-dark);
    padding-top: 10px; /* Adjust for new, shorter header height */
}
.navbar-nav .nav-link:hover {
    color: var(--agronook-primary) !important;
}

/* 2. Section Styling
-------------------------------------------------- */
.section-title {
    margin-bottom: 4rem;
}
.section-title h2 {
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}
.section-title h2::after {
    content: '';
    position: absolute;
    display: block;
    width: 60px;
    height: 4px;
    background: var(--agronook-primary);
    bottom: 0;
    left: calc(50% - 30px);
}

/* Hero Section Styling (Home Page) */
.hero-section {
    /* Explicitly define each background property for better compatibility */
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://media.istockphoto.com/id/1903501938/photo/photo-collages-of-diverse-plants-crops-aesthetics-and-researcher.webp?a=1&b=1&s=612x612&w=0&k=20&c=YraVl2CkgC-vPiIWWUolG3QXABUmToubTiGmklFweIU=');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    color: white;
    min-height: 60vh; /* Give the section a minimum height to show the background image */
}

/* Features Section */
.feature-box {
    padding: 30px;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle initial shadow */
    border: 1px solid #eee;
}
.feature-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

/* Product Card Styling */
.product-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle initial shadow */
    transition: all 0.3s ease;
    border: 1px solid #eee;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Category Card Styling */
.category-card {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle initial shadow */
    position: relative;
    display: block;
    color: white;
}
.category-card img {
    transition: transform 0.5s ease;
}
/* Hover effect already present */
.category-card:hover img {
    transform: scale(1.1);
}
.category-card .category-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: background 0.3s ease;
}

/* Testimonial Section */
.testimonial-card {
    background-color: var(--agronook-light);
    border-left: 5px solid var(--agronook-primary);
}
.testimonial-card .customer-name {
    font-weight: 600;
    color: var(--agronook-dark);
}

/* 3. New Homepage Sections
-------------------------------------------------- */

/* Why Choose Us Section */
.why-choose-us ul {
    list-style: none;
    padding: 0;
}
.why-choose-us ul li {
    padding-left: 35px;
    position: relative;
    margin-bottom: 20px;
}
.why-choose-us ul li i {
    position: absolute;
    left: 0;
    top: 5px;
    font-size: 22px;
    color: var(--agronook-primary);
}

/* How It Works Section */
.how-it-works .row {
    position: relative;
}

/* The connecting line - only on larger screens */
@media (min-width: 768px) {
    .how-it-works .row::after {
        content: '';
        position: absolute;
        width: 66%; /* Span between the centers of the first and last icons */
        top: 40px; /* Position it vertically in the middle of the icons */
        left: 17%;
        height: 2px;
        background-image: linear-gradient(to right, var(--agronook-primary) 50%, transparent 50%);
        background-size: 15px 2px;
        background-repeat: repeat-x;
        z-index: 1;
    }
}

.how-it-works .step {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    z-index: 2; /* Ensure step is above the line */
    position: relative;
}

.how-it-works .step-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--agronook-light);
    border: 2px solid var(--agronook-primary);
    color: var(--agronook-primary);
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Subtle initial shadow */
    transition: all 0.3s ease;
}
.how-it-works .step:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.how-it-works .step:hover .step-icon { /* Keep the icon hover effect */
    background-color: var(--agronook-primary);
    color: white;
}

/* Testimonial Card Hover */
.testimonial-card {
    transition: all 0.3s ease;
}
.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

/* CTA Section */
.cta-section {
    background-color: var(--agronook-primary-dark);
}

/* 4. Utility Classes
-------------------------------------------------- */
.sidebar-sticky {
    position: -webkit-sticky; /* For Safari browser compatibility */
    position: sticky;
    top: 95px; /* 75px for the main header + 20px of space */
    align-self: flex-start; /* Ensures proper alignment within the flexbox row */
    z-index: 1000; /* Keeps it above other content */
}

/* 5. Animations
-------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply a fade-in-up animation to elements on page load */
.hero-section h1, .hero-section p, .hero-section .btn-primary-agronook,
.feature-box,
.why-choose-us,
.category-card,
.product-card,
.step,
.testimonial-card,
.cta-section {
    /* Set initial state for animation */
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Stagger the animation for a more dynamic effect */
.hero-section p { animation-delay: 0.2s; }
.hero-section .btn-primary-agronook { animation-delay: 0.4s; }

.feature-box:nth-child(2),
.category-card:nth-child(2),
.product-card:nth-child(2),
.step:nth-child(2),
.testimonial-card:nth-child(2) { animation-delay: 0.2s; }

.feature-box:nth-child(3),
.category-card:nth-child(3),
.product-card:nth-child(3),
.step:nth-child(3),
.testimonial-card:nth-child(3) { animation-delay: 0.4s; }

.product-card:nth-child(4) { animation-delay: 0.6s; }

/* 6. Scroll to Top Button
-------------------------------------------------- */
.scroll-to-top {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 9999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--agronook-primary);
  color: #fff;
  transition: all 0.4s;
  visibility: hidden;
  opacity: 0;
}

.scroll-to-top.active {
  visibility: visible;
  opacity: 1;
}
.scroll-to-top:hover {
    background: var(--agronook-primary-dark);
    color: #fff;
}
.product-card:nth-child(4) { animation-delay: 0.6s; }