/* ===== PEST IDENTIFIER ===== */

.pi-header { background: linear-gradient(135deg, #2d5a1b 0%, #4a7c2f 50%, #6aab3d 100%) !important; }
.pi-layout { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; margin-bottom: 28px; }

/* Controls */
.pi-controls { background: #fff; border: 2px solid #d1fae5; border-radius: 20px; padding: 20px; position: sticky; top: 80px; max-height: 92vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d1fae5 #fff; }
.pi-controls::-webkit-scrollbar { width: 4px; }
.pi-controls::-webkit-scrollbar-thumb { background: #a7f3d0; border-radius: 3px; }
.pi-section { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 2px solid #f0fdf4; }
.pi-section:last-of-type { border-bottom: none; margin-bottom: 0; }
.pi-section-title { font-size: 12px; font-weight: 800; color: #1f2937; margin-bottom: 10px; }
.pi-section-title small { font-weight: 400; color: #9ca3af; font-size: 10px; }
.pi-hint { font-size: 11px; color: #9ca3af; margin-top: 6px; }

/* Mode tabs */
.pi-mode-tabs { display: flex; gap: 0; border: 2px solid #d1fae5; border-radius: 12px; overflow: hidden; }
.pi-mode-tab { flex: 1; background: #f0fdf4; border: none; padding: 10px 8px; font-size: 12px; font-weight: 700; color: #166534; cursor: pointer; transition: all .2s; text-align: center; }
.pi-mode-tab.active { background: linear-gradient(135deg, #2d5a1b, #4a7c2f); color: #fff; }
.pi-mode-tab:hover:not(.active) { background: #dcfce7; }

/* Photo Upload */
.pi-upload-zone { border: 2px dashed #a7f3d0; border-radius: 14px; padding: 28px 16px; text-align: center; cursor: pointer; transition: all .2s; background: #f0fdf4; }
.pi-upload-zone:hover { border-color: #4a7c2f; background: #dcfce7; }
.pi-upload-zone .pi-upload-icon { font-size: 36px; margin-bottom: 8px; }
.pi-upload-zone p { font-size: 13px; font-weight: 700; color: #166534; margin: 0 0 4px; }
.pi-upload-zone small { font-size: 11px; color: #9ca3af; }
.pi-upload-zone.dragover { border-color: #4a7c2f; background: #bbf7d0; }

/* Preview */
.pi-preview-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 2px solid #d1fae5; }
.pi-preview-wrap img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.pi-remove-photo { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.pi-remove-photo:hover { background: rgba(220,38,38,.8); }

/* Inputs */
.pi-input, .pi-textarea { width: 100%; border: 2px solid #d1fae5; border-radius: 10px; padding: 10px 13px; font-size: 13px; font-family: inherit; outline: none; transition: border-color .2s; box-sizing: border-box; color: #1f2937; }
.pi-textarea { resize: vertical; line-height: 1.6; }
.pi-input:focus, .pi-textarea:focus { border-color: #4a7c2f; }

/* Season */
.pi-season-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; }
.pi-season-btn { background: #f0fdf4; border: 1.5px solid #d1fae5; border-radius: 9px; padding: 8px 6px; font-size: 11px; font-weight: 700; color: #166534; cursor: pointer; transition: all .2s; text-align: center; }
.pi-season-btn:hover { border-color: #4a7c2f; }
.pi-season-btn.active { background: linear-gradient(135deg, #2d5a1b, #4a7c2f); border-color: #4a7c2f; color: #fff; }

/* Language */
.pi-lang-btns { display: flex; gap: 8px; }
.pi-lang-btn { flex: 1; background: #f0fdf4; border: 1.5px solid #d1fae5; border-radius: 9px; padding: 9px 5px; font-size: 12px; font-weight: 700; color: #166534; cursor: pointer; transition: all .2s; text-align: center; }
.pi-lang-btn:hover { border-color: #4a7c2f; }
.pi-lang-btn.active { background: linear-gradient(135deg, #2d5a1b, #4a7c2f); border-color: #4a7c2f; color: #fff; }

/* Examples */
.pi-examples { display: flex; flex-wrap: wrap; gap: 6px; }
.pi-ex-btn { background: #f0fdf4; border: 1.5px solid #d1fae5; border-radius: 20px; padding: 6px 12px; font-size: 11px; font-weight: 700; color: #166534; cursor: pointer; transition: all .2s; }
.pi-ex-btn:hover { background: #4a7c2f; color: #fff; border-color: #4a7c2f; }

/* Generate */
.pi-generate-btn { width: 100%; background: linear-gradient(135deg, #2d5a1b, #4a7c2f, #6aab3d); color: #fff; border: none; border-radius: 14px; padding: 16px; font-size: 17px; font-weight: 900; cursor: pointer; transition: all .3s; box-shadow: 0 4px 20px rgba(74,124,47,.4); display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.pi-generate-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(74,124,47,.5); }
.pi-generate-btn:disabled { opacity: .7; cursor: not-allowed; }

/* Output */
.pi-output { display: flex; flex-direction: column; gap: 14px; min-height: 500px; }

/* Placeholder */
.pi-placeholder { background: linear-gradient(135deg, #f0fdf4, #ecfdf5); border: 3px dashed #a7f3d0; border-radius: 20px; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; justify-content: center; min-height: 400px; }
.pi-ph-icon { font-size: 64px; animation: pi-float 3s ease-in-out infinite; }
@keyframes pi-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.pi-placeholder h3 { font-size: 22px; font-weight: 800; color: #166534; margin: 0; }
.pi-placeholder p  { font-size: 14px; color: #2d5a1b; max-width: 380px; margin: 0; line-height: 1.6; }
.pi-ph-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 440px; }
.pi-ph-tip { background: #fff; border: 2px solid #d1fae5; border-radius: 10px; padding: 8px 10px; font-size: 12px; font-weight: 600; color: #166534; text-align: center; }

/* Loading */
.pi-loading { background: linear-gradient(135deg, #f0fdf4, #ecfdf5); border: 2px solid #a7f3d0; border-radius: 20px; padding: 60px 30px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; min-height: 300px; justify-content: center; }
.pi-loading-icon { font-size: 52px; animation: pi-spin 3s linear infinite; }
@keyframes pi-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.pi-loading-title { font-size: 18px; font-weight: 800; color: #166534; }
.pi-loading p { font-size: 13px; color: #2d5a1b; margin: 0; }
.pi-loading-dots { display: flex; gap: 8px; }
.pi-loading-dots span { width: 10px; height: 10px; background: #4a7c2f; border-radius: 50%; animation: pi-dot 1s ease-in-out infinite; }
.pi-loading-dots span:nth-child(2) { animation-delay: .2s; }
.pi-loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes pi-dot { 0%,100% { transform: scale(.6); opacity: .4; } 50% { transform: scale(1.2); opacity: 1; } }

/* Error */
.pi-error { display: flex; align-items: center; gap: 10px; padding: 20px; background: #fef2f2; border: 2px solid #fecaca; border-radius: 14px; color: #dc2626; font-size: 14px; font-weight: 600; }

/* Source badge */
.pi-source-badge { background: #dcfce7; border: 2px solid #a7f3d0; border-radius: 10px; padding: 8px 14px; font-size: 12px; font-weight: 700; color: #166534; align-self: flex-start; }

/* ID Card */
.pi-id-card { background: linear-gradient(135deg, #f0fdf4, #ecfdf5); border: 2px solid #a7f3d0; border-radius: 16px; padding: 20px; }
.pi-id-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.pi-id-left { display: flex; align-items: center; gap: 14px; }
.pi-pest-icon { font-size: 40px; }
.pi-pest-name { font-size: 18px; font-weight: 800; color: #166534; margin: 0 0 4px; }
.pi-hindi-name { font-size: 13px; color: #4a7c2f; margin: 0; font-style: italic; }
.pi-id-badges { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.pi-badge { border-radius: 20px; padding: 4px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.pi-confidence { background: #dcfce7; color: #166534; }
.pi-severity { background: #fef2f2; color: #dc2626; }
.pi-severity.low     { background: #dcfce7; color: #166534; }
.pi-severity.medium  { background: #fef9c3; color: #92400e; }
.pi-severity.high    { background: #fee2e2; color: #dc2626; }
.pi-severity.very-high { background: #dc2626; color: #fff; }
.pi-pest-desc { font-size: 14px; color: #374151; line-height: 1.7; margin: 0; }

/* Tabs */
.pi-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pi-tab { background: #f0fdf4; border: 1.5px solid #d1fae5; border-radius: 9px; padding: 8px 14px; font-size: 12px; font-weight: 700; color: #166534; cursor: pointer; transition: all .2s; }
.pi-tab:hover { border-color: #4a7c2f; }
.pi-tab.active { background: linear-gradient(135deg, #2d5a1b, #4a7c2f); border-color: #4a7c2f; color: #fff; }

/* Tab Content */
.pi-tab-content { background: #fff; border: 2px solid #d1fae5; border-radius: 16px; padding: 20px; min-height: 160px; }
.pi-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pi-list-item { background: #f0fdf4; border: 1.5px solid #d1fae5; border-radius: 10px; padding: 11px 14px; font-size: 13px; color: #1f2937; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; }
.pi-list-item::before { content: '✓'; color: #4a7c2f; font-weight: 900; flex-shrink: 0; }
.pi-list-item.chemical::before  { content: '💊'; }
.pi-list-item.prevention::before { content: '🛡️'; }
.pi-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pi-info-item { background: #f0fdf4; border: 1.5px solid #d1fae5; border-radius: 10px; padding: 12px; }
.pi-info-label { font-size: 11px; font-weight: 800; color: #4a7c2f; text-transform: uppercase; margin-bottom: 4px; }
.pi-info-val { font-size: 13px; color: #1f2937; font-weight: 600; }
.pi-regen-btn { background: #fff; border: 2px solid #d1fae5; border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 700; color: #4a7c2f; cursor: pointer; transition: all .2s; align-self: flex-start; }
.pi-regen-btn:hover { border-color: #4a7c2f; background: #f0fdf4; }
.pi-results { display: flex; flex-direction: column; gap: 14px; }

/* Responsive */
@media (max-width: 1000px) { .pi-layout { grid-template-columns: 1fr; } .pi-controls { position: static; max-height: none; } }
@media (max-width: 600px) {
    .pi-season-grid { grid-template-columns: repeat(2, 1fr); }
    .pi-ph-tips { grid-template-columns: repeat(2, 1fr); }
    .pi-info-grid { grid-template-columns: 1fr; }
    .pi-id-header { flex-direction: column; }
    .pi-id-badges { flex-direction: row; }
    .pi-tabs { gap: 5px; }
    .pi-tab { padding: 7px 10px; font-size: 11px; }
}
