/**
 * LA COPUCHA - Estilos de Interacción Social
 * Diseño Mobile-First, Dark Mode Profundo y Acentuaciones Neón.
 */

/* Contenedor de la barra de acciones (Debajo de títulos o imágenes) */
.copucha-action-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 4px;
    background: transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Estilo base para todos los botones de la barra (Fuego, Comentarios, Guardar) */
.copucha-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #a0a0a0; /* Gris elegante desactivado */
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 20px;
    transition: color 0.2s ease, transform 0.1s ease;
}

/* El icono SVG dentro del botón */
.copucha-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

/* --- SISTEMA DE FUEGO (ME GUSTA) --- */

/* Hover en computadoras (No afecta a celulares) */
@media (hover: hover) {
    .fire-btn:hover {
        color: #ff2a6d; /* Magenta neón de la marca */
    }
}

/* ESTADO ACTIVO: Cuando el usuario ya dio Me Gusta */
.fire-btn.active {
    color: #ff2a6d !important; /* Fuerza a que todo el botón (texto incluido) sea magenta */
}

.fire-btn.active svg {
    fill: #ff2a6d; 
    stroke: #ff2a6d;
    filter: drop-shadow(0 0 6px rgba(255, 42, 109, 0.4)); /* Resplandor un poco más suave para tema claro */
}

/* Animación de pulsación (Efecto Pop al hacer clic) */
.fire-btn.interacting svg {
    animation: copuchaPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


/* --- SISTEMA DE GUARDADO (NUEVO) --- */

@media (hover: hover) {
    .save-btn:hover {
        color: #ff2a6d; 
    }
}

/* ESTADO ACTIVO: Cuando el usuario ya guardó la noticia */
.save-btn.active {
    color: #ff2a6d !important;
}

/* Al estar activo, el icono se rellena y brilla */
.save-btn.active svg {
    fill: #ff2a6d; 
    stroke: #ff2a6d;
    filter: drop-shadow(0 0 6px rgba(255, 42, 109, 0.4));
    animation: copuchaPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}


/* --- ESTADO DE CARGA (ANTI SPAM CHILENO) --- */
.copucha-btn.is-loading {
    opacity: 0.6;
    pointer-events: none; 
}

@keyframes copuchaPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* --- TEXTO DE LOS CONTADORES --- */
.copucha-btn .count {
    color: inherit; /* Magia: Toma automáticamente el gris (#a0a0a0) o el magenta (#ff2a6d) del padre */
    font-variant-numeric: tabular-nums; 
}


/* ==========================================================================
   MODAL DE INICIO DE SESIÓN (ESTILO PREMIUM MOBILE-FIRST)
   ========================================================================== */

/* Fondo oscuro translúcido con desenfoque de cristal */
.copucha-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 12, 0.82); 
    backdrop-filter: blur(10px); /* Desenfoque de fondo estilo iOS */
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Estado Abierto */
.copucha-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Tarjeta del Modal */
.copucha-modal-content {
    background: #141417; /* Gris ultra oscuro profundo */
    border: 1px solid rgba(255, 42, 109, 0.25); /* Borde neón sutil */
    width: 90%;
    max-width: 380px;
    border-radius: 28px;
    padding: 36px 24px;
    position: relative;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 42, 109, 0.04);
    transform: scale(0.85);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.2);
    text-align: center;
    box-sizing: border-box;
    
    /* NUEVAS REGLAS PARA EL SCROLL EN MÓVILES */
    max-height: 85vh; /* La tarjeta nunca medirá más del 85% de la pantalla */
    overflow-y: auto; /* Activa el scroll vertical interno si el contenido sobra */
    overscroll-behavior: contain; /* Evita que el scroll rebote en iOS */
}

/* Scrollbar Premium Neón para el Modal (Solo visible si hay scroll) */
.copucha-modal-content::-webkit-scrollbar {
    width: 6px;
}
.copucha-modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin-top: 15px;
    margin-bottom: 15px;
}
.copucha-modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 42, 109, 0.3);
    border-radius: 10px;
}
.copucha-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 42, 109, 0.8);
}

.copucha-modal-overlay.is-open .copucha-modal-content {
    transform: scale(1);
}

/* Botón de Cierre (X) */
.copucha-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #808085;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.copucha-modal-close:hover {
    color: #ff2a6d;
}

/* Tipografías y Textos */
.copucha-modal-logo {
    display: inline-block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 3px;
    color: #ff2a6d;
    margin-bottom: 14px;
}

.copucha-modal-header h2 {
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.copucha-modal-header p {
    color: #9898a0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 28px 0;
}

/* Botones de Acción */
.copucha-modal-btn {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border-radius: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    margin-bottom: 12px;
    transition: background 0.2s ease, transform 0.1s ease;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.copucha-modal-btn:last-child {
    margin-bottom: 0;
}

.copucha-modal-btn.btn-primary {
    background: #ff2a6d;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(255, 42, 109, 0.35);
}

.copucha-modal-btn.btn-primary:active {
    transform: scale(0.98);
    background: #e01f5c;
}

.copucha-modal-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #e2e2e8;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.copucha-modal-btn.btn-secondary:active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* ==========================================================================
   INTEGRACIÓN DE FORMULARIOS (ULTIMATE MEMBER + NEXTEND)
   ========================================================================== */

/* Separador elegante entre Google y el Formulario */
.copucha-modal-divider {
    text-align: center;
    margin: 24px 0;
    position: relative;
}

.copucha-modal-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.copucha-modal-divider span {
    background: #141417; /* Mismo color de fondo del modal para camuflarse */
    padding: 0 12px;
    color: #808085;
    font-size: 13px;
    position: relative;
    font-weight: 500;
}

/* Rediseño de los campos de texto de Ultimate Member */
.copucha-custom-form-wrapper .um-form input[type="text"],
.copucha-custom-form-wrapper .um-form input[type="email"],
.copucha-custom-form-wrapper .um-form input[type="password"],
.copucha-custom-form-wrapper .um-form input[type="date"] {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-radius: 12px !important; /* Bordes más suaves */
    padding: 14px 16px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

/* Efecto Neón al escribir en los campos */
.copucha-custom-form-wrapper .um-form input:focus {
    border-color: #ff2a6d !important;
    box-shadow: 0 0 12px rgba(255, 42, 109, 0.2) !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

/* Rediseño de las etiquetas de los campos */
.copucha-custom-form-wrapper .um-form .um-field-label label {
    color: #9898a0 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
}

/* El botón principal de Registro de Ultimate Member */
.copucha-custom-form-wrapper .um-button {
    background: #ff2a6d !important;
    color: #ffffff !important;
    border-radius: 30px !important;
    font-weight: 700 !important;
    padding: 15px 20px !important;
    box-shadow: 0 4px 20px rgba(255, 42, 109, 0.35) !important;
    transition: transform 0.2s ease, background 0.2s ease !important;
    width: 100% !important;
}

.copucha-custom-form-wrapper .um-button:active {
    transform: scale(0.98) !important;
    background: #e01f5c !important;
}

/* Ocultar elementos innecesarios del plugin original */
.copucha-custom-form-wrapper .um-profile-photo,
.copucha-custom-form-wrapper .um-header {
    display: none !important;
}

/* ==========================================================================
   ESTILOS GENERALES PARA FORMULARIOS DE ULTIMATE MEMBER (CVC DARK MODE)
   ========================================================================== */

/* Limpiar fondos por defecto del contenedor */
.um .um-form {
    background: transparent !important;
}

/* Estilo de las etiquetas (Textos como "Nombre de usuario") */
.um .um-form label {
    color: #9898a0 !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

/* Estilo de las cajas de texto (Inputs) */
.um .um-form input[type="text"],
.um .um-form input[type="password"],
.um .um-form input[type="email"] {
    background-color: #141417 !important; /* Fondo casi negro */
    border: 1px solid #2a2a30 !important; /* Borde sutil gris oscuro */
    color: #ffffff !important; /* Texto blanco */
    border-radius: 8px !important;
    padding: 12px 15px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
}

/* Efecto al hacer clic en la caja de texto (Brillo neón) */
.um .um-form input[type="text"]:focus,
.um .um-form input[type="password"]:focus,
.um .um-form input[type="email"]:focus {
    border-color: #ff2a6d !important;
    box-shadow: 0 0 10px rgba(255, 42, 109, 0.2) !important;
    outline: none !important;
}

/* El gran botón azul feo pasa a ser el Botón Principal Neón */
.um .um-button, 
.um input[type="submit"].um-button {
    background: #ff2a6d !important; /* Rosa CVC */
    color: #ffffff !important;
    border-radius: 25px !important; /* Bordes bien redondos */
    padding: 12px 20px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
    letter-spacing: 1px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 42, 109, 0.4) !important;
    transition: all 0.3s ease !important;
}

.um .um-button:hover, 
.um input[type="submit"].um-button:hover {
    background: #ff0055 !important;
    box-shadow: 0 6px 20px rgba(255, 42, 109, 0.6) !important;
    transform: translateY(-2px) !important;
}

/* Botones secundarios (ej. Registro al lado de Acceder en la página web) */
.um .um-button.um-alt {
    background: #2a2a30 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.um .um-button.um-alt:hover {
    background: #3f3f46 !important;
}

/* Enlaces pequeños (ej. Olvidaste tu contraseña) */
.um a.um-link {
    color: #ff2a6d !important;
    text-decoration: none !important;
}

.um a.um-link:hover {
    text-decoration: underline !important;
}

/* Checkbox "Mantenerme conectado" */
.um .um-field-checkbox .um-field-checkbox-state i {
    color: #ff2a6d !important;
}

/* Texto para alternar entre registro y login (El nuevo switch que hicimos) */
.cvc-modal-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #9898a0;
}

.cvc-modal-switch a {
    color: #ff2a6d;
    font-weight: bold;
    text-decoration: none;
    margin-left: 5px;
    transition: color 0.3s ease;
}

.cvc-modal-switch a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* ==========================================================================
   ESTILOS PARA RECUPERAR CONTRASEÑA (CVC DARK MODE)
   ========================================================================== */

/* Contenedor principal limpio */
.um-password {
    background: transparent !important;
}

/* Texto descriptivo gris elegante ("Para restablecer tu contraseña...") */
.um-password p {
    color: #9898a0 !important;
    font-size: 15px !important;
    line-height: 1.6 !important;
    margin-bottom: 20px !important;
}

/* Caja de texto (Input) en modo oscuro */
.um-password input[type="text"],
.um-password input[type="email"] {
    background-color: #141417 !important; /* Fondo casi negro */
    border: 1px solid #2a2a30 !important; /* Borde sutil gris oscuro */
    color: #ffffff !important; /* Texto blanco */
    border-radius: 8px !important;
    padding: 14px 15px !important;
    box-shadow: none !important;
    transition: all 0.3s ease !important;
    width: 100% !important; 
}

/* Efecto Neón al hacer clic en la caja de texto */
.um-password input[type="text"]:focus,
.um-password input[type="email"]:focus {
    border-color: #ff2a6d !important;
    box-shadow: 0 0 10px rgba(255, 42, 109, 0.2) !important;
    outline: none !important;
}

/* Transformar el botón azul genérico en el Botón Principal Neón */
.um-password .um-button,
.um-password input[type="submit"] {
    background: #ff2a6d !important; /* Rosa CVC */
    color: #ffffff !important;
    border-radius: 25px !important; 
    padding: 14px 20px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    font-size: 14px !important;
    letter-spacing: 1px !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 42, 109, 0.4) !important;
    transition: all 0.3s ease !important;
    width: 100% !important; /* Botón ancho moderno */
    margin-top: 15px !important;
}

/* Efecto hover del botón */
.um-password .um-button:hover,
.um-password input[type="submit"]:hover {
    background: #ff0055 !important;
    box-shadow: 0 6px 20px rgba(255, 42, 109, 0.6) !important;
    transform: translateY(-2px) !important;
}





/* ==========================================================================
   NOTIFICACIÓN EMERGENTE (TOAST)
   ========================================================================== */
.copucha-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    /* Lo posicionamos al centro, pero lo hundimos 100px para esconderlo */
    transform: translate(-50%, 100px); 
    background: #141417; /* Fondo oscuro premium */
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 42, 109, 0.15);
    border: 1px solid rgba(255, 42, 109, 0.3); /* Borde neón sutil */
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    /* La curva 'cubic-bezier' hace que la animación tenga un rebote natural */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    white-space: nowrap;
    pointer-events: none; /* No bloquea clics mientras está oculto */
}

/* Cuando el JS le añade la clase 'show', sube y aparece */
.copucha-toast.show {
    transform: translate(-50%, 0); /* Sube a su posición real */
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Vuelve a ser interactivo */
}

/* Ajuste sutil para pantallas muy pequeñas (celulares estrechos) */
@media (max-width: 400px) {
    .copucha-toast {
        width: 90%;
        white-space: normal;
        padding: 12px 20px;
    }
}