/* Container principal do frontend */
#antt-multas-container {
    max-width: 800px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Formulário */
#antt-consulta-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    color: white;
}

#antt-consulta-form h3 {
    margin: 0 0 20px 0;
    color: white;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

#antt-consulta-form p {
    margin-bottom: 15px;
}

#antt-consulta-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: rgba(255,255,255,0.9);
}

#antt-consulta-form input[type="text"] {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

#antt-consulta-form input[type="text"]:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

#antt-consulta-form input[type="text"]::placeholder {
    color: rgba(255,255,255,0.7);
}

#antt-consulta-form button {
    background: rgba(255,255,255,0.9);
    color: #4c51bf;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#antt-consulta-form button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#antt-consulta-form button:active {
    transform: translateY(0);
}

/* Loading */
#antt-loading {
    text-align: center;
    padding: 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e1e5e9;
}

#antt-loading p {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Spinner animado */
.antt-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: antt-spin 1s linear infinite;
}

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

/* Resultados */
.antt-resultados {
    padding: 0;
}

.antt-resultados h4 {
    margin: 0;
    padding: 20px 30px;
    background: #f8fafc;
    border-bottom: 1px solid #e1e5e9;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

.antt-multa-item {
    border-bottom: 1px solid #f1f5f9;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background-color 0.2s ease;
}

.antt-multa-item:hover {
    background: #f8fafc;
}

.antt-multa-item:last-child {
    border-bottom: none;
}

.antt-multa-info {
    flex: 1;
    line-height: 1.6;
}

.antt-multa-info strong {
    color: #374151;
    font-weight: 600;
}

.antt-multa-info br + strong {
    margin-top: 8px;
    display: inline-block;
}

.antt-multa-acoes {
    flex-shrink: 0;
    margin-left: 25px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.antt-multa-acoes button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.antt-multa-acoes button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.antt-download-auto {
    background: #059669 !important;
}

.antt-download-auto:hover {
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3) !important;
}

.antt-boleto {
    background: #dc2626 !important;
}

.antt-boleto:hover {
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3) !important;
}

/* Estados dos botões */
.antt-multa-acoes button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.antt-loading-btn {
    position: relative;
    color: transparent !important;
}

.antt-loading-btn::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: antt-spin 0.8s ease infinite;
}

/* Mensagens */
.antt-erro {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 16px 20px;
    margin: 20px 30px;
    border-radius: 6px;
    font-weight: 500;
}

.antt-info {
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    padding: 16px 20px;
    margin: 20px 30px;
    border-radius: 6px;
    font-weight: 500;
}

.antt-sucesso {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 16px 20px;
    margin: 20px 30px;
    border-radius: 6px;
    font-weight: 500;
}

/* Ícones nos botões */
.antt-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Responsividade */
@media (max-width: 768px) {
    #antt-multas-container {
        margin: 10px;
        border-radius: 6px;
    }
    
    #antt-consulta-form {
        padding: 20px;
    }
    
    #antt-consulta-form h3 {
        font-size: 20px;
    }
    
    #antt-consulta-form input[type="text"] {
        max-width: none;
    }
    
    .antt-multa-item {
        flex-direction: column;
        padding: 20px;
    }
    
    .antt-multa-acoes {
        margin-left: 0;
        margin-top: 15px;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .antt-multa-acoes button {
        flex: 1;
        min-width: auto;
    }
    
    .antt-resultados h4 {
        padding: 15px 20px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    #antt-consulta-form {
        padding: 15px;
    }
    
    .antt-multa-item {
        padding: 15px;
    }
    
    .antt-multa-acoes {
        flex-direction: column;
    }
    
    .antt-multa-acoes button {
        width: 100%;
    }
}

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

.antt-resultados {
    animation: antt-fadeIn 0.5s ease-out;
}

.antt-multa-item {
    animation: antt-fadeIn 0.6s ease-out;
}

/* Estados de hover melhorados */
.antt-multa-item:hover .antt-multa-acoes button {
    transform: translateY(-1px);
}

/* Melhorias de acessibilidade */
.antt-multa-acoes button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#antt-consulta-form input[type="text"]:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading do formulário */
#antt-loading {
    display: none;
}

#antt-loading.show {
    display: block;
    animation: antt-fadeIn 0.3s ease-out;
}

/* Estilo para dados em destaque */
.antt-valor-destaque {
    font-size: 18px;
    font-weight: 700;
    color: #dc2626;
}

.antt-auto-numero {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

/* Melhorias visuais extras */
.antt-multa-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

@media (max-width: 640px) {
    .antt-multa-info {
        grid-template-columns: 1fr;
    }
}