/* Economic Intelligence Panel Styles */

.economic-intelligence-panel {
    padding: 1.5rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    color: #1f2937;
}

.economic-intelligence-panel h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.economic-intelligence-panel p {
    color: #4b5563;
}

/* Compact Parameter Section */
.ei-params-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ei-params-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .ei-params-row {
        grid-template-columns: 1fr 2fr;
    }
}

.ei-param-group {
    position: relative;
}

.ei-country-group {
    min-width: 200px;
}

.ei-country-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ei-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: white;
    font-size: 0.875rem;
    cursor: pointer;
    max-height: 200px;
}

.ei-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    outline: none;
}

/* Chip Styles */
.ei-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid #d1d5db;
    border-radius: 2rem;
    background-color: white;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.ei-chip:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.ei-chip-active {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
}

.ei-chip-active:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.ei-chip-source {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

.ei-topics-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ei-sources-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.ei-sources-row .ei-label {
    margin-bottom: 0;
    font-weight: 600;
    color: #64748b;
    margin-right: 0.5rem;
}

.ei-sources-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.ei-generate-row {
    margin-top: 1rem;
    text-align: center;
}

.ei-btn-icon {
    margin-right: 0.5rem;
}

/* Action Bar */
.ei-action-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.ei-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ei-btn-action:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.ei-btn-action:active {
    background-color: #e5e7eb;
}

.ei-btn-action span {
    font-size: 1.1em;
}

/* Legacy Styles (keep for backwards compatibility) */
.ei-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .ei-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ei-label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    color: #374151;
    margin-bottom: 0.5rem;
}

.ei-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    outline: none;
}

.ei-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

.ei-dropdown {
    position: absolute;
    z-index: 10;
    width: 100%;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    margin-top: 0.25rem;
    max-height: 15rem;
    overflow-y: auto;
    display: none;
}

.ei-dropdown.show {
    display: block;
}

.ei-dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

.ei-dropdown-item:hover {
    background-color: #f3f4f6;
}

.ei-checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.ei-checkbox {
    height: 1rem;
    width: 1rem;
    color: #2563eb;
    border-color: #d1d5db;
    border-radius: 0.25rem;
}

.ei-checkbox-label {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.ei-topics-container {
    max-height: 15rem;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.ei-sources-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .ei-sources-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ei-btn-primary {
    padding: 0.75rem 2rem;
    background-color: #2563eb;
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ei-btn-primary:hover {
    background-color: #1d4ed8;
}

.ei-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ei-tabs-nav {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.ei-tab-btn {
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    font-weight: 400;
    font-size: 0.875rem;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.ei-tab-btn:hover {
    color: #374151;
    border-bottom-color: #d1d5db;
}

.ei-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.ei-content {
    max-width: none;
    color: #374151;
}

.ei-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Banner: compact horizontal display matching Banking/Briefing modules */
.ei-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 1;
    /* Compact ratio matching Banking/Briefing */
    overflow: hidden;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1e3a5f 100%);
}

.ei-banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the entire container, crop if needed */
    object-position: center;
}

.ei-banner-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.0) 0%, rgba(0, 0, 0, 0.45) 100%);
    color: #ffffff;
}

.ei-banner-title {
    font-size: 1.125rem;
    font-weight: 700;
}

.ei-banner-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Caption placed below the banner image to avoid overlap */
.ei-banner-caption {
    padding: 0.5rem 0.75rem;
    margin-bottom: 1rem;
}

.ei-banner-caption .ei-banner-title {
    color: #1f2937;
}

.ei-banner-caption .ei-banner-subtitle {
    color: #4b5563;
    margin-top: 0.25rem;
}

.ei-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.ei-content p {
    margin-bottom: 1rem;
}

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.relative {
    position: relative;
}

.ml-2 {
    margin-left: 0.5rem;
}

.text-red-500 {
    color: #ef4444;
}

.text-green-500 {
    color: #22c55e;
}

.animate-spin {
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.ei-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 16rem;
}

.ei-spinner {
    animation: spin 1s linear infinite;
    border-radius: 9999px;
    height: 3rem;
    width: 3rem;
    border-bottom-width: 2px;
    border-color: #2563eb;
    margin-bottom: 1rem;
}

.text-gray-500 {
    color: #6b7280;
}

.ei-error-container {
    background-color: #fef2f2;
    padding: 1rem;
    border-radius: 0.375rem;
}

.ei-error-title {
    color: #991b1b;
    font-weight: 400;
}

.ei-error-message {
    color: #b91c1c;
    margin-top: 0.5rem;
}

.ei-h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.ei-h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom-width: 1px;
    padding-bottom: 0.5rem;
}

.ei-h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.ei-list-item {
    margin-left: 1rem;
    list-style-type: disc;
}

.ei-link {
    color: #2563eb;
    text-decoration: none;
}

.ei-link:hover {
    text-decoration: underline;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Banner and Infographics Styles */
.ei-banner {
    position: relative;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.ei-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0.75rem;
}

.ei-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    backdrop-filter: blur(2px);
}

.ei-banner-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9), 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.ei-banner-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.6);
    font-weight: 400;
}

.ei-infographics-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .ei-infographics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .ei-infographics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.ei-infographic-card {
    background-color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #f3f4f6;
    transition: transform 0.2s;
}

.ei-infographic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.ei-infographic-card .text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.ei-infographic-card .text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.ei-infographic-card .font-semibold {
    font-weight: 600;
}

.ei-infographic-card .font-medium {
    font-weight: 400;
}

.ei-infographic-card .font-bold {
    font-weight: 700;
}

.ei-infographic-card .text-gray-600 {
    color: #4b5563;
}

.ei-infographic-card .text-gray-800 {
    color: #1f2937;
}

.ei-infographic-card .text-gray-500 {
    color: #6b7280;
}

.ei-infographic-card .mb-1 {
    margin-bottom: 0.25rem;
}

.ei-infographic-card .mb-2 {
    margin-bottom: 0.5rem;
}

.ei-infographic-card .px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.ei-infographic-card .py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.ei-infographic-card .rounded {
    border-radius: 0.25rem;
}

/* Sentiment Colors */
.bg-green-100 {
    background-color: #d1fae5;
}

.text-green-800 {
    color: #065f46;
}

.bg-red-100 {
    background-color: #fee2e2;
}

.text-red-800 {
    color: #991b1b;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.text-gray-800 {
    color: #1f2937;
}

.bg-blue-100 {
    background-color: #dbeafe;
}

.text-blue-800 {
    color: #1e40af;
}

/* Link Styles */
.ei-link {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

.ei-link:hover {
    color: #1d4ed8;
}

/* Clean source link styling */
.ei-source-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.ei-source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.875rem;
    text-decoration: none;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.ei-source-link:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
    transform: scale(1.1);
}

/* Infographic Image Display */
.ei-infographic-display {
    padding: 2rem;
    text-align: center;
}

.ei-infographic-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ei-infographic-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0.375rem;
}

.ei-infographic-prompt {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    border: 2px dashed #e2e8f0;
    margin: 1rem 0;
}

.ei-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.ei-btn-secondary:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
}