/* =============================================
   Pahani Analyzer — AI-Powered Land Record Analysis
   Theme: Deep Teal/AI (#e55a1b → #e55a1b → #ff6725)
   Prefix: pa-
   ============================================= */

/* Hero Section */
.pa-search-hero {
    background: linear-gradient(135deg, #ff6725 0%, #ff8f5c 50%, #ffb88c 100%);
    padding: 32px 28px 22px;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}
.pa-search-hero-decoration {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.pa-search-hero-decoration::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}
.pa-search-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.pa-search-hero-badge i { margin-right: 5px; }
.pa-search-hero-title {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}
.pa-search-hero-desc {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
    margin: 0;
}
.pa-search-hero-desc a {
    color: #ffd4c2;
    text-decoration: underline;
    font-weight: 500;
}
.pa-search-hero-desc a:hover { color: #fff; text-decoration: none; }
.pa-search-hero + .pa-search-card { border-radius: 0 0 20px 20px !important; }
.pa-search-card { padding: 24px; }

/* Input Tabs */
.pa-tab-group {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}
.pa-tab-btn {
    flex: 1;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    text-align: center;
}
.pa-tab-btn i { margin-right: 6px; }
.pa-tab-btn.active {
    color: #e55a1b;
    border-bottom-color: #e55a1b;
}
.pa-tab-btn:hover:not(.active) {
    color: #ff6725;
}
.pa-tab-pane {
    display: none;
}
.pa-tab-pane.active {
    display: block;
}

/* Textarea */
.pa-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    resize: vertical;
    transition: border-color 0.3s;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    caret-color: #FF6725;
}
.pa-textarea:focus {
    outline: none;
    border-color: #e55a1b;
    box-shadow: 0 0 0 3px rgba(0,105,92,0.1);
}
.pa-textarea::placeholder {
    color: #aaa;
    font-family: inherit;
}

/* File Upload Area */
.pa-upload-area {
    border: 2px dashed #ffd6c2;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    background: #f1f8f6;
    transition: all 0.3s;
    position: relative;
}
.pa-upload-area:hover {
    border-color: #ff6725;
    background: #e8f5f2;
}
.pa-upload-area.dragging {
    border-color: #e55a1b;
    background: #fff3ed;
}
.pa-upload-icon {
    font-size: 48px;
    color: #ff6725;
    margin-bottom: 16px;
}
.pa-upload-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.pa-upload-desc {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
}
.pa-upload-btn {
    display: inline-block;
    background: #e55a1b;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 8px;
    border: none;
    transition: background 0.3s;
}
.pa-upload-btn:hover { background: #e55a1b; }
.pa-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}
.pa-file-preview {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff3ed;
    border-radius: 10px;
    margin-top: 16px;
}
.pa-file-preview.show { display: flex; }
.pa-file-preview i { font-size: 24px; color: #e55a1b; }
.pa-file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pa-file-remove {
    font-size: 18px;
    color: #c62828;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.3s;
}
.pa-file-remove:hover { background: rgba(198,40,40,0.1); }

/* Supported formats hint */
.pa-formats-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}
.pa-formats-hint span {
    display: inline-block;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 4px 2px 0;
    font-size: 11px;
    font-weight: 600;
    color: #666;
}

/* AI Thinking Animation */
.pa-thinking {
    display: none;
    text-align: center;
    padding: 40px 20px;
}
.pa-thinking.show { display: block; }
.pa-thinking-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.pa-thinking-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6725;
    animation: pa-bounce 1.4s infinite ease-in-out both;
}
.pa-thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.pa-thinking-dot:nth-child(2) { animation-delay: -0.16s; }
.pa-thinking-dot:nth-child(3) { animation-delay: 0s; }
@keyframes pa-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.pa-thinking-text {
    font-size: 15px;
    font-weight: 600;
    color: #e55a1b;
    margin-bottom: 6px;
}
.pa-thinking-subtext {
    font-size: 13px;
    color: #888;
}

/* Analysis Result Card */
.pa-result-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
}
.pa-result-header {
    background: linear-gradient(135deg, #fff3ed 0%, #fff3ed 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}
.pa-result-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #e55a1b;
}
.pa-result-header p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #555;
}

/* Analysis Sections */
.pa-analysis-section {
    margin-bottom: 24px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    transition: transform 0.2s, box-shadow 0.2s;
}
.pa-analysis-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.pa-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.pa-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.pa-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0;
}
.pa-section-body {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
}
.pa-section-body ul {
    padding-left: 20px;
    margin: 8px 0 0;
}
.pa-section-body ul li {
    margin-bottom: 6px;
}

/* Section color variants */
.pa-section-summary .pa-section-icon { background: #fff3ed; color: #e55a1b; }
.pa-section-summary { border-color: #ffd6c2; }

.pa-section-ownership .pa-section-icon { background: #fff3ed; color: #ff6725; }
.pa-section-ownership { border-color: #ffd6c2; }

.pa-section-flags .pa-section-icon { background: #fbe9e7; color: #c62828; }
.pa-section-flags { border-color: #ffd6c2; }

.pa-section-classification .pa-section-icon { background: #fff3ed; color: #ff6725; }
.pa-section-classification { border-color: #ffd6c2; }

.pa-section-eligibility .pa-section-icon { background: #fff3e0; color: #e65100; }
.pa-section-eligibility { border-color: #ffe0b2; }

.pa-section-recommendations .pa-section-icon { background: #fff3ed; color: #e55a1b; }
.pa-section-recommendations { border-color: #ffd6c2; }

/* Red Flags as tag-like items */
.pa-flag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff5f5;
    color: #c62828;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid #ffd6c2;
    margin: 4px 4px 4px 0;
}
.pa-flag-item i { font-size: 12px; }

/* Recommendations as checklist */
.pa-recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #faf5ff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #ffd6c2;
    font-size: 13px;
    color: #444;
}
.pa-recommendation-item i {
    color: #e55a1b;
    margin-top: 2px;
    flex-shrink: 0;
}

/* No flags — safe badge */
.pa-safe-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3ed;
    color: #ff6725;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #ffd6c2;
}

/* Configuring message */
.pa-configuring {
    display: none;
    text-align: center;
    padding: 40px 20px;
}
.pa-configuring.show { display: block; }
.pa-configuring-icon {
    font-size: 48px;
    color: #ff6725;
    margin-bottom: 16px;
}
.pa-configuring-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.pa-configuring-desc {
    font-size: 14px;
    color: #888;
    max-width: 400px;
    margin: 0 auto;
}

/* Disclaimer */
.pa-disclaimer {
    background: #f5f5f5;
    border-radius: 10px;
    padding: 16px 20px;
    font-size: 12px;
    color: #888;
    margin-top: 24px;
    line-height: 1.7;
}
.pa-disclaimer strong { color: #666; }

/* Results Actions */
.pa-results-actions .btn {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
}

/* FAQ Section */
.pa-faq-item {
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s;
}
.pa-faq-item.open { border-color: #e55a1b; }
.pa-faq-question {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    background: #fafafa;
}
.pa-faq-question i { transition: transform 0.3s; color: #e55a1b; }
.pa-faq-item.open .pa-faq-question i { transform: rotate(180deg); }
.pa-faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}
.pa-faq-item.open .pa-faq-answer {
    padding: 0 20px 16px;
    max-height: 500px;
}

/* Error state */
.pa-error-card {
    text-align: center;
    padding: 30px;
}
.pa-error-card i {
    font-size: 48px;
    color: #e53935;
    margin-bottom: 16px;
}
.pa-error-card h4 {
    color: #333;
    margin-bottom: 8px;
}
.pa-error-card p {
    color: #666;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pa-search-hero { padding: 24px 20px 18px; }
    .pa-search-hero-title { font-size: 20px; }
    .pa-search-card { padding: 18px; }
    .pa-tab-btn { font-size: 13px; padding: 12px 10px; }
    .pa-textarea { min-height: 160px; font-size: 13px; }
    .pa-upload-area { padding: 32px 16px; }
    .pa-upload-icon { font-size: 36px; }
    .pa-analysis-section { padding: 16px; }
    .pa-section-icon { width: 34px; height: 34px; font-size: 15px; }
    .pa-result-card { padding: 20px; }
    .pa-results-actions { flex-wrap: wrap; }
}

@media (max-width: 576px) {
    .pa-search-hero-title { font-size: 18px; }
    .pa-search-hero-desc { font-size: 13px; }
    .pa-tab-group { flex-direction: column; border-bottom: none; gap: 4px; }
    .pa-tab-btn {
        border-bottom: none;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 0;
    }
    .pa-tab-btn.active {
        border-color: #e55a1b;
        background: #f1f8f6;
    }
    .pa-flag-item { font-size: 12px; padding: 5px 10px; }
}

/* Print styles */
@media print {
    .dashboard-side-menu, .dashboard-header, .pa-search-hero, .pa-search-card,
    .related-tool-card, #tool-article, .pa-faq-item, footer, nav, .breadcrumb,
    .pa-results-actions, .pa-thinking, .pa-configuring, .pa-disclaimer { display: none !important; }
    .pa-result-card { box-shadow: none !important; border: 1px solid #ddd; }
    .pa-result-card::before {
        content: 'Pahani Analyzer — AI Land Record Analysis | Source: tg.verified.realestate | Printed: ' attr(data-print-date);
        display: block;
        font-size: 12px;
        color: #666;
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: 1px solid #ddd;
    }
    .pa-analysis-section { break-inside: avoid; page-break-inside: avoid; }
    .pa-analysis-section:hover { transform: none; box-shadow: none; }
}

.svg-container {
    width: 100%;
    height: auto;
}
svg {
    width: 100%;
    height: auto;
}
.ec-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.frosted-glass {
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.7);
}
.ec-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #ff6725;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: pa-spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes pa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.ec-loader-text {
    text-align: center;
    max-width: 500px;
    padding: 20px;
}
.ec-loader-progress {
    width: 100%;
    background-color: #f3f3f3;
    border-radius: 5px;
    margin: 15px 0;
    height: 10px;
}
.ec-loader-progress-bar {
    height: 10px;
    border-radius: 5px;
    background-color: #ff6725;
    width: 0%;
    transition: width 0.5s;
}
