@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Premium Design System - Emerald & Nature Inspired */
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #ecfdf5;
    --primary-glow: rgba(16, 185, 129, 0.2);

    --secondary: #f59e0b;
    --secondary-light: #fffbeb;

    --dark: #0f172a;
    --dark-muted: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-on-dark: #f1f5f9;

    /* Gradients */
    --grad-premium: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --grad-sunset: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --grad-surface: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);

    /* Shadows */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    --shadow-inset: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(16px);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;

    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body {
    background-color: #f1f5f9;
    background-image:
        radial-gradient(at 0% 0%, hsla(145, 63%, 42%, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(45, 93%, 47%, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography Overhaul */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--dark);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Premium Navbar */
.navbar {
    position: sticky;
    top: 1.5rem;
    z-index: 1000;
    margin: 1.5rem auto;
    width: calc(100% - 3rem);
    max-width: 1200px;
    padding: 0.75rem 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.logo .fa-leaf {
    color: var(--primary);
    font-size: 1.8rem;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
    color: var(--text-main);
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.btn-signup,
.btn-primary {
    background: var(--grad-premium);
    color: var(--white) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-signup:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

/* Marketplace Styling */
.hero {
    padding: 5rem 1rem 3rem;
    text-align: center;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--dark), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

/* Category Filters Bar */
.filter-bar {
    background: var(--white);
    padding: 0.5rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-card);
    display: inline-flex;
    gap: 0.5rem;
    margin-bottom: 3rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.filter-btn:hover {
    color: var(--dark);
    background: var(--light);
}

.filter-btn.active {
    background: var(--dark);
    color: var(--white);
    box-shadow: var(--shadow-card);
}

/* Product Cards Overhaul */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-premium);
}

.img-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f1f5f9;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.product-card:hover .product-img {
    transform: scale(1.08);
}

.farmer-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.product-info {
    padding: 1.5rem 0.5rem 0.5rem;
}

.product-title {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    font-weight: 800;
}

.product-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    height: 2.7rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.price-tag {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark);
}

.price-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.badge {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-stock {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-sold {
    background: #fee2e2;
    color: #ef4444;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(var(--i, 0) * 0.1s);
    opacity: 0;
}

/* Dashboards and Forms */
.dashboard-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.stat-box {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    border-bottom: 4px solid var(--primary);
}

.stat-box h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.stat-box p {
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        width: calc(100% - 2rem);
        padding: 0.75rem 1.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .filter-bar {
        display: flex;
        overflow-x: auto;
        max-width: 100%;
        border-radius: var(--radius-md);
    }

    .filter-btn {
        white-space: nowrap;
    }
}