/* Estilos personalizados para a API CNPJ */

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Classes utilitárias */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Formulários */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Botões */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Resultado da consulta - Melhorado */
.resultado-container {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    border-radius: 16px;
    padding: 2px;
    margin-bottom: 8px;
}

.resultado-item {
    background: white;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #3b82f6;
    position: relative;
    overflow: hidden;
}

.resultado-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

.resultado-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
    border-left-color: #1e40af;
}

.resultado-label {
    font-weight: 600;
    color: #4b5563; /* Cinza mais escuro para melhor contraste */
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resultado-valor {
    color: #111827; /* Preto mais forte para máximo contraste */
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.6;
    word-break: break-word;
}

.resultado-valor strong {
    color: #000000; /* Preto puro para ênfase máxima */
    font-weight: 700;
}

/* Grid layout para resultados */
.resultado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Cards especiais */
.resultado-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.resultado-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.resultado-header p {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* Status badges melhorados */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-ativa {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.status-inativa {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.status-suspensa {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Informações de contato */
.resultado-contato {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.contato-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.contato-item i {
    color: #3b82f6;
    font-size: 1rem;
}

/* Endereço melhorado */
.endereco-completo {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    line-height: 1.8;
}

.endereco-linha {
    margin-bottom: 4px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.endereco-linha:last-child {
    margin-bottom: 0;
}

/* Atividades */
.atividade-item {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid #3b82f6;
}

.atividade-codigo {
    font-family: 'Courier New', monospace;
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Botões de ação melhorados */
.resultado-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

/* Ícones melhorados */
.resultado-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .resultado-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .resultado-item {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .resultado-valor {
        font-size: 1rem;
    }
    
    .resultado-actions {
        flex-direction: column;
    }
    
    .btn-action {
        justify-content: center;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .resultado-item {
        padding: 8px;
    }
}

/* Tooltips */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Código de API */
.code-block {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
    position: relative;
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.warning {
    background: #f59e0b;
}

.notification.info {
    background: #3b82f6;
}

/* Dark mode support - Ajustado para melhor visibilidade */
@media (prefers-color-scheme: dark) {
    .card {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .resultado-item {
        background: #374151;
        color: #f9fafb;
        border-left-color: #60a5fa;
    }
    
    .resultado-item:hover {
        background: #4b5563;
    }
    
    .resultado-label {
        color: #d1d5db; /* Cinza claro para labels no dark mode */
    }
    
    .resultado-valor {
        color: #f9fafb; /* Branco para valores no dark mode */
    }
    
    .resultado-valor strong {
        color: #ffffff; /* Branco puro para negrito */
    }
    
    .endereco-completo {
        background: #4b5563;
        border-color: #6b7280;
    }
    
    .contato-item {
        background: #4b5563;
        border-color: #6b7280;
        color: #f9fafb;
    }
    
    .atividade-item {
        background: #4b5563;
    }
    
    .endereco-linha {
        color: #f9fafb;
    }
    
    .endereco-linha span:not(.resultado-icon) {
        color: #f9fafb;
    }
    
    .resultado-icon {
        background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    }
    
    /* Quadro Societário no dark mode */
    .socio-item {
        background: #4b5563;
    }
    
    .socio-item .resultado-valor {
        color: #f9fafb;
    }
}

/* Quadro Societário - estilos normais */
.socio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.socio-item:last-child {
    margin-bottom: 0;
}
