/**
 * Estilos para Modais de Erro Otimizados
 * Design amigável, educativo e não-assustador
 */

/* Modal Backdrop */
.error-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

/* Modal Container */
.error-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

/* Error Modal */
.error-modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.error-modal.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Modal Content */
.error-modal-content {
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.error-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    border-bottom: 1px solid #E5E7EB;
}

.error-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.error-modal-icon.info {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
}

.error-modal-icon.warning {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.error-modal-icon.danger {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.error-modal-icon.success {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.error-modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

/* Modal Body */
.error-modal-body {
    padding: 2rem;
    flex-grow: 1;
}

.error-modal-message {
    font-size: 1.1rem;
    color: #374151;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Cause Box */
.error-modal-cause {
    background: #F3F4F6;
    border-left: 4px solid #3B82F6;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.error-modal-cause i {
    color: #3B82F6;
    margin-right: 0.5rem;
}

.error-modal-cause strong {
    display: block;
    color: #111827;
    margin-bottom: 0.5rem;
}

.error-modal-cause p {
    color: #6B7280;
    margin: 0;
    line-height: 1.6;
}

/* Solution Box */
.error-modal-solution {
    background: #ECFDF5;
    border-left: 4px solid #10B981;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.error-modal-solution i {
    color: #10B981;
    margin-right: 0.5rem;
}

.error-modal-solution strong {
    display: block;
    color: #111827;
    margin-bottom: 0.75rem;
}

.error-modal-solution ol {
    margin: 0;
    padding-left: 1.5rem;
    color: #374151;
}

.error-modal-solution li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Prevention Box */
.error-modal-prevention {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.error-modal-prevention i {
    color: #F59E0B;
    margin-right: 0.5rem;
}

.error-modal-prevention strong {
    display: block;
    color: #111827;
    margin-bottom: 0.5rem;
}

.error-modal-prevention p {
    color: #92400E;
    margin: 0;
    line-height: 1.6;
}

/* Technical Details */
.error-modal-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E7EB;
}

.error-technical-details {
    background: #1F2937;
    color: #10B981;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin-top: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

/* Modal Footer */
.error-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #E5E7EB;
    background: #F9FAFB;
    border-radius: 0 0 16px 16px;
}

.error-modal-footer .btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.error-modal-footer .btn:hover {
    transform: translateY(-2px);
}

/* Scrollbar Customization */
.error-modal::-webkit-scrollbar {
    width: 8px;
}

.error-modal::-webkit-scrollbar-track {
    background: #F1F1F1;
    border-radius: 4px;
}

.error-modal::-webkit-scrollbar-thumb {
    background: #4A47A3;
    border-radius: 4px;
}

.error-modal::-webkit-scrollbar-thumb:hover {
    background: #3D3B8B;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Responsive */
@media (max-width: 768px) {
    .error-modal-container {
        padding: 0.5rem;
    }

    .error-modal {
        max-height: 95vh;
    }

    .error-modal-header {
        padding: 1.5rem;
    }

    .error-modal-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .error-modal-title {
        font-size: 1.25rem;
    }

    .error-modal-body {
        padding: 1.5rem;
    }

    .error-modal-footer {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .error-modal-footer .btn {
        width: 100%;
    }
}

/* Error Frequency Badge */
.error-frequency-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.error-frequency-badge.common {
    background: #FEE2E2;
    color: #DC2626;
}

.error-frequency-badge.uncommon {
    background: #FEF3C7;
    color: #D97706;
}

.error-frequency-badge.rare {
    background: #D1FAE5;
    color: #059669;
}

/* Error History Panel (Optional) */
.error-history-panel {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.error-history-panel h4 {
    margin-bottom: 1rem;
    color: #111827;
}

.error-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: #F9FAFB;
}

.error-history-item:hover {
    background: #F3F4F6;
}

.error-history-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.error-history-info {
    flex-grow: 1;
}

.error-history-title {
    font-weight: 500;
    color: #111827;
}

.error-history-time {
    font-size: 0.8rem;
    color: #6B7280;
}

/* Helper Classes */
.text-error {
    color: #EF4444;
}

.text-warning {
    color: #F59E0B;
}

.text-info {
    color: #3B82F6;
}

.text-success {
    color: #10B981;
}

.bg-error {
    background: #FEE2E2;
}

.bg-warning {
    background: #FEF3C7;
}

.bg-info {
    background: #DBEAFE;
}

.bg-success {
    background: #D1FAE5;
}
