/**
 * Sistema de Mensajes de Error Personalizables - SISGESTION
 * Estilos CSS para el componente de modales de error
 */

/* ============================================
   OVERLAY
   ============================================ */
.sg-error-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sg-error-modal-overlay.sg-error-modal-visible {
    opacity: 1;
}

/* ============================================
   MODAL CONTAINER
   ============================================ */
.sg-error-modal {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.sg-error-modal-overlay.sg-error-modal-visible .sg-error-modal {
    transform: scale(1);
}

/* ============================================
   HEADER
   ============================================ */
.sg-error-modal-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, #1e2d3d 0%, #243447 100%);
    color: #fff;
    position: relative;
    border-bottom: 2px solid #15222f;
}

/* Dynamic accent border based on message type */
.sg-error-modal-header[data-type="ERROR"] { border-left: 4px solid #dc3545; }
.sg-error-modal-header[data-type="WARNING"] { border-left: 4px solid #ffc107; }
.sg-error-modal-header[data-type="SUCCESS"] { border-left: 4px solid #198754; }
.sg-error-modal-header[data-type="INFO"] { border-left: 4px solid #0d6efd; }

.sg-error-modal-icon {
    font-size: 1.5rem;
    margin-right: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}

.sg-error-modal-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
    letter-spacing: 0.01em;
}

.sg-error-modal-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.sg-error-modal-close:hover {
    opacity: 1;
}

/* ============================================
   BODY
   ============================================ */
.sg-error-modal-body {
    padding: 1.25rem;
    max-height: 60vh;
    overflow-y: auto;
}

.sg-error-modal-message {
    font-size: 0.84rem;
    line-height: 1.6;
    color: #2d3748;
}

.sg-error-modal-message strong {
    color: #1a202c;
}

/* ============================================
   CONTACT BOX
   ============================================ */
.sg-error-modal-contact {
    margin-top: 20px;
}

.sg-error-modal-contact-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    padding: 0.85rem;
}

.sg-error-modal-contact-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.84rem;
}

.sg-error-modal-contact-title i {
    margin-right: 8px;
}

.sg-error-modal-contact-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.sg-error-modal-contact-item {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 0.3rem;
}

.sg-error-modal-contact-item i {
    width: 20px;
    margin-right: 5px;
}

.sg-error-modal-contact-item a {
    color: #0066cc;
    text-decoration: none;
}

.sg-error-modal-contact-item a:hover {
    text-decoration: underline;
}

/* ============================================
   FOOTER
   ============================================ */
.sg-error-modal-footer {
    padding: 0.75rem 1.25rem;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.sg-error-modal-btn {
    padding: 0.4rem 1.25rem;
    border-radius: 0.25rem;
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    margin-left: 0.6rem;
}

.sg-error-modal-btn:first-child {
    margin-left: 0;
}

.sg-error-modal-btn-primary {
    background-color: #0078c2;
    color: #fff;
    border-color: #0078c2;
}

.sg-error-modal-btn-primary:hover {
    background-color: #006aad;
    border-color: #006aad;
}

.sg-error-modal-btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

.sg-error-modal-btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* ============================================
   INLINE ERROR STYLES
   ============================================ */
.sg-error-inline {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    margin: 10px 0;
}

.sg-error-inline-icon {
    font-size: 24px;
    margin-right: 15px;
    color: #dc3545;
}

.sg-error-inline-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.sg-error-inline-content strong {
    display: block;
    margin-bottom: 5px;
    color: #000;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 576px) {
    .sg-error-modal {
        width: 95%;
        margin: 10px;
    }

    .sg-error-modal-header {
        padding: 12px 15px;
    }

    .sg-error-modal-icon {
        font-size: 24px;
        margin-right: 10px;
    }

    .sg-error-modal-title {
        font-size: 16px;
    }

    .sg-error-modal-body {
        padding: 15px;
    }

    .sg-error-modal-footer {
        padding: 12px 15px;
        text-align: center;
    }

    .sg-error-modal-btn {
        width: 100%;
        margin-left: 0;
        margin-bottom: 10px;
    }

    .sg-error-modal-btn:last-child {
        margin-bottom: 0;
    }
}
