/* Modal Credere - Overlay */
.credere-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    animation: fadeIn 0.3s ease;
}

.credere-modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Modal Container */
.credere-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header da Modal */
.credere-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--main-primary-color, #114358);
    color: #ffffff;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.credere-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.credere-modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.credere-modal-close:hover {
    transform: rotate(90deg);
}

/* Body da Modal */
.credere-modal-body {
    padding: 30px 20px;
    min-height: 400px;
    overflow-y: auto;
    flex: 1;
}

/* Loading State */
.credere-loading {
    text-align: center;
    padding: 60px 20px;
}

.credere-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--main-primary-color, #114358);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.credere-loading p {
    color: #666;
    font-size: 1rem;
}

/* Error State */
.credere-error {
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
}

.credere-error-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Responsividade Mobile */
@media (max-width: 768px) {
    .credere-modal {
        width: 95%;
        max-height: 85vh;
        border-radius: 8px;
    }

    .credere-modal-header {
        padding: 15px;
        border-radius: 8px 8px 0 0;
    }

    .credere-modal-header h3 {
        font-size: 1.2rem;
    }

    .credere-modal-body {
        padding: 20px 15px;
        min-height: 300px;
    }
}

/* Scroll suave no body da modal */
.credere-modal-body::-webkit-scrollbar {
    width: 8px;
}

.credere-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.credere-modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.credere-modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal de Confirmação */
.credere-confirm-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.credere-confirm-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.credere-confirm-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
    overflow: hidden;
    border-top: 3px solid #f59e0b;
}

.credere-confirm-body {
    padding: 28px 24px 24px;
    text-align: center;
}

.credere-confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    background: #fef3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #f59e0b;
}

.credere-confirm-title {
    margin: 0 0 8px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    line-height: 1.5 !important;
    color: #333 !important;
}

.credere-confirm-warning {
    margin: 0 !important;
    font-size: 0.875rem !important;
    color: #f59e0b !important;
    font-weight: 500 !important;
}

.credere-confirm-actions {
    padding: 0 24px 24px;
    display: flex;
    gap: 10px;
}

.credere-confirm-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credere-confirm-btn-cancel {
    background: var(--main-primary-color, #114358);
    color: #ffffff;
}

.credere-confirm-btn-cancel:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.credere-confirm-btn-confirm {
    background: #f0f0f0;
    color: #666;
}

.credere-confirm-btn-confirm:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

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

@media (max-width: 768px) {
    .credere-confirm-modal {
        width: 90%;
        max-width: 340px;
    }

    .credere-confirm-body {
        padding: 20px;
    }

    .credere-confirm-actions {
        padding: 0 20px 20px;
    }
}
