/* NgFarms Marketplace - Main Styles */

/* Variables */
:root {
    --primary-color: #71b03e;
    --primary-dark: #5a8d31;
    --primary-light: #8bc653;
    --secondary-color: #3b82f6;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #71b03e;
    --text-primary: #2d2d2d;
    --text-secondary: #6b7280;
    --bg-primary: #f3eee9;
    --bg-light: #ffffff;
    --border-color: #e0d8cf;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-weight: 300;
    overflow-x: hidden;
    max-width: 100vw;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header & Navigation */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

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

.nav-link {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 350;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    height: 600px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    background-size: cover;
    background-position: center;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 900px;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Search Bar */
.search-bar {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.search-input {
    flex: 1;
    padding: 1.25rem 1.75rem;
    border: none;
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: #9ca3af;
    font-weight: 300;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    background: var(--primary-color);
    color: white;
    padding: 1.25rem 2.5rem;
    border: none;
    font-weight: 400;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    letter-spacing: 0.3px;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Card Grid */
.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.25rem;
    margin-bottom: 3rem;
    font-weight: 300;
    text-align: center;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Listing Card */
.listing-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.listing-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-light);
}

.listing-content {
    padding: 1.5rem;
}

.listing-title {
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.listing-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.listing-price {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--primary-color);
}

.listing-quantity {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.listing-seller {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.verified-badge {
    display: inline-block;
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 400;
}

.featured-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--warning-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    font-weight: 400;
    font-size: 0.875rem;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 0;
}

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

.footer-section h3 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Recent Listings Section */
.recent-listings-section {
    background: #fafaf9;
}

/* Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}

.category-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.75rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border: 1px solid #e5e7eb;
    position: relative;
    min-height: 100px;
}

.category-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.category-listings-count {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 300;
}

.category-name {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-primary);
    word-wrap: break-word;
}

.category-icon {
    font-size: 2rem;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

/* Responsive category title */
.category-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.hide-mobile {
    display: inline;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: -0.5px;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Form Styles */
input[type="text"],
input[type="password"],
input[type="email"],
select,
textarea {
    font-family: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(113, 176, 62, 0.1);
}

/* Radio Button Styles */
input[type="radio"]:checked + div,
input[type="radio"]:checked ~ div {
    color: var(--primary-color);
}

label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color) !important;
    background: rgba(113, 176, 62, 0.05);
}

label:has(input[type="radio"]):hover {
    border-color: var(--primary-color) !important;
}

/* Pagination Styles */
.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 400;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
    background: white;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .active span {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .disabled span {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
}

@media (max-width: 768px) {
    .hero {
        height: 500px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nav-menu {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .nav-link::after {
        display: none;
    }

    .search-bar {
        flex-direction: column;
        border-radius: 4px;
        margin: 0 1rem;
    }

    .search-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
    
    .category-title {
        font-size: 1.85rem !important;
        line-height: 1.3;
    }
    
    .category-header {
        margin-bottom: 2.5rem !important;
        padding: 0 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.25rem 1.5rem;
        min-height: 80px;
    }
    
    .category-name {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .category-listings-count {
        font-size: 0.8rem;
    }
    
    .category-icon {
        font-size: 1.5rem;
        margin-left: 0.75rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Ensure cards don't overflow */
    .listing-card {
        max-width: 100%;
    }
    
    .listing-title {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .listing-content {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 450px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .nav {
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        gap: 0.75rem;
    }
    
    .category-title {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    .hide-mobile {
        display: none;
    }
    
    .category-header {
        margin-bottom: 2rem !important;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 0.875rem;
    }
    
    .category-card {
        padding: 1.25rem 1.5rem;
    }
    
    .category-name {
        font-size: 0.95rem;
    }
    
    .cta-section h2 {
        font-size: 1.75rem;
    }
    
    .cta-section p {
        font-size: 1rem;
    }
}
