/* Custom Sky Blue & White Theme for AgroNook */

/* 1. Color Palette & Core Styles
-------------------------------------------------- */
:root {
    --agronook-primary: #00bf63; /* Logo green */
    --agronook-primary-dark: #00994f; /* Darker green for hover/accents */
    --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;
}

/* Navbar styling to match green theme */
.navbar {
    background: var(--agronook-light);
}
.navbar .nav-link {
    color: var(--agronook-dark);
    transition: color 0.2s ease;
}
.navbar .nav-link:hover, .navbar .nav-link:focus {
    color: var(--agronook-primary) !important;
}
.navbar .navbar-brand {
    color: var(--agronook-primary);
    font-weight: 700;
}
.navbar .btn-outline-primary-agronook {
    color: var(--agronook-primary);
    border-color: var(--agronook-primary);
}

/* 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, 191, 99, 0.55), rgba(0, 0, 0, 0.35)), 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: 70vh; /* Give the section a minimum height to show the background image */
    padding: 3.5rem 0;
}

/* Hero responsive adjustments */
.hero-section .hero-content { padding: 1rem 0; }
.hero-section .hero-media img { width: 100%; height: auto; max-height: 420px; object-fit: cover; border-radius: 12px; }

@media (max-width: 991.98px) {
    .hero-section { min-height: auto; padding: 2.5rem 0; }
    .hero-section h1 { font-size: 1.8rem; }
    .hero-section .hero-media img { max-height: 260px; }
}

@media (max-width: 575.98px) {
    .hero-section { padding: 1.8rem 0; }
    .hero-section h1 { font-size: 1.45rem; }
    .hero-section p.lead { font-size: 0.95rem; }
    .btn-primary-agronook, .btn-outline-primary-agronook { padding: .75rem 1rem; }
}

/* 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);
}

/* Enhanced product card UI */
.product-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}
.product-card .card-img-top {
    border-radius: 8px 8px 0 0;
    transition: transform 0.35s ease, filter 0.35s ease;
}
.product-card:hover .card-img-top {
    transform: scale(1.05);
    filter: brightness(0.96);
}
.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--agronook-primary);
    color: #fff;
    padding: 6px 10px;
    font-weight: 700;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    z-index: 5;
}
.product-card .card-body { padding: 1rem; }
.product-card .card-title { min-height: 48px; }
.product-price { color: var(--agronook-primary); font-weight: 800; font-size: 1.15rem; }
.product-actions { display: flex; gap: 8px; margin-top: 8px; }
.product-actions .btn { flex: 1; }
.btn-add-to-cart { background: var(--agronook-primary); color: #fff; border: none; }
.btn-add-to-cart:hover { background: var(--agronook-primary-dark); color: #fff; }
.card .small-brand { color: var(--agronook-secondary); font-size: 0.85rem; }

/* Auth / Login Page Styles */
.auth-section {
    min-height: 72vh;
    display: flex;
    align-items: center;
    padding: 3rem 0;
}
.auth-card {
    max-width: 520px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
}
.auth-card .card-body {
    padding: 2.25rem;
}
.auth-logo {
    width: 88px;
    display: block;
    margin: 0 auto 1rem auto;
}
.form-control:focus {
    box-shadow: 0 0 0 .2rem rgba(0,191,99,0.12);
    border-color: var(--agronook-primary);
}
.forgot-link { font-size: 0.95rem; }
.social-btns .btn { width: 100%; }

@media (max-width: 575.98px) {
    .auth-card { margin: 0 1rem; }
    .auth-card .card-body { padding: 1.5rem; }
}

/* Admin dark-mode styles */
body.admin-dark {
    background: #121212;
    color: #e6e6e6;
}
body.admin-dark .navbar {
    background-color: #1f1f1f !important;
    box-shadow: none;
}
body.admin-dark .navbar .nav-link {
    color: #d4d4d4 !important;
}
body.admin-dark .card {
    background: #1a1a1a;
    color: #e6e6e6;
    border-color: rgba(255,255,255,0.04);
}
body.admin-dark .bg-light { background: #0f0f0f !important; }
body.admin-dark .btn-outline-primary-agronook {
    color: var(--agronook-primary);
    border-color: rgba(0,191,99,0.25);
}
body.admin-dark .btn-primary-agronook {
    background: var(--agronook-primary);
    border-color: var(--agronook-primary);
}

/* 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,191,99,0.85), rgba(0,191,99,0.2));
    display: flex;
    align-items: flex-end;
    padding: 20px;
    transition: background 0.3s ease, opacity 0.3s ease;
}

/* Feature icon circle */
.feature-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--agronook-primary);
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    margin:0 auto 15px auto;
    box-shadow:0 4px 12px rgba(0,0,0,0.08);
}
.feature-icon i { font-size: 28px; }

/* Category title styling on overlay */
.category-card .category-card-overlay h5 {
    margin:0;
    color:#fff;
    font-weight:700;
    background: rgba(0,0,0,0.15);
    padding: 6px 10px;
    border-radius:6px;
    display: inline-block;
}

/* Modern variant for category cards (used on home page) */
.category-card.modern { border-radius: 12px; overflow: hidden; }
.category-card.modern img { width:100%; height:260px; object-fit:cover; transition: transform 0.5s ease; }
.category-card.modern:hover img { transform: scale(1.05); }
.category-card.modern .category-card-overlay {
    background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.48) 100%);
    display: flex;
    align-items: flex-end;
    padding: 18px;
}
.category-card.modern .overlay-content { display:flex; flex-direction:column; gap:6px; }
.category-card.modern .category-icon { background: rgba(255,255,255,0.12); width:44px; height:44px; display:flex; align-items:center; justify-content:center; border-radius:50%; }
.category-card.modern .category-desc { color: rgba(255,255,255,0.95); margin:0; }
.category-card.modern .shop-btn { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); color: #fff; }
.category-card.modern .shop-btn:hover { background: rgba(255,255,255,0.14); }

@media (max-width: 575.98px) {
    .category-card.modern img { height:180px; }
    .category-card.modern .overlay-content { align-items:flex-start; }
}

/* 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);
}

/* Updated testimonial styles */
.testimonial-grid .testimonial-card {
    border-radius: 12px;
    padding: 28px;
    background: #fff;
    border-left: none;
    position: relative;
    overflow: hidden;
}
.testimonial-grid .testimonial-card .quote-icon {
    font-size: 22px;
    color: rgba(0,0,0,0.08);
    position: absolute;
    top: 18px;
    right: 18px;
}
.testimonial-grid .testimonial-avatar {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.06);
}
.testimonial-grid .customer-name { font-size: 0.95rem; }
.testimonial-grid p.fst-italic { color: #222; font-size: 0.98rem; }
.testimonial-grid .text-warning i { color: #f6c04a; }

@media (max-width: 767.98px) {
    .testimonial-grid .testimonial-card { padding: 20px; }
    .testimonial-grid .quote-icon { top: 12px; right: 12px; font-size: 18px; }
}

/* CTA Card Styles */
.cta-section { background: linear-gradient(180deg, rgba(0,191,99,0.06), rgba(0,191,99,0.02)); }
.cta-card { max-width: 980px; background: linear-gradient(180deg,#ffffff,#f8fff7); border: 1px solid rgba(0,0,0,0.04); }
.cta-card h3 { color: var(--agronook-dark); }
.cta-card .form-control { box-shadow: none; border: 1px solid rgba(0,0,0,0.06); }
.cta-card .form-control:focus { box-shadow: 0 6px 20px rgba(0,191,99,0.08); border-color: var(--agronook-primary); }
.cta-card .btn-primary-agronook { padding: 0.65rem 1rem; font-weight:700; }

@media (max-width: 575.98px) {
    .cta-card { padding: 1.25rem; }
    .cta-card .form-control { height: calc(1.5rem + 1.5rem); }
}

/* Footer styles */
.site-footer { background: linear-gradient(180deg,#0b1220,#071017); }
.site-footer a { color: rgba(255,255,255,0.9); }
.site-footer .text-light-50 { color: rgba(255,255,255,0.65); }
.site-footer .social-links a { font-size: 18px; transition: transform .15s ease, color .15s ease; }
.site-footer .social-links a:hover { transform: translateY(-3px); color: var(--agronook-primary); }
.site-footer .subscribe-form .form-control { border-radius: 999px; padding: .6rem .9rem; }
.site-footer .subscribe-form .btn { border-radius: 999px; }
.site-footer h6 { color: #fff; }

/* Scroll to top */
.scroll-to-top {
    position: fixed;
    right: 18px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    background: var(--agronook-primary);
    color: #fff;
    border-radius: 50%;
    display: none;
    z-index: 9999;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.scroll-to-top i { transform: translateY(-1px); }

/* Show scroll button when JS toggles a class (custom.js can handle) */
.show-scroll { display: flex !important; }

@media (max-width: 767.98px) {
    .site-footer .social-links { margin-top: .5rem; }
    .site-footer .subscribe-form { margin-top: .6rem; }
}

/* Legal card (small info panel used above footer) */
.legal-card { max-width: 960px; }
.legal-item .icon-wrap { width:46px; height:46px; font-size:18px; }
.legal-item a { color: var(--agronook-dark); }
.legal-item a:hover { color: var(--agronook-primary); text-decoration: none; }
.legal-item .small { margin:0; }

/* Small screen tweaks */
@media (max-width: 575.98px) {
    .legal-card { padding: 1rem; }
    .legal-item { text-align: center; }
    .legal-item .icon-wrap { margin: 0 auto 6px auto; }
}

/* Products sidebar styles */
.sidebar-card .card { border-radius: 12px; }
.category-search { border-radius: 8px; padding: .5rem .75rem; }
.category-pill { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.category-pill i { width: 20px; text-align: center; }
.category-pill.active, .category-pill:focus, .category-pill:hover { background: rgba(0,191,99,0.07); color: var(--agronook-primary); }
.sidebar-card .card-header { border-top-left-radius: 12px; border-top-right-radius: 12px; }

@media (max-width: 991.98px) {
    /* Ensure the search shows on tablet/mobile within collapse */
    .category-search { display: block; }
}

/* 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;
}

/* New stepper styles (modern horizontal layout) */
.how-it-works .steps { position: relative; padding: 1rem 0; }
.how-it-works .step { background: transparent; box-shadow: none; padding: 0; }
.how-it-works .step-marker {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--agronook-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--agronook-primary);
    font-weight: 800;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, background 0.25s ease;
}
.how-it-works .step-marker span { font-size: 1.2rem; }
.how-it-works .step-body { max-width: 260px; margin: 0 auto; }

/* Connector line between markers on larger screens */
@media (min-width: 768px) {
    .how-it-works .steps { display: flex; gap: 1rem; align-items: flex-start; }
    .how-it-works .step { flex: 1; position: relative; }
    .how-it-works .step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 34px; /* center of marker (64/2) minus half of border thickness */
        right: -50%;
        width: calc(100% + 50%);
        height: 4px;
        background: linear-gradient(90deg, var(--agronook-primary) 0%, rgba(0,191,99,0.25) 100%);
        z-index: 0;
        border-radius: 4px;
        transform: translateX(30%);
        opacity: 0.18;
    }
}

/* Hover/active visual tweak */
.how-it-works .step:hover .step-marker { transform: translateY(-6px) scale(1.03); background: var(--agronook-primary); color: #fff; }

@media (max-width: 767.98px) {
    .how-it-works .steps { flex-direction: column !important; gap: 1rem; }
    .how-it-works .step { flex: 0 0 100%; width: 100%; }
    .how-it-works .step-body { margin-top: 10px; }
    .how-it-works .step:not(:last-child)::after { display: none; }
}

/* 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);
}

/* Buttons and form inputs */
.btn-light.text-primary-agronook {
    color: var(--agronook-primary);
    background-color: var(--agronook-light);
    border: 1px solid var(--agronook-primary);
}
.btn-light.text-primary-agronook:hover {
    background-color: var(--agronook-primary-dark);
    color: #fff;
}

/* Make badges, borders and small accents use the green */
.badge.bg-success-agronook {
    background-color: var(--agronook-primary) !important;
    color: #fff;
}

/* Improve contrast for hero text on green overlay */
.hero-section h1, .hero-section p { text-shadow: 0 2px 6px rgba(0,0,0,0.5); }

/* 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; }