/* 
  KisanConnect - Design System 
  Primary: #2D6A4F (Dark Green)
  Accent: #F4A261 (Orange)
  Background: #FAFAF5 (Off White)
  Text: #1B1B1B (Dark)
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700;800&display=swap');

:root {
    --primary: #2D6A4F;
    --primary-light: #40916C;
    --primary-dark: #1B4332;
    --accent: #F4A261;
    --accent-light: #E9C46A;
    --bg: #FAFAF5;
    --white: #FFFFFF;
    --text: #1B1B1B;
    --text-muted: #666666;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

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

/* Typography & Utilities */
.text-center { text-align: center; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

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

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

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

.btn-accent:hover {
    background-color: #E76F51;
    transform: translateY(-2px);
}

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

.btn-block {
    width: 100%;
}

/* Loading State for Buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

/* Header */
header {
    background: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Poppins', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 40px 0;
    margin-top: 50px;
}

/* Landing Page Specifics */
.hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(45, 106, 79, 0.85), rgba(45, 106, 79, 0.85)), url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 30px;
    max-width: 600px;
}

.hero-btns {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 300px;
}

.stats-bar {
    background: var(--accent);
    padding: 20px 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    color: var(--white);
    font-weight: 700;
    font-size: 0.9rem;
}

.how-it-works {
    padding: 60px 0;
}

.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 30px;
}

.step-card {
    text-align: center;
    padding: 20px;
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Forms */
.form-container {
    max-width: 450px;
    margin: 40px auto;
    padding: 30px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--radius);
    border: 1px solid #ddd;
    font-family: inherit;
    font-size: 1rem;
}

.form-toggle {
    display: flex;
    background: #eee;
    border-radius: var(--radius);
    margin-bottom: 25px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius);
    font-weight: 600;
}

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

/* Dashboard */
.dashboard-header {
    background: var(--primary);
    color: var(--white);
    padding: 30px 20px;
    border-radius: 0 0 30px 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: -20px;
    padding: 0 20px;
}

.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.stat-card p {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Product Listing Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    padding: 20px;
}

.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.product-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

.product-price {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.freshness-tag {
    font-size: 0.7rem;
    background: #e8f5e9;
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 5px;
}

/* Consumer Home */
.search-container {
    padding: 20px;
    position: sticky;
    top: 60px;
    background: var(--bg);
    z-index: 90;
}

.filter-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 20px;
    scrollbar-width: none;
}

.filter-scroll::-webkit-scrollbar { display: none; }

.filter-btn {
    white-space: nowrap;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--white);
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

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

/* Cart Icon */
.cart-icon {
    position: relative;
    font-size: 1.5rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent);
    color: var(--white);
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
}

/* Order Tracking */
.tracking-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.tracking-steps::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.t-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    gap: 10px;
    width: 25%;
}

.step-dot {
    width: 30px;
    height: 30px;
    background: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

.t-step.active .step-dot {
    background: var(--primary);
}

.t-step.active span {
    color: var(--primary);
    font-weight: 600;
}

/* Desktop Media Queries */
@media (min-width: 768px) {
    .hero h1 { font-size: 4rem; }
    .hero-btns { flex-direction: row; max-width: none; justify-content: center; }
    .hero-btns .btn { width: 200px; }
    .steps-grid { grid-template-columns: 1fr 1fr 1fr; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
