/* ==========================================================================
   CAModal.css - Modal de confirmacion y avisos reutilizables
   Uso: ver Files/CAModal.js (CAConfirm / CAAviso)
   Todas las clases llevan prefijo "camodal-" para no chocar con modal.css
   ========================================================================== */

/* ---------- Modal de confirmacion ---------- */

.camodal-backdrop {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: camodal-fade .15s ease-out;
}

.camodal-box {
    width: 100%;
    max-width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    text-align: center;
    color: #333;
    animation: camodal-pop .18s ease-out;
}

.camodal-header {
    position: relative;
    padding: 16px 40px 12px;
    border-bottom: 1px solid #eee;
}

.camodal-icon {
    width: 40px;
    height: 40px;
    display: block;
    margin: 0 auto 8px;
}

.camodal-title {
    font-size: 16px;
    font-weight: bold;
    white-space: normal;
    word-break: break-word;
}

.camodal-subtitle {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
    white-space: normal;
    word-break: break-word;
}

.camodal-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0;
}

    .camodal-close:hover {
        color: #333;
    }

.camodal-body {
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.4;
}

.camodal-actions {
    display: flex;
    gap: 8px;
    padding: 0 18px 16px;
}

.camodal-btn {
    flex: 1;
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color .15s;
}

.camodal-btn-cancel {
    background: #e0e0e0;
    color: #333;
}

    .camodal-btn-cancel:hover {
        background: #cfcfcf;
    }

/* Boton principal segun el tipo del modal */
.camodal-btn-ok {
    background: #1976d2;
    color: #fff;
}

    .camodal-btn-ok:hover {
        background: #125ea8;
    }

.camodal-danger .camodal-btn-ok {
    background: #d32f2f;
}

    .camodal-danger .camodal-btn-ok:hover {
        background: #b71c1c;
    }

.camodal-danger .camodal-body {
    color: #c62828;
    font-weight: bold;
}

.camodal-warning .camodal-btn-ok {
    background: #f57c00;
}

    .camodal-warning .camodal-btn-ok:hover {
        background: #d86c00;
    }

/* ---------- Avisos (toast) ---------- */

.camodal-avisos {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 360px;
    pointer-events: none;
}

.camodal-aviso {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 10px 14px;
    border-radius: 8px;
    background: #fff;
    border-left: 5px solid #1976d2;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    pointer-events: auto;
    animation: camodal-slide .2s ease-out;
}

    .camodal-aviso.camodal-saliendo {
        opacity: 0;
        transform: translateY(-8px);
        transition: opacity .2s, transform .2s;
    }

.camodal-aviso-icono {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    line-height: 22px;
    text-align: center;
    background: #1976d2;
}

.camodal-aviso-texto {
    flex: 1;
    word-break: break-word;
}

.camodal-aviso-cerrar {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 2px;
}

.camodal-aviso-success { border-left-color: #2e7d32; }
.camodal-aviso-success .camodal-aviso-icono { background: #2e7d32; }

.camodal-aviso-error { border-left-color: #d32f2f; }
.camodal-aviso-error .camodal-aviso-icono { background: #d32f2f; }

.camodal-aviso-warning { border-left-color: #f57c00; }
.camodal-aviso-warning .camodal-aviso-icono { background: #f57c00; }

/* ---------- Animaciones ---------- */

@keyframes camodal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes camodal-pop {
    from { opacity: 0; transform: scale(.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes camodal-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
