@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@500;600;700&display=swap');

:root {
    /* ---- Vivid market-green palette (matches reference) ---- */
    --paper: #f6f1e2;
    --paper-deep: #efe7d1;
    --ink: #241f13;
    --ink-soft: #5a5240;
    --line: #d9cfae;
    --mandi-green: #22a35c; /* main flat green (buttons, links, headings) */
    --mandi-green-light: #34c471; /* lighter gradient stop / hover-light */
    --mandi-green-dark: #14803f; /* darker gradient stop / hover-dark */

    --turmeric: #c8891f;
    --turmeric-dark: #9c6a15;
    --up-color: #22a35c;
    --down-color: #c0392b;
    --text-dark: #241f13;
    --bg-soft: var(--paper);
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-soft);
    color: var(--text-dark);
    background-image: linear-gradient(var(--paper) 0%, var(--paper) 100%), repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(90,82,64,0.05) 28px);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
}

/* ==================== Navbar ==================== */
.navbar-brand-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

    .navbar-brand-wrap .brand-name {
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 1.2rem;
        color: #fff;
        letter-spacing: 0.01em;
    }

    .navbar-brand-wrap .brand-tag {
        font-size: 0.7rem;
        color: #d9ecd4;
        font-weight: 500;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

.navbar-custom {
    background: linear-gradient(90deg,var(--mandi-green-dark),var(--mandi-green));
    border-bottom: 3px solid var(--turmeric);
}

    .navbar-custom .nav-link {
        color: #eafaf0 !important;
        font-weight: 500;
    }

        .navbar-custom .nav-link:hover {
            color: #fff !important;
        }

.btn-admin-login {
    background: var(--turmeric);
    color: #241f13;
    border: none;
    font-weight: 700;
    border-radius: 6px;
}

    .btn-admin-login:hover {
        background: var(--turmeric-dark);
        color: #fff;
    }

/* ==================== Hero ==================== */
.hero-section {
    background: linear-gradient(135deg, var(--mandi-green-light) 0%, var(--mandi-green) 55%, var(--mandi-green-dark) 100%);
    color: #fff;
    padding: 56px 0 0;
    border-radius: 0 0 28px 28px;
    position: relative;
    overflow: hidden;
}

    .hero-section .eyebrow {
        font-family: var(--font-mono);
        font-size: 0.72rem;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: #d6f3e0;
        margin-bottom: 10px;
    }

    .hero-section h1 {
        font-weight: 800;
        font-size: 2.4rem;
        max-width: 720px;
        margin: 0 auto 14px;
    }

    .hero-section p {
        color: #e6f7ec;
        font-size: 1.02rem;
    }

/* ---- Hero CTAs (white pill + outline pill, as in reference) ---- */
.btn-hero-primary {
    background: #fff;
    color: var(--mandi-green-dark);
    font-weight: 700;
    border: none;
    border-radius: 999px;
    padding: 12px 26px;
}

    .btn-hero-primary:hover {
        background: #eafaf0;
        color: var(--mandi-green-dark);
    }

.btn-hero-outline {
    background: transparent;
    color: #fff;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 999px;
    padding: 10px 24px;
}

    .btn-hero-outline:hover {
        background: rgba(255,255,255,0.12);
        color: #fff;
        border-color: #fff;
    }

/* ---- Hero stat row (big white numbers, small labels) ---- */
.hero-stat-number {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.9rem;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.86rem;
    color: rgba(255,255,255,0.82);
    margin-top: 4px;
}

/* ---- Translucent visual panel + icon tiles, as in reference ---- */
.hero-visual-panel {
    background: rgba(255,255,255,0.14);
    border-radius: 20px;
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.hero-veg-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    aspect-ratio: 1;
}

/* ---- Signature element: live scrolling price ticker ---- */
.mandi-ticker {
    margin-top: 36px;
    background: var(--mandi-green-dark);
    border-top: 1px solid rgba(255,255,255,0.14);
    overflow: hidden;
    position: relative;
}

    .mandi-ticker::before,
    .mandi-ticker::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 48px;
        z-index: 2;
        pointer-events: none;
    }

    .mandi-ticker::before {
        left: 0;
        background: linear-gradient(90deg, var(--mandi-green-dark), transparent);
    }

    .mandi-ticker::after {
        right: 0;
        background: linear-gradient(270deg, var(--mandi-green-dark), transparent);
    }

.mandi-ticker-track {
    display: flex;
    width: max-content;
    animation: mandi-scroll 32s linear infinite;
    padding: 9px 0;
}

.mandi-ticker-item {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: #eaf5e4;
    white-space: nowrap;
    padding: 0 22px;
    border-right: 1px solid rgba(255,255,255,0.14);
    display: flex;
    align-items: center;
    gap: 7px;
}

    .mandi-ticker-item .t-up {
        color: #a7e08a;
        font-weight: 600;
    }

    .mandi-ticker-item .t-down {
        color: #f0a898;
        font-weight: 600;
    }

@keyframes mandi-scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mandi-ticker-track {
        animation: none;
    }
}

.location-card {
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(36,31,19,0.14);
    padding: 26px;
}

    .location-card h5 {
        font-family: var(--font-display);
        font-weight: 600;
    }

    .location-card select {
        border-radius: 8px;
        padding: 10px;
        border: 1px solid var(--line);
    }

.btn-view-prices {
    background: var(--mandi-green);
    border: none;
    font-weight: 700;
    border-radius: 8px;
    padding: 10px 26px;
    letter-spacing: 0.01em;
}

    .btn-view-prices:hover {
        background: var(--mandi-green-dark);
    }

    .btn-view-prices:disabled {
        background: #b9c9b3;
    }

/* ==================== Legacy veg-card (kept for compatibility) ==================== */
.veg-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(36,31,19,0.06);
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
    overflow: hidden;
    height: 100%;
    background: #fffdf7;
}

    .veg-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 24px rgba(36,31,19,0.12);
    }

    .veg-card .card-body {
        padding: 18px;
    }

.veg-name {
    font-weight: 700;
    font-size: 1.05rem;
    font-family: var(--font-display);
}

.veg-price {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--mandi-green-dark);
}

.veg-unit {
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.badge-up {
    background: rgba(34,163,92,0.14);
    color: var(--up-color);
    font-weight: 700;
}

.badge-down {
    background: rgba(192,57,43,0.14);
    color: var(--down-color);
    font-weight: 700;
}

.veg-prev {
    font-size: 0.8rem;
    color: #8a8f94;
    text-decoration: line-through;
}

.veg-updated {
    font-size: 0.75rem;
    color: #8a8f94;
}

.text-up {
    color: var(--up-color);
    font-weight: 700;
}

.text-down {
    color: var(--down-color);
    font-weight: 700;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--mandi-green-dark);
    border-left: 5px solid var(--turmeric);
    padding-left: 12px;
    margin-bottom: 20px;
}

.site-footer {
    background: var(--mandi-green-dark);
    color: #dcecd5;
    padding: 22px 0;
    margin-top: 48px;
    font-size: 0.88rem;
    border-top: 3px solid var(--turmeric);
}

/* ==================== Admin ==================== */
.admin-sidebar {
    background: var(--mandi-green-dark);
    min-height: 100vh;
    color: #fff;
    padding-top: 20px;
}

    .admin-sidebar a {
        color: #d4efdf;
        display: block;
        padding: 12px 20px;
        text-decoration: none;
        font-weight: 500;
        border-left: 4px solid transparent;
    }

        .admin-sidebar a:hover, .admin-sidebar a.active {
            background: rgba(255,255,255,0.08);
            color: #fff;
            border-left-color: var(--turmeric);
        }

.admin-topbar {
    background: #fffdf7;
    box-shadow: 0 2px 8px rgba(36,31,19,0.08);
    padding: 14px 24px;
}

.stat-card {
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: 0 4px 14px rgba(36,31,19,0.06);
    background: #fffdf7;
}

    .stat-card .stat-number {
        font-family: var(--font-mono);
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--mandi-green-dark);
    }

.stat-icon {
    font-size: 2rem;
}

.detail-hero {
    background: #e9f7ee;
    border-radius: 16px;
    padding: 28px;
}

.detail-stat-box {
    background: #fffdf7;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(36,31,19,0.06);
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(36,31,19,0.14);
    max-width: 400px;
    width: 100%;
    background: #fffdf7;
}

@media (max-width:768px) {
    .admin-sidebar {
        min-height: auto;
    }

    .hero-section h1 {
        font-size: 1.7rem;
    }

    .hero-visual-panel {
        margin-top: 24px;
    }
}

/* ==================== Mandi Dashboard Homepage ==================== */

.mandi-stat-card {
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 16px;
    box-shadow: 0 3px 10px rgba(36,31,19,0.05);
    text-align: left;
    height: 100%;
    position: relative;
}

    .mandi-stat-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--mandi-green);
        border-radius: 12px 12px 0 0;
    }

.mandi-stat-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    font-weight: 600;
    margin-bottom: 6px;
}

.mandi-stat-value {
    font-family: var(--font-mono);
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-dark);
}

    .mandi-stat-value.text-accent {
        color: var(--turmeric-dark);
    }

    .mandi-stat-value.text-green {
        color: var(--mandi-green);
    }

.mandi-filter-card {
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 12px rgba(36,31,19,0.05);
}

    .mandi-filter-card h6 {
        font-family: var(--font-display);
        font-weight: 600;
        color: var(--mandi-green-dark);
    }

    .mandi-filter-card .form-select {
        background-color: var(--paper-deep);
        border: 1px solid var(--line);
        border-radius: 7px;
    }

.btn-mandi-search {
    background: var(--mandi-green);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 7px;
}

    .btn-mandi-search:hover {
        background: var(--mandi-green-dark);
        color: #fff;
    }

.mandi-section-heading {
    font-weight: 700;
    color: var(--mandi-green-dark);
    font-family: var(--font-display);
}

.mandi-price-card {
    background: #fffdf7;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(36,31,19,0.07);
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease;
    position: relative;
}

    .mandi-price-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 26px rgba(36,31,19,0.14);
        border-color: var(--mandi-green);
    }

.mandi-card-topline {
    height: 4px;
    background: var(--mandi-green);
}

.mandi-card-body {
    padding: 16px;
}

.mandi-veg-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.08rem;
    color: var(--text-dark);
}

.mandi-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.02em;
    color: var(--turmeric-dark);
    background: #f6ecd4;
    border: 1px solid #ecdbb0;
    border-radius: 5px;
    padding: 2px 7px;
    margin-top: 5px;
}

.btn-mandi-view {
    background: var(--mandi-green-dark);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    font-size: 0.74rem;
    padding: 6px 12px;
    white-space: nowrap;
}

    .btn-mandi-view:hover {
        background: var(--mandi-green);
        color: #fff;
    }

.mandi-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 10px 0 8px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.mandi-price {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
}

.mandi-unit {
    font-size: 0.76rem;
    color: var(--ink-soft);
}

.mandi-minmax-row {
    display: flex;
    gap: 8px;
    margin: 10px 0;
    background: var(--paper-deep);
    border-radius: 8px;
    padding: 8px;
}

.mandi-minmax-box {
    flex: 1;
    text-align: center;
}

.mandi-minmax-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--ink-soft);
    letter-spacing: 0.03em;
    font-weight: 600;
}

.mandi-minmax-val {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-dark);
}

.mandi-location-line {
    font-size: 0.78rem;
    color: var(--ink-soft);
    margin-top: 8px;
}

.mandi-updated-line {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #a3a396;
    margin-top: 3px;
}

.mandi-veg-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.mandi-veg-emoji {
    font-size: 28px;
    line-height: 1;
}

.veg-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 auto;
    display: block;
}

.veg-emoji {
    width: 70px;
    height: 70px;
    font-size: 50px;
    line-height: 70px;
    margin: 0 auto;
}
