﻿
/* =======================================
   JECAHE - MODAL PRINCIPAL
   ======================================= */

.community-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(16, 35, 63, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.community-modal-window {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 850px;
    max-height: 90vh;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #DCE7F5;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(16, 35, 63, 0.28);
}

/* =======================================
   ENCABEZADO
   ======================================= */

.community-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
    padding: 12px 22px;
    color: #FFFFFF;
    background: linear-gradient(110deg, #10233F, #164778);
    border-bottom: 1px solid rgba(24, 185, 232, 0.45);
}

.community-modal-title {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.4;
}

.community-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

    .community-modal-close:hover {
        background: #0D5BFF;
        border-color: #18B9E8;
    }

    .community-modal-close:focus-visible {
        outline: 2px solid #18B9E8;
        outline-offset: 3px;
    }

/* =======================================
   CUERPO
   ======================================= */

.community-modal-body {
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
    background: #FFFFFF;
    color: #172943;
}

    .community-modal-body .formulario {
        width: 100%;
    }

/* =======================================
   PIE DE MODAL
   ======================================= */

.community-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 22px;
    border-top: 1px solid #E0E8F2;
    background: #F4F8FD;
}

/* Botones creados por ClassModal */
.btn-community {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 18px;
    border: 1px solid #0D5BFF;
    border-radius: 9px;
    background: #0D5BFF;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

    .btn-community:hover {
        background: #0849D6;
        transform: translateY(-1px);
    }

    .btn-community:focus-visible {
        outline: 2px solid #18B9E8;
        outline-offset: 3px;
    }

/* =======================================
   BOTÓN FLOTANTE +
   ======================================= */

.community-modal-add {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin: 0 22px 18px auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0D5BFF;
    color: #FFFFFF;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 7px 18px rgba(13, 91, 255, 0.25);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

    .community-modal-add:hover {
        background: #0849D6;
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(13, 91, 255, 0.35);
    }

    .community-modal-add:focus-visible {
        outline: 3px solid #18B9E8;
        outline-offset: 3px;
    }

/* =======================================
   MODAL DE MENSAJES - CAPA SUPERIOR
   ======================================= */

.community-modal-mensaje {
    z-index: 11000 !important;
}

.modal-backdrop.community-modal-mensaje-backdrop {
    z-index: 10900 !important;
}

#pnlMensaje {
    z-index: 11010 !important;
}

    /* Ventana de mensajes */
    #pnlMensaje .modal-content {
        overflow: hidden;
        border: 1px solid #DCE7F5 !important;
        border-radius: 16px !important;
        box-shadow: 0 20px 60px rgba(16, 35, 63, 0.3) !important;
    }

    /* Encabezado del mensaje */
    #pnlMensaje .modal-header {
        color: #FFFFFF;
        background: #10233F;
        border-bottom: 1px solid #18B9E8;
    }

    /* Cuerpo del mensaje */
    #pnlMensaje .modal-body {
        padding: 25px;
        color: #172943;
        font-size: 15px;
        background: #FFFFFF;
    }

    /* Pie del mensaje */
    #pnlMensaje .modal-footer {
        border-top: 1px solid #E0E8F2;
        background: #F4F8FD;
    }

.modal-backdrop.community-mensaje-backdrop {
    z-index: 11000 !important;
}

/* =======================================
   ADAPTACIÓN A MÓVILES
   ======================================= */

@media (max-width: 600px) {
    .community-modal {
        padding: 10px;
    }

    .community-modal-window {
        max-height: 94vh;
        border-radius: 14px;
    }

    .community-modal-header {
        min-height: 56px;
        padding: 10px 15px;
    }

    .community-modal-title {
        font-size: 16px;
    }

    .community-modal-body {
        padding: 16px;
    }

    .community-modal-footer {
        padding: 12px 15px;
    }

    .community-modal-add {
        margin-right: 15px;
        margin-bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .community-modal *,
    .community-modal *::before,
    .community-modal *::after {
        transition: none !important;
    }
}
