/**
 * IAgroTec - Sistema de Gestão para o Agronegócio
 * Classes CSS básicas e reutilizáveis
 * 
 * Padrão: Todas as classes customizadas começam com "iv-" para evitar conflitos
 * Compatível com Bootstrap 5 e NiceAdmin template
 */

/* ===== ANÁLISE DE IA - COMPONENTES REUTILIZÁVEIS ===== */

/* Container principal da análise de IA */
.iv-ai-analysis-section {
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

.iv-ai-analysis-section .card {
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.1);
    border: 2px solid #e3f2fd;
}

.iv-ai-analysis-section .card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: none;
    color: white;
}

/* Botão de análise */
.iv-ai-analysis-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.iv-ai-analysis-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: white;
}

.iv-ai-analysis-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.3);
    color: white;
}

.iv-ai-analysis-btn:active {
    transform: translateY(0);
    color: white;
}

.iv-ai-analysis-btn:disabled {
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

/* Container de loading da IA */
.iv-ai-loading {
    display: none;
    text-align: center;
    padding: 3rem 1rem;
    color: #667eea;
}

.iv-ai-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #667eea;
}

.iv-ai-loading p {
    margin-top: 1rem;
    font-weight: 500;
    color: #667eea;
}

/* Container do conteúdo da análise */
.iv-ai-content {
    padding: 1.5rem;
}

/* Formatação do conteúdo da análise */
.iv-ai-response {
    line-height: 1.8;
    color: #333;
    white-space: normal;
}

.iv-ai-response p {
    margin-bottom: 1rem;
}

.iv-ai-response strong {
    color: #0056b3;
}

.iv-ai-response h3, .iv-ai-response h4 {
    color: #667eea;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.iv-ai-response ul, .iv-ai-response ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.iv-ai-response blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 1rem 0;
    background-color: #f8f9ff;
    font-style: italic;
}

/* Badge de status da análise */
.iv-ai-status {
    transition: all 0.3s ease;
    font-weight: 500;
}

/* Rodapé da análise */
.iv-ai-footer {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1.5rem;
}

.iv-ai-footer .text-muted {
    font-size: 0.875rem;
}

.iv-ai-footer .bi {
    margin-right: 0.5rem;
}

/* Estados de mensagens da IA */
.iv-ai-message {
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
}

.iv-ai-message.iv-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.iv-ai-message.iv-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.iv-ai-message.iv-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.iv-ai-message.iv-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Ícones para mensagens */
.iv-ai-message .bi {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* Animação para campos sugeridos pela IA */
.iv-ai-suggested {
    animation: iv-highlight-field 2s ease-in-out;
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

@keyframes iv-highlight-field {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(102, 126, 234, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

/* Responsividade para análise de IA */
@media (max-width: 768px) {
    .iv-ai-analysis-section {
        margin-top: 1rem;
    }
    
    .iv-ai-analysis-btn {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .iv-ai-content {
        padding: 1rem;
    }
    
    .iv-ai-loading {
        padding: 2rem 1rem;
    }
    
    .iv-ai-response {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .iv-ai-loading .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    .iv-ai-response {
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    .iv-ai-message {
        padding: 1rem;
    }
}

/* ===== GRÁFICOS E VISUALIZAÇÕES ===== */

/* Container para gráficos */
.iv-chart-container {
    position: relative;
    margin: 1.5rem 0;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.iv-chart-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.iv-chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    color: #667eea;
}

/* ===== UTILITÁRIOS GERAIS ===== */

/* Gradientes temáticos */
.iv-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.iv-gradient-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.iv-gradient-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.iv-gradient-info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* Sombras customizadas */
.iv-shadow-soft {
    box-shadow: 0 2px 25px rgba(0, 0, 0, 0.1);
}

.iv-shadow-medium {
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.15);
}

.iv-shadow-strong {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Transições suaves */
.iv-transition {
    transition: all 0.3s ease;
}

.iv-transition-fast {
    transition: all 0.15s ease;
}

.iv-transition-slow {
    transition: all 0.5s ease;
}

/* Estados hover para cards */
.iv-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
}

/* Bordas temáticas */
.iv-border-primary {
    border: 2px solid #667eea;
}

.iv-border-success {
    border: 2px solid #28a745;
}

.iv-border-warning {
    border: 2px solid #ffc107;
}

.iv-border-danger {
    border: 2px solid #dc3545;
}

/* Background patterns para seções especiais */
.iv-pattern-dots {
    background-image: radial-gradient(circle, #667eea 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

.iv-pattern-grid {
    background-image: linear-gradient(#667eea 1px, transparent 1px),
                      linear-gradient(90deg, #667eea 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
}

/* ===== COMPONENTES ESPECÍFICOS DO AGRONEGÓCIO ===== */

/* Badge para tipos de culturas */
.iv-crop-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.iv-crop-soja {
    background-color: #e8f5e8;
    color: #2d5a2d;
    border: 1px solid #4caf4f;
}

.iv-crop-milho {
    background-color: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffb300;
}

.iv-crop-algodao {
    background-color: #f5f5f5;
    color: #424242;
    border: 1px solid #9e9e9e;
}

/* Indicadores de status rurais */
.iv-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
}

.iv-status-plantado {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.iv-status-colhido {
    background-color: #fff3e0;
    color: #ef6c00;
}

.iv-status-vendido {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* Métricas rurais */
.iv-metric-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: white;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.iv-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.iv-metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.iv-metric-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.iv-metric-unit {
    font-size: 0.8rem;
    color: #999;
    font-weight: normal;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .iv-ai-response {
        color: #f8f9fa;
    }
    
    .iv-ai-response strong {
        color: #5a9fd4;
    }
    
    .iv-chart-container {
        background: #343a40;
    }
    
    .iv-metric-card {
        background: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .iv-metric-value {
        color: #f8f9fa;
    }
}