/* Estilos de Seguridad */

/* Prevenir selección de texto en elementos sensibles */
.no-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Aplicar a elementos que no deben ser seleccionables */
.navbar-brand,
.btn,
.logo,
.nav-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ocultar elementos de desarrollo en producción */
.dev-only {
    display: none !important;
}

/* Estilos para alertas de seguridad */
.security-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: securitySlideIn 0.3s ease-out;
}

@keyframes securitySlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.security-alert .close-btn {
    float: right;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.security-alert .close-btn:hover {
    opacity: 0.8;
}

/* Indicador visual para campos con errores de seguridad */
.security-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Spinner de carga para validaciones */
.security-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #dc3545;
    border-radius: 50%;
    animation: securitySpin 1s linear infinite;
    margin-left: 5px;
}

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

/* Estilos para formularios seguros */
.secure-form {
    position: relative;
}

.secure-form::before {
    content: "🔒";
    position: absolute;
    top: -10px;
    right: 10px;
    color: #28a745;
    font-size: 12px;
    background: white;
    padding: 2px 5px;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Protección contra inspección */
body.dev-tools-detected {
    filter: blur(5px);
    pointer-events: none;
}

body.dev-tools-detected::after {
    content: "⚠️ Herramientas de desarrollador detectadas. Acceso restringido por seguridad.";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 99999;
    text-align: center;
    font-size: 18px;
    max-width: 400px;
    filter: none;
    pointer-events: all;
}

/* Ocultar scroll bars en elementos sensibles */
.secure-content::-webkit-scrollbar {
    display: none;
}

.secure-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Protección contra print screen */
@media print {
    body {
        display: none !important;
    }
    
    body::after {
        content: "Impresión no permitida por políticas de seguridad.";
        display: block !important;
        text-align: center;
        font-size: 24px;
        margin-top: 100px;
    }
}

/* Efectos visuales para campos protegidos */
.protected-field {
    position: relative;
}

.protected-field::after {
    content: "🛡️";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.5;
    pointer-events: none;
}

/* Animación para elementos que han sido sanitizados */
.sanitized {
    animation: sanitizedPulse 0.5s ease-in-out;
}

@keyframes sanitizedPulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(40, 167, 69, 0.1); }
    100% { background-color: transparent; }
}

/* Estilos para botones de seguridad */
.security-btn {
    background: linear-gradient(45deg, #dc3545, #c82333);
    border: none;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
}

.security-btn:hover {
    background: linear-gradient(45deg, #c82333, #a71e2a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Indicadores de conexión segura */
.secure-connection::before {
    content: "🔒 Conexión Segura";
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 1000;
}

/* Overlay de bloqueo */
.security-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99998;
    display: none;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    text-align: center;
}

.security-overlay.active {
    display: flex;
}

/* Rate limiting indicator */
.rate-limited {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.rate-limited::after {
    content: "⏳ Límite de velocidad aplicado";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 193, 7, 0.9);
    color: #856404;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
}

/* CSRF Token indicator */
.csrf-protected::after {
    content: "🔐 CSRF Protected";
    position: absolute;
    top: -5px;
    right: -5px;
    background: #28a745;
    color: white;
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 2px;
    opacity: 0.7;
}
