/**
 * Стили для Gutenberg блока "AI-Анализ компании" (frontend)
 * WPGIS v1.3.2
 * Полнофункциональный блок с настройками, прогрессом и экспортом
 */

/* ===== Основной контейнер ===== */
.wpgis-ai-gutenberg-block {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    max-width: 900px;
}

.wpgis-ai-gutenberg-block.wpgis-theme-dark {
    background: #1e1e1e;
    color: #ffffff;
}

/* ===== Заголовок блока ===== */
.wpgis-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 3px solid #e0e0e0;
    margin-bottom: 25px;
}

.wpgis-theme-dark .wpgis-block-header {
    border-bottom-color: #333;
}

.wpgis-block-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
}

.wpgis-theme-dark .wpgis-block-title {
    color: #ffffff;
}

.wpgis-block-title .wpgis-icon {
    font-size: 32px;
    line-height: 1;
}

.wpgis-company-badge {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ===== Панель настроек ===== */
.wpgis-block-configurator {
    margin-bottom: 25px;
}

.wpgis-config-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.wpgis-config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpgis-config-field-full {
    grid-column: 1 / -1;
}

.wpgis-config-field label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.wpgis-theme-dark .wpgis-config-field label {
    color: #e0e0e0;
}

.wpgis-config-field select,
.wpgis-config-field input[type="text"],
.wpgis-config-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #2c3e50;
    background: #ffffff;
    transition: all 0.2s ease;
}

.wpgis-theme-dark .wpgis-config-field select,
.wpgis-theme-dark .wpgis-config-field input,
.wpgis-theme-dark .wpgis-config-field textarea {
    background: #2a2a2a;
    border-color: #444;
    color: #ffffff;
}

.wpgis-config-field select:focus,
.wpgis-config-field input:focus,
.wpgis-config-field textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.wpgis-config-field textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

/* ===== Кнопка запуска анализа ===== */
.wpgis-run-analysis-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wpgis-run-analysis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.wpgis-run-analysis-btn:active {
    transform: translateY(0);
}

.wpgis-run-analysis-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.wpgis-run-analysis-btn .btn-icon {
    font-size: 22px;
    line-height: 1;
}

/* ===== Прогресс ===== */
.wpgis-block-progress {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.wpgis-theme-dark .wpgis-block-progress {
    background: #2a2a2a;
}

.wpgis-progress-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wpgis-progress-text {
    font-size: 16px;
    color: #2c3e50;
    margin: 10px 0 15px;
    font-weight: 500;
}

.wpgis-theme-dark .wpgis-progress-text {
    color: #e0e0e0;
}

.wpgis-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 15px;
}

.wpgis-theme-dark .wpgis-progress-bar {
    background: #444;
}

.wpgis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Результаты ===== */
.wpgis-block-results {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    border-left: 5px solid #667eea;
}

.wpgis-theme-dark .wpgis-block-results {
    background: #2a2a2a;
}

.wpgis-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.wpgis-theme-dark .wpgis-results-header {
    border-bottom-color: #444;
}

.wpgis-results-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.wpgis-theme-dark .wpgis-results-title {
    color: #ffffff;
}

.wpgis-close-results {
    background: none;
    border: none;
    font-size: 32px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wpgis-close-results:hover {
    background: #dc3545;
    color: white;
}

.wpgis-results-content {
    color: #2c3e50;
    line-height: 1.8;
    margin-bottom: 20px;
}

.wpgis-theme-dark .wpgis-results-content {
    color: #e0e0e0;
}

.wpgis-results-content h2,
.wpgis-results-content h3,
.wpgis-results-content h4 {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
}

.wpgis-theme-dark .wpgis-results-content h2,
.wpgis-theme-dark .wpgis-results-content h3,
.wpgis-theme-dark .wpgis-results-content h4 {
    color: #ffffff;
}

.wpgis-results-content ul,
.wpgis-results-content ol {
    padding-left: 25px;
}

.wpgis-results-content li {
    margin-bottom: 8px;
}

/* ===== Метаданные ===== */
.wpgis-results-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 20px;
}

.wpgis-theme-dark .wpgis-results-metadata {
    background: #1e1e1e;
}

.wpgis-metadata-item {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.metadata-label {
    color: #6c757d;
    font-weight: 500;
}

.metadata-value {
    color: #2c3e50;
    font-weight: 600;
}

.wpgis-theme-dark .metadata-value {
    color: #ffffff;
}

/* ===== Действия ===== */
.wpgis-results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.wpgis-action-btn {
    flex: 1 0 180px;
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, rgba(248, 250, 255, 0.95), rgba(236, 244, 255, 0.95));
    color: #1e293b;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    text-align: center;
}

.wpgis-theme-dark .wpgis-action-btn {
    background: #2a2a2a;
    border-color: #444;
    color: #ffffff;
}

.wpgis-action-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.18);
    background: linear-gradient(135deg, rgba(236, 244, 255, 0.98), rgba(219, 234, 254, 0.98));
    color: #312e81;
}

/* icon alignment */
.wpgis-action-btn svg,
.wpgis-action-btn i {
    margin-right: 6px;
    font-size: 16px;
}

/* ===== Notice блок ===== */
.wpgis-block-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.wpgis-notice-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.wpgis-notice-warning p {
    margin: 0;
}

/* ===== Адаптивность ===== */
@media (max-width: 768px) {
    .wpgis-ai-gutenberg-block {
        padding: 20px;
    }
    
    .wpgis-config-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .wpgis-block-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .wpgis-block-title {
        font-size: 20px;
    }
    
    .wpgis-results-actions {
        grid-template-columns: 1fr;
    }
    
    .wpgis-results-metadata {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== Анимации ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpgis-block-results {
    animation: fadeIn 0.3s ease;
}



