/* glis_farmer.css - GLIS Agricultural Monitoring System Styles */
/* ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;700&display=swap');

/* Urdu text styling */
.urdu-text,
[dir="rtl"] {
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Arial Unicode MS', serif;
    direction: rtl;
    text-align: right;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
}

@font-face {
    font-family: 'JameelNoori';
    src: url('fonts/Jameel-Noori-Nastaleeq.ttf') format('truetype');
}

/* ── Auth Overlay ──────────────────────────────────────────── */
#authOverlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    background: #f0fdf4;
}

.auth-left {
    width: 42%;
    background: linear-gradient(160deg, #064e3b 0%, #047857 60%, #065f46 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 40px;
    color: white;
}

.auth-left h1 {
    margin: 0 0 8px;
    font-size: 34px;
    font-weight: 800;
}

.auth-left .tagline {
    color: #6ee7b7;
    font-size: 15px;
    margin: 0 0 40px;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}

.auth-feature .icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.auth-feature h4 {
    margin: 0 0 3px;
    font-size: 14px;
    font-weight: 700;
}

.auth-feature p {
    margin: 0;
    font-size: 12.5px;
    color: #a7f3d0;
    line-height: 1.5;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    overflow-y: auto;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 28px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: #6b7280;
    transition: all 0.2s;
}

.auth-tab.active {
    background: white;
    color: #064e3b;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-panel h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #111827;
}

.auth-panel p.sub {
    margin: 0 0 24px;
    color: #6b7280;
    font-size: 14px;
}

.field-group {
    margin-bottom: 16px;
}

.field-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.field-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    transition: border-color 0.2s;
    outline: none;
}

.auto-detected {
    background-color: #dbeafe !important;
    border: 1px solid #3b82f6 !important;
    color: #1e40af !important;
}

/* For select dropdowns specifically */
select.auto-detected {
    background-color: #dbeafe !important;
    border: 1px solid #3b82f6 !important;
    color: #1e40af !important;
}

/* For input fields */
input.auto-detected {
    background-color: #dbeafe !important;
    border: 1px solid #3b82f6 !important;
    color: #1e40af !important;
}

.field-group input:focus {
    border-color: #059669;
}

.dropdown-divider {
    height: 1px;
    margin: 6px 0;
    background-color: #e5e7eb;
}

.auth-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.35);
    transition: opacity 0.2s;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn:hover:not(:disabled) {
    opacity: 0.92;
}

.auth-error {
    display: none;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    padding: 10px 14px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 14px;
}

.verify-code-input {
    width: 100%;
    padding: 16px;
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 12px;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    color: #064e3b;
    outline: none;
}

.verify-code-input:focus {
    border-color: #059669;
}

/* ── App Container ─────────────────────────────────────────── */
#app {
    display: none;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

/* ── Top Nav ────────────────────────────────────────────────── */
#topNav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 50px;
    background: linear-gradient(135deg, #064e3b, #047857);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#topNav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 800;
    font-size: 17px;
}

#topNav .brand span {
    font-size: 22px;
}

#topNav .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 13px;
}

#topNav .user-name {
    font-weight: 600;
    color: #6ee7b7;
}

.logout-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Top Navigation Buttons */
.top-nav-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    color: white;
}

.top-nav-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive: Hide some buttons on small screens */
@media (max-width: 1200px) {
    .top-nav-btn:nth-child(n+6) {
        display: none;
    }
}

@media (max-width: 768px) {
    .top-nav-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .top-nav-btn:nth-child(n+4) {
        display: none;
    }
}

/* ── Map ───────────────────────────────────────────────────── */
#map {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ══ Panel Dock — fixed vertical toolbar, never moves ══════════ */
#panelDock {
    position: absolute;
    top: 52px;
    right: 0;
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: #056c4f;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.06);
    z-index: 1002;
    min-height: calc(100vh - 52px);
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, transform 0.15s;
    padding: 0;
    position: relative;
}

.dock-btn span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
}

.dock-btn:hover {
    background: #f0fdf4;
    color: #059669;
    transform: scale(1.05);
}

.dock-btn.active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
}

.dock-btn.active:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    color: white;
    transform: scale(1.05);
}

/* ── Side Panel ─────────────────────────────────────────────── */
#panel {
    position: absolute;
    top: 52px;
    right: 52px;
    bottom: 0;
    background: #ffffff;
    width: 340px;
    height: calc(100vh - 52px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    z-index: 1000;
    border-left: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    font-size: 14px;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease, right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-behavior: smooth;
}

#panel.panel-collapsed {
    transform: translateX(calc(100% + 52px));
    opacity: 0;
    pointer-events: none;
}


/* Farm Analysis panel header */
#panelHeader {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    padding: 16px 18px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#panelHeader h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#panelHeader h2::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6ee7b7;
    box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.3);
}

#panel h3,
#panel h4 {
    margin: 14px 0 8px;
    font-size: 11px;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

/* ndviPanel */
#ndviPanel {
    position: absolute;
    top: 52px;
    right: 392px;
    height: calc(100vh - 52px);
    width: 360px;
    background: white;
    border-left: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    border-radius: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 0;
    z-index: 1000;
    font-size: 14px;
    /* hidden by default — shown via JS */
    transform: translateX(calc(100% + 392px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease, right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

#ndviPanel.panel-visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

#ndviPanel.panel-collapsed {
    transform: translateX(calc(100% + 392px));
    opacity: 0;
    pointer-events: none;
}

#panel h3,
#panel h4 {
    margin: 14px 0 8px;
    font-size: 10px;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Slim modern scrollbar for both panels */
#panel::-webkit-scrollbar,
#ndviPanel::-webkit-scrollbar {
    width: 4px;
}

#panel::-webkit-scrollbar-track,
#ndviPanel::-webkit-scrollbar-track {
    background: transparent;
}

#panel::-webkit-scrollbar-thumb,
#ndviPanel::-webkit-scrollbar-thumb {
    background: #d1fae5;
    border-radius: 4px;
}

#panel::-webkit-scrollbar-thumb:hover,
#ndviPanel::-webkit-scrollbar-thumb:hover {
    background: #6ee7b7;
}

/* ndviPanel header — matches Farm Analysis style */
#ndviPanel .np-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    border-bottom: none;
    padding: 14px 16px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#ndviPanel .np-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#ndviPanel .np-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6ee7b7;
    box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.3);
    flex-shrink: 0;
}

#ndviPanel #closePanelBtn {
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #d1fae5 !important;
    border-radius: 8px !important;
    width: 28px;
    height: 28px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 13px !important;
    transition: background 0.15s, color 0.15s !important;
    padding: 0 !important;
}

#ndviPanel #closePanelBtn:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

#ndviPanel .np-parcel-badge {
    margin: 8px 16px 0;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #d1fae5;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 10px;
    display: inline-block;
    max-width: calc(100% - 32px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

label {
    font-weight: 500;
    color: #374151;
    display: block;
    margin-bottom: 6px;
}

input[type="date"],
input[type="file"],
input[type="range"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

input[type="range"] {
    padding: 6px 0;
}

.progress-container {
    margin: 16px 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #d1fae5;
    border-top-color: #059669;
    border-radius: 50%;
    animation: progress-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes progress-spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-bar-track {
    background: #d1fae5;
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #059669 0%, #10b981 60%, #34d399 100%);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
    animation: progress-shimmer 1.6s infinite;
    background-size: 200% 100%;
}

@keyframes progress-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.soil-info-box {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    font-size: 13px;
    color: #065f46;
    line-height: 1.5;
}

#result {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    margin: 14px 0;
    font-size: 14px;
}

#result b {
    color: #1e40af;
}

#ndvi-report {
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

#ndvi-report h4 {
    margin: 0 0 12px;
    font-size: 1.1em;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 7px;
}

#ndvi-report p {
    margin: 0 0 10px;
    color: #4b5563;
    font-size: 14px;
}

#ndvi-report ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

#ndvi-report li {
    padding: 11px 13px;
    margin-bottom: 8px;
    background: #f1f5f9;
    border-radius: 7px;
    border-left: 5px solid;
    font-weight: 500;
    font-size: 14px;
}

#ndvi-report li:nth-child(1) {
    border-left-color: #10b981;
}

#ndvi-report li:nth-child(2) {
    border-left-color: #3b82f6;
}

#ndvi-report li:nth-child(3) {
    border-left-color: #f59e0b;
}

#ndvi-report li:nth-child(4) {
    border-left-color: #ef4444;
}

#ndvi-report .note {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #d1d5db;
}

#ndviChart {
    margin: 12px 0 20px;
}

/* Panel action buttons */
.panel-btn {
    width: 100%;
    margin-top: 10px;
    padding: 11px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.panel-btn:hover:not(:disabled) {
    opacity: 0.88;
}

.panel-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Add New Parcel button ──────────────────────────────────── */
#addParcelBtn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #064e3b, #047857);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    transition: opacity 0.2s;
}

#addParcelBtn:hover {
    opacity: 0.88;
}

/* ── Parcel List ────────────────────────────────────────────── */
#parcelListSection h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 6px;
}

#parcelList {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 2px;
}

.parcel-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s;
}

.parcel-card:hover {
    background: #f0fdf4;
    border-color: #6ee7b7;
}

.parcel-card.active {
    background: #ecfdf5;
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

.parcel-card-info {
    flex: 1;
    min-width: 0;
}

.parcel-card-info strong {
    display: block;
    font-size: 13px;
    color: #064e3b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.parcel-card-info span {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.parcel-card-del {
    flex-shrink: 0;
    background: none;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    color: #ef4444;
    font-size: 13px;
    padding: 3px 7px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}

.parcel-card-del:hover {
    opacity: 1;
    background: #fee2e2;
}

.parcel-list-empty {
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
    padding: 14px 0;
}

/* ── Draw-mode banner ───────────────────────────────────────── */
#drawModeBanner {
    display: none;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #92400e;
    margin-bottom: 8px;
    text-align: center;
    font-weight: 600;
}

/* ── Analysis controls section ─────────────────────────────── */
#analysisControls {
    margin-top: 10px;
}

.parcel-info-badge {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 12.5px;
    color: #065f46;
    display: none;
}

.parcel-info-badge strong {
    display: block;
    margin-bottom: 2px;
    color: #064e3b;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-left {
        display: none;
    }

    #panel {
        width: 88%;
        right: 6%;
        top: 58px;
        max-height: 78vh;
        font-size: 13px;
    }

    #ndviPanel {
        display: none !important;
    }
}

/* ── NDVI Results + History Panel (left of main panel) ────── */
/* legacy #ndviPanel block — overridden by the new block above */

/* ndviPanel content padding (below sticky header) */
#ndviPanel .np-parcel-badge~*,
#ndviPanel #npEmpty,
#ndviPanel #npResults,
#ndviPanel #npHistorySection {
    padding-left: 16px;
    padding-right: 16px;
}

#ndviPanel #npHistorySection {
    padding-bottom: 20px;
}

/* NDVI summary metrics row */
.np-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.np-metric-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 10px 12px;
    text-align: center;
}

.np-metric-box .np-metric-val {
    font-size: 20px;
    font-weight: 600;
    display: block;
    line-height: 1.1;
}

.np-metric-box .np-metric-lbl {
    font-size: 10.5px;
    color: #6b7280;
    margin-top: 3px;
    display: block;
}

/* vegetation bars */
.veg-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
}

.veg-bar-label {
    font-size: 12px;
    color: #374151;
    width: 120px;
    flex-shrink: 0;
    font-weight: 600;
}

.veg-bar-track {
    flex: 1;
    background: #e5e7eb;
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}

.veg-bar-fill {
    height: 10px;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.veg-bar-pct {
    font-size: 11px;
    color: #6b7280;
    width: 38px;
    text-align: right;
    flex-shrink: 0;
}

/* #result and #ndvi-report inside ndviPanel — override global styles */
#ndviPanel #result {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 12px;
    font-size: 13px;
}

#ndviPanel #ndvi-report {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* History section inside ndviPanel */
.np-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.np-history-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.np-history-count {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 99px;
    padding: 1px 8px;
}

.hist-card {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.hist-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #e5e7eb;
    border-radius: 10px 0 0 10px;
    transition: background 0.15s;
}

.hist-card:hover {
    border-color: #a7f3d0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.hist-card:hover::before {
    background: #10b981;
}

.hist-card.active {
    background: #f0fdf4;
    border-color: #6ee7b7;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.12);
}

.hist-card.active::before {
    background: #059669;
}

.hist-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.hist-date {
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: 0.2px;
}

.hist-ndvi {
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.hist-meta {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 7px;
}

.hist-bar-wrap {
    background: #f3f4f6;
    border-radius: 99px;
    height: 4px;
    overflow: hidden;
}

.hist-bar {
    height: 4px;
    border-radius: 99px;
    transition: width 0.4s ease;
}

.hist-delete-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #fca5a5;
    background: #fff5f5;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 10px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    margin-left: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.hist-delete-btn:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.hist-card.hist-deleting {
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ── Parcel Metadata Modal ──────────────────────────────────── */
#parcelModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: flex-start;
    padding: 20px 16px;
    overflow-y: auto;
}

.parcel-modal-box {
    background: white;
    border-radius: 14px;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.parcel-modal-header {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    padding: 20px 24px;
    color: white;
    display: flex;
    align-items: center;
    gap: 14px;
}

.parcel-modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.parcel-modal-header p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #bfdbfe;
}

.parcel-modal-body {
    padding: 24px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13.5px;
    color: #111827;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3b82f6;
}

.radio-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: all 0.15s;
    user-select: none;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option.selected {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.section-divider {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
    margin: 16px 0 14px;
}

.parcel-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #059669, #047857);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.35);
    margin-top: 8px;
    transition: opacity 0.2s;
}

.parcel-submit-btn:hover {
    opacity: 0.9;
}

/* ── Disease Modal ─────────────────────────────────────────── */
#diseaseModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    justify-content: center;
    align-items: flex-start;
    padding: 30px 16px;
    overflow-y: auto;
}

/* ============================================================ */
/* DROPDOWN MENU STYLES - Professional Navigation */
/* ============================================================ */

/* Top Navigation Container */
#topNav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 52px;
    background: linear-gradient(135deg, #064e3b, #047857);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Brand Logo */
#topNav .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

#topNav .brand span {
    font-size: 22px;
}

/* Navigation Container */
.nav-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

/* Standalone Button */
.top-nav-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.top-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Button */
.dropdown-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.4);
}

.dropdown-btn::after {
    content: "▼";
    font-size: 9px;
    margin-left: 4px;
    opacity: 0.8;
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 190px;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    margin-top: 8px;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Dropdown Items */
.dropdown-content a,
.dropdown-content button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: white;
    border: none;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.dropdown-content a:hover,
.dropdown-content button:hover {
    background: #f0fdf4;
    color: #059669;
}

.dropdown-content a:active,
.dropdown-content button:active {
    background: #d1fae5;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    font-weight: 500;
    color: #a7f3d0;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

.logout-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Urdu Button */
.urdu-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    font-family: 'Noto Nastaliq Urdu', sans-serif;
}

.urdu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .nav-container {
        gap: 8px;
    }

    .top-nav-btn,
    .dropdown-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .dropdown-content {
        min-width: 170px;
    }

    .dropdown-content a,
    .dropdown-content button {
        padding: 8px 14px;
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #topNav {
        padding: 0 12px;
        height: 48px;
    }

    .brand {
        font-size: 13px;
    }

    .brand span {
        font-size: 18px;
    }

    .nav-container {
        gap: 6px;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 2px;
    }

    .top-nav-btn,
    .dropdown-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .user-section {
        gap: 8px;
    }

    .user-name {
        font-size: 11px;
        padding: 3px 8px;
    }

    .logout-btn {
        padding: 4px 10px;
        font-size: 10px;
    }

    .urdu-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Dropdown Container - Updated for JS control */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Button */
.dropdown-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.4);
}

.dropdown-btn::after {
    content: "▼";
    font-size: 9px;
    margin-left: 4px;
    opacity: 0.8;
}

/* Dropdown Content - Updated for JS control */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 190px;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    margin-top: 8px;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

/* When dropdown is open */
.dropdown.open .dropdown-content {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Items */
.dropdown-content a,
.dropdown-content button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    background: white;
    border: none;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.dropdown-content a:hover,
.dropdown-content button:hover {
    background: #f0fdf4;
    color: #059669;
}

.dropdown-content a:active,
.dropdown-content button:active {
    background: #d1fae5;
}

/* Dropdown Divider */
.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 6px 0;
}

/* Logo positioned to the right of zoom controls */
.fixed-bottom-logo {
    background: rgba(6, 78, 59, 0.9);
    border-radius: 8px;
    width: auto;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    padding: 4px 12px;
    box-sizing: border-box;
}

.fixed-bottom-logo:hover {
    transform: scale(1.05);
    background: rgba(6, 78, 59, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.fixed-bottom-logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.fixed-bottom-logo img[src=""],
.fixed-bottom-logo img:not([src]) {
    content: "🌿";
    font-size: 32px;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Search Bar Styles */
#search-container {
    background: rgba(6, 78, 59, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

#search-container:hover {
    background: rgba(6, 78, 59, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mode-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

#search-input {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: white;
    width: 220px;
    outline: none;
    transition: all 0.2s;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

#search-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
}

#search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

#search-status {
    font-size: 10px;
    color: #a7f3d0;
    margin-top: 4px;
    display: none;
}

#search-status.show {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fixed-bottom-logo {
        height: 50px;
        padding: 2px 8px;
    }

    #search-container {
        display: none;
    }
}

/* Fallback when image fails to load */
.fixed-bottom-logo:empty::before {
    content: "🌿";
    font-size: 28px;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Adjust zoom control position */
.leaflet-control-zoom {
    margin-top: 10px !important;
    margin-left: 10px !important;
}

/* Ensure logo stays above map controls */
.leaflet-control-container .leaflet-top.leaflet-left {
    z-index: 990;
}