/* --- VARIABLES Y TEMA (Unificado con live.css) --- */
:root {
    --color-background: #f0f2f5;
    --color-surface: #ffffff;
    --color-primary: #1c1e21;      /* Color de texto principal */
    --color-secondary: #65676b;    /* Color de texto secundario */
    --color-accent: #b72a1e;
    --color-border: #ddd;
    --border-radius: 12px;
}

body.dark-theme {
    --color-background: #18191a;
    --color-surface: #242526;
    --color-primary: #e4e6eb;      /* Color de texto principal en modo oscuro */
    --color-secondary: #b0b3b8;    /* Color de texto secundario en modo oscuro */
    --border-color: #3a3b3c;
}

/* --- ESTILOS GENERALES --- */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--color-background);
    color: var(--color-primary);
    padding-top: 0px; /* Espacio para el nuevo header sticky */
}

h3 {
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-primary);
}

h3 i { margin-right: 0.75rem; color: var(--color-accent); }

.page-container {
    padding: 2rem 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- BARRA DE NAVEGACIÓN --- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 1.5rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}
body.dark-theme .top-bar {
    background-color: rgba(24, 25, 26, 0.8);
}
.top-bar__left, .top-bar__right { display: flex; align-items: center; gap: 0.75rem; }
.top-bar__logo img { height: 32px; }
.top-bar-btn {
    background: none; border: none; cursor: pointer; color: var(--color-secondary);
    width: 40px; height: 40px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 1.1rem;
}
.top-bar-btn:hover { background-color: var(--color-border); color: var(--color-primary); }
#user-avatar-header img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

/* --- LAYOUT DEL PERFIL --- */
.profile-layout { display: grid; gap: 1.5rem; }
@media (min-width: 1024px) {
    .profile-layout { grid-template-columns: 320px 1fr; }
    .profile-sidebar { position: sticky; top: calc(86px + 2rem); }
}
.main-content { display: grid; gap: 1.5rem; grid-auto-rows: min-content; }
.bento-box { background-color: var(--color-surface); padding: 1.5rem; border-radius: var(--border-radius); }
.bento-box.full-width { grid-column: 1 / -1; }

/* --- TARJETA DE PERFIL (SIDEBAR) --- */
.profile-card { 
    text-align: center;
 }
.profile-card__avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    border: 4px solid var(--color-accent);
    background-color: var(--color-border); /* <-- CORRECCIÓN para evitar el "salto" */
}
.profile-card h2 { font-size: 1.5rem; margin: 0; color: var(--color-primary); }
.profile-card__orcid { font-size: 0.9rem; color: var(--color-secondary); margin: 0.25rem 0 1rem 0; }
.profile-card__bio { font-size: 0.95rem; margin-bottom: 1.5rem; color: var(--color-secondary); }
.profile-card__socials { display: flex; justify-content: center; gap: 1.5rem; font-size: 1.5rem; margin-bottom: 1.5rem; }
.profile-card__socials a { color: var(--color-secondary); }

/* --- FORMULARIOS Y BOTONES --- */
.form-group label { display: block; font-weight: 500; margin-bottom: 0.5rem; font-size: 0.9rem; }
input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-background);
    color: var(--color-primary);
}
.btn { width: 100%; padding: 0.8rem; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem; text-decoration: none; }
.btn-primary { background-color: var(--color-accent); color: white; }
.btn-secondary { background-color: var(--color-surface-light); color: var(--color-primary); border: 1px solid var(--color-border); }

/* --- NUEVO LAYOUT HORIZONTAL PARA ESCRITORIO --- */

@media (min-width: 1024px) {
    .main-content {
        display: grid;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); /* Columna principal más ancha */
        gap: 1.5rem;
        align-items: start; /* Alinea los elementos al inicio de la celda del grid */
    }

    .main-column, .side-column {
        display: grid;
        gap: 1.5rem;
        grid-auto-rows: min-content;
    }
}

/* Estilos para la lista de proyectos/publicaciones */
.projects-list {
    margin-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}

.publication-item {
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1rem;
    background-color: var(--color-background);
}

.publication-item p {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.publication-item span {
    font-size: 0.85rem;
    color: var(--color-secondary);
}

/* --- Estilo para Aviso de Sincronización ORCID --- */
.orcid-sync-hint {
    background-color: var(--color-surface-light);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--color-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.orcid-sync-hint i {
    color: var(--color-accent);
}

/* --- INICIO: NUEVOS ESTILOS PARA PESTAÑAS (CORREGIDO) --- */
.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    grid-column: 1 / -1;
    /* --- LÓGICA STICKY --- */
    position: -webkit-sticky;
    position: sticky;
    top: 85px; /* Altura del header para que se pegue justo debajo */
    background-color: var(--color-background);
    z-index: 100;
}
.profile-tab-link { 
        flex-shrink: 0; 
        white-space: nowrap; 
        padding: 12px 24px !important; /* Aumentamos el relleno (Touch Target más grande) */
        font-size: 1.05rem !important; /* Letra ligeramente más grande */
        border-radius: 25px !important; /* Bordes más suaves */
        margin-right: 5px; /* Un poco de aire entre botón y botón */
    }
    
    /* Si el icono está muy pegado al texto, le damos respiro */
    .profile-tab-link i {
        margin-right: 8px !important;
        font-size: 1.1rem;
    }
.profile-tab-link:hover { background-color: var(--color-surface); }
.profile-tab-link.active { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.profile-tab-content { display: none; gap: 1.5rem; grid-column: 1 / -1; }
.profile-tab-content.active { display: grid; }

@media (min-width: 1024px) {
    .profile-tab-content.active {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); 
        align-items: start;
    }
}
@media (max-width: 1024px) {
    .profile-tabs {
        top: 0; /* En móvil no hay header de escritorio, se pega arriba del todo */
        overflow-x: auto;
        justify-content: flex-start;
    }
    body { padding-top: 0; }
}
@media (max-width: 480px) {
    .profile-tab-link span { display: none; } /* Oculta texto, solo muestra iconos */
    .profile-tab-link { flex: 1; }
}
/* --- FIN: NUEVOS ESTILOS PARA PESTAÑAS --- */

/* --- Estilos para la Vista de Perfil Público --- */

/* Cuando el body tiene la clase .public-view, ocultamos los formularios */
body.public-view form,
body.public-view #orcid-section .btn,
body.public-view #projects-section .btn-secondary { display: none; }
body.public-view .main-content { display: none; }
body.loading-profile .main-content { opacity: 0; visibility: hidden; }

/* Ocultamos también cualquier sección que solo sea para el dueño del perfil */
body.public-view #orcid-section .btn,
body.public-view #projects-section .btn-secondary {
    display: none;
}

/* --- AÑADE ESTA NUEVA REGLA --- */
/* Oculta toda la columna de contenido principal en la vista pública */
body.public-view .main-content {
    display: none;
}
/* Oculta el contenido principal mientras se determina el permiso */
body.loading-profile .main-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out;
}
/* --- INICIO: Ajustes Finales de Perfil --- */

/* 1. Alinea correctamente el avatar en el menú superior */
.desktop-nav .user-actions .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- INICIO: ESTILOS MEJORADOS PARA EL FOOTER --- */

.site-footer {
    padding: 3rem 0;
    background-color: var(--color-background);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: var(--font-size-small);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap; /* Para que se ajuste bien en pantallas medianas */
    gap: 2rem;
}

.footer-column {
    flex: 1;
    min-width: 250px; /* Ancho mínimo para cada columna */
}

.footer-logo-text {
    font-weight: 600;
    color: var(--color-text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.footer-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.footer-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--color-accent);
}

.footer-link i {
    font-size: 1.2rem;
}

/* Redes Sociales Footer */
.social-footer {
    display: flex;
    gap: 15px;
}
.social-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: var(--color-surface);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
    text-decoration: none;
}
.social-footer a:hover {
    background-color: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
    transform: translateY(-3px);
}

/* Estilos para móvil */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-column {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-badges {
        align-items: center;
    }
}

/* --- FIN: ESTILOS MEJORADOS PARA EL FOOTER --- */

/* ==========================================================================
   FIX: MENÚ GLOBAL V3 EN LIVE.HTML
   ========================================================================== */

/* 1. Prevenir que los botones se amontonen (Fix de ancho) */
.desktop-nav .main-menu {
    gap: 12px !important; 
    justify-content: center;
}

.desktop-nav .main-menu .nav-icon,
#create-dropdown-container .nav-icon {
    width: auto !important;
    min-width: max-content !important;
    padding: 0 15px !important;
    white-space: nowrap !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 2. Botón Acceder (Estilo sólido) */
.btn-nav-access {
    background-color: var(--color-accent);
    color: white !important;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid var(--color-accent);
    cursor: pointer;
    transition: 0.3s;
}
.btn-nav-access:hover {
    background-color: transparent;
    color: var(--color-accent) !important;
}

/* 3. Toast en la parte superior */
#global-toast {
    position: fixed; 
    top: 25px; 
    left: 50%; 
    transform: translateX(-50%);
    background: #1e293b; 
    color: white; 
    padding: 16px 32px;
    border-radius: 50px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4); 
    z-index: 10000; 
    font-size: 1rem;
    font-weight: 500;
    border-bottom: 4px solid var(--color-accent);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}
.toast-hidden { opacity: 0; visibility: hidden; top: -20px !important; }

/* 4. Optimización de la X del Modal */
.modal-close-btn {
    position: absolute; 
    top: 15px; 
    right: 15px; 
    width: 44px; 
    height: 44px; 
    background: rgba(0,0,0,0.05); 
    color: var(--color-primary); 
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    z-index: 100;
}
.modal-close-btn:hover {
    background: #eee;
    color: var(--color-accent);
    transform: rotate(90deg);
}

/* Asegurar que el avatar se vea bien */
.nav-icon-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    object-fit: cover;
}

/* --- FIN: Ajustes Finales de Perfil --- */

.nav-icon { 
    position: relative;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 44px; 
    height: 44px; 
    border-radius: 8px; 
    transition: background-color 0.2s ease, color 0.2s ease; 
    color: var(--color-secondary); 
    font-size: 1.1rem;
    line-height: 1; /* <-- AÑADE ESTA LÍNEA */
}
/* --- Estilos para el Modal de Conexión --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    position: relative;
    background: var(--color-surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.is-visible .modal-content {
    transform: scale(1);
}
.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-secondary);
    cursor: pointer;
}

/* --- Estilos para el Feed de la Comunidad --- */
#community-feed-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feed-post {
    background-color: var(--color-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author {
    display: flex;
    flex-direction: column;
}

.post-author strong {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.post-handle {
    font-size: 0.9rem;
    color: var(--color-secondary);
}

.post-body p {
    margin: 0;
    line-height: 1.6;
    word-wrap: break-word;
}

.post-embed-image {
    margin-top: 1rem;
}

.post-embed-image img {
    max-width: 100%;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
    color: var(--color-secondary);
}

.post-stats {
    display: flex;
    gap: 1.5rem;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* --- Estilos para el Panel de Estado de Comunidad --- */
.community-status-box {
    text-align: center; /* Centra el contenido */
}
.community-status-box h3 {
    text-align: left; /* Mantiene el título alineado a la izquierda */
}

/* --- Estilos para el Botón de Like --- */
.like-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.like-btn:hover:not(:disabled) {
    background-color: var(--color-background);
    color: #e0245e; /* Color rosa/rojo para hover */
}
.like-btn.is-liked {
    color: #e0245e; /* Color cuando ya tiene like */
    font-weight: bold;
}
.like-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.troubleshooting-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--color-background);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    font-size: 0.85rem;
}
.troubleshooting-note p {
    margin: 0;
    color: var(--color-secondary);
}
/* --- Estilos para el Botón de Comentar --- */
.comment-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.comment-btn:hover:not(:disabled) {
    background-color: var(--color-background);
    color: var(--color-accent);
}

.comment-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
/* AJUSTE PARA ESTABILIZACIÓN DEL FEED */
/* Estilo para el contador de comentarios (que ya no es un botón) */
.comment-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: help; /* Cambia el cursor para indicar que hay un tooltip informativo */
    opacity: 0.7; /* Lo hace ligeramente menos prominente que los botones reales */
}
/* AÑADE ESTO AL FINAL DE profile.css */

.profile-view-group {
    margin-bottom: 1.5rem;
}

.profile-view-group label {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-secondary);
    margin-bottom: 0.25rem;
}

.profile-view-group p {
    margin: 0;
    font-size: 1rem;
    color: var(--color-primary);
    line-height: 1.6;
}
/* AÑADE ESTO AL FINAL DE profile.css */

.platforms-view-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.platform-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-secondary);
    font-size: 0.9rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.platform-link:hover {
    background-color: var(--color-background);
    color: var(--color-primary);
}

.platform-link i {
    font-size: 1.5rem;
    width: 24px;
    text-align: center;
}
/* ===================================================
   ESTILOS MEJORADOS PARA BOTONES DE NAVEGACIÓN DEL PERFIL
   =================================================== */

/* 1. Ajustamos el contenedor para dar más espacio */
.profile-card-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Aumentamos el espacio entre botones (puedes ajustarlo a 1rem si quieres más) */
    margin-top: 1.5rem;
}

/* 2. Damos estilo de botón a cada enlace */
.profile-card-nav__link {
    display: flex; /* Para alinear icono y texto */
    align-items: center;
    gap: 0.75rem; /* Espacio entre icono y texto */
    
    padding: 12px 16px;
    background-color: var(--color-background); /* Fondo sutil para diferenciarlo de la tarjeta */
    border: 1px solid var(--color-border);
    border-radius: 8px; /* Esquinas redondeadas */
    
    text-decoration: none;
    text-align: left;
    font-weight: 500;
    color: var(--color-primary);
    
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* --- ONBOARDING MODAL --- */
.onboarding-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center; z-index: 9999;
    padding: 20px;
}
.onboarding-overlay.is-visible { display: flex; }

.onboarding-card {
    background: var(--color-surface); width: 100%; max-width: 800px;
    border-radius: 32px; padding: 40px; text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.onboarding-header h2 { font-family: 'Playfair Display', serif; font-size: 2.2rem; margin-bottom: 10px; }

.onboarding-options {
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 40px 0;
}
.onboarding-option-card {
    background: var(--color-background); border: 2px solid transparent;
    padding: 30px; border-radius: 24px; cursor: pointer; transition: 0.3s;
}
.onboarding-option-card:hover { border-color: var(--color-accent); transform: translateY(-5px); }
.option-icon { font-size: 3rem; color: var(--color-accent); margin-bottom: 15px; }
.btn-option { 
    width: 100%; padding: 10px; border-radius: 50px; border: 1px solid var(--color-accent);
    background: transparent; color: var(--color-accent); font-weight: bold; margin-top: 15px;
}
.btn-option.primary { background: var(--color-accent); color: white; }

/* --- ANIMACIÓN Y BANNER DE XP (ONBOARDING) --- */
.xp-intro-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px dashed rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}
.xp-icon-bounce {
    font-size: 2.2rem;
    animation: bounce-xp 1.5s infinite;
    filter: drop-shadow(0 4px 6px rgba(245, 158, 11, 0.3));
}
@keyframes bounce-xp {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-5px) scale(1.1); }
}

/* --- REDISEÑO MENÚ DASHBOARD (Bento Style) --- */
.profile-card-nav {
    display: grid !important; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    gap: 15px !important; border: none !important; margin-top: 30px !important;
}
.profile-card-nav__link {
    background: var(--color-background) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    flex-direction: column !important; /* Icono arriba, texto abajo */
    align-items: center !important;
    text-align: center !important;
    gap: 10px !important;
    font-weight: 600 !important;
    transition: 0.3s !important;
}
.profile-card-nav__link:hover {
    background: var(--color-surface) !important;
    border-color: var(--color-accent) !important;
    color: var(--color-accent) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05) !important;
}
.profile-card-nav__link i { font-size: 1.5rem !important; margin: 0 !important; }

.supporter-logos {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}
.supporter-logos img {
    max-height: 40px;
    object-fit: contain;
}
/* Arreglo para logos blancos en tema claro */
body:not(.dark-theme) .supporter-logos img {
    filter: invert(1);
}
/* ==========================================================================
   SISTEMA DE GAMIFICACIÓN E INSIGNIAS
   ========================================================================== */

.profile-badges-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 10px 0 20px 0;
}

/* Estado Apagado (Gris y translúcido) */
.badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-background);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Rebote suave */
    filter: grayscale(100%);
    opacity: 0.4;
    cursor: help;
}

/* Estados Encendidos (A todo color y con brillo sutil) */
.badge-icon.active-citizen {
    color: #10b981; /* Verde esmeralda */
    filter: grayscale(0%);
    opacity: 1;
    background: #d1fae5;
    border-color: #10b981;
    transform: scale(1.1);
}

.badge-icon.active-social {
    color: #0085ff; /* Azul Bluesky */
    filter: grayscale(0%);
    opacity: 1;
    background: #e0f2fe;
    border-color: #0085ff;
    transform: scale(1.1);
}

.badge-icon.active-academic {
    color: #a6ce39; /* Verde ORCID */
    filter: grayscale(0%);
    opacity: 1;
    background: #f4fce3;
    border-color: #a6ce39;
    transform: scale(1.1);
}

/* El Check de Verificación PRO junto al nombre */
.verified-check {
    color: var(--color-accent);
    font-size: 0.8em;
    margin-left: 6px;
    vertical-align: middle;
    filter: drop-shadow(0 2px 4px rgba(183, 42, 30, 0.3)); /* Brillo sutil con tu color de acento */
}
/* --- BANNER DE APOYO --- */
.support-banner {
    background: linear-gradient(90deg, var(--color-accent), #8b1d14);
    color: white;
    padding: 12px 0;
    text-align: center;
    font-size: 0.95rem;
    position: relative;
    z-index: 900;
    display: none; /* Se activa por JS */
}
.support-banner a { color: white; text-decoration: underline; font-weight: bold; margin: 0 5px; }
.close-banner {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer;
}

/* --- NUEVAS INSIGNIAS --- */
.badge-icon.active-founder { color: #f59e0b; background: #fef3c7; border-color: #f59e0b; filter: grayscale(0%); opacity: 1; }
.badge-icon.active-divulgador { color: #8b5cf6; background: #ede9fe; border-color: #8b5cf6; filter: grayscale(0%); opacity: 1; }
.badge-icon.active-member { color: #ec4899; background: #fce7f3; border-color: #ec4899; filter: grayscale(0%); opacity: 1; }

/* --- RESPONSIVIDAD Y ESTILOS DEL MODAL DE ONBOARDING --- */

/* Estilo para el botón de "Lo haré más tarde" */
.onboarding-skip {
    background: transparent;
    border: none;
    color: var(--color-secondary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: color 0.2s;
}
.onboarding-skip:hover { color: var(--color-accent); }

/* Adaptación para móviles (Pantallas menores a 768px) */
@media (max-width: 768px) {
    .onboarding-options { 
        grid-template-columns: 1fr; /* Pasa de 2 columnas a 1 columna */
        gap: 15px; 
        margin: 20px 0; 
    }
    .onboarding-card { 
        padding: 25px 15px; 
        max-height: 90vh; /* Evita que se salga de la pantalla verticalmente */
        overflow-y: auto; /* Permite hacer scroll si el celular es muy pequeño */
    }
    .onboarding-header h2 { 
        font-size: 1.6rem; 
    }
    .option-icon { 
        font-size: 2.2rem; 
        margin-bottom: 10px; 
    }
}
/* ==========================================================================
   ESTILOS PARA LA PESTAÑA DE MEMBRESÍAS / APOYO MULTIOPCIÓN
   ========================================================================== */

.support-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.support-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.support-card:hover { 
    border-color: var(--color-accent); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); 
    transform: translateY(-3px);
}

.support-icon { 
    width: 60px; height: 60px; border-radius: 50%; display: flex; 
    align-items: center; justify-content: center; font-size: 1.8rem; 
    margin-bottom: 15px; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.support-icon.paypal { background: #003087; }
.support-icon.yape { background: #742284; } /* Morado Yape */
.support-icon.bank { background: #ff7800; } /* Naranja Banco */

.support-card h4 { margin: 0 0 5px 0; font-size: 1.15rem; color: var(--color-primary); }
.support-card p { font-size: 0.85rem; color: var(--color-secondary); margin-bottom: 15px; }

.btn-support { 
    display: inline-block; width: 100%; padding: 12px; border-radius: 50px; 
    text-decoration: none; font-weight: 700; transition: 0.2s; font-size: 0.95rem;
}
.btn-paypal { background: #ffc439; color: #003087; border: 1px solid #ffc439; }
.btn-paypal:hover { filter: brightness(0.95); transform: scale(1.02); }

.qr-placeholder { 
    width: 130px; height: 130px; background: white; border: 2px dashed #ccc; 
    border-radius: 12px; margin-bottom: 15px; display: flex; align-items: center; 
    justify-content: center; overflow: hidden; padding: 5px;
}
.qr-placeholder img { width: 100%; height: 100%; object-fit: contain; }

.copy-box { 
    display: flex; align-items: center; justify-content: space-between; 
    background: var(--color-surface); border: 1px solid var(--color-border); 
    padding: 10px 14px; border-radius: 8px; width: 100%; font-size: 0.95rem; 
    font-weight: bold; color: var(--color-primary);
}
.copy-box-col { display: flex; flex-direction: column; align-items: flex-start; }
.copy-box-col small { font-size: 0.65rem; color: var(--color-secondary); font-weight: normal; text-transform: uppercase; letter-spacing: 0.5px;}

.copy-box button { 
    background: rgba(183, 42, 30, 0.1); border: none; color: var(--color-accent); 
    cursor: pointer; font-size: 1.1rem; transition: 0.2s; width: 36px; height: 36px;
    border-radius: 8px; display: flex; justify-content: center; align-items: center;
}
.copy-box button:hover { background: var(--color-accent); color: white; transform: scale(1.05); }
.mt-2 { margin-top: 10px; }

.support-footer-note { 
    text-align: center; margin-top: 30px; padding: 18px; 
    background: rgba(183, 42, 30, 0.05); border-radius: 12px; 
    font-size: 0.95rem; border: 1px dashed rgba(183, 42, 30, 0.3);
}
.support-footer-note a { color: var(--color-accent); font-weight: bold; text-decoration: underline; }

/* ==========================================================================
   ESTILOS PARA LA PESTAÑA DE SERVICIOS
   ========================================================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    padding: 10px 0;
}

.service-card {
    background: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.service-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

.service-icon {
    width: 50px; height: 50px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin-bottom: 20px; color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
/* Colores por unidad de negocio */
.service-icon.audiovisual { background: linear-gradient(135deg, #10b981, #059669); } /* Verde */
.service-icon.events { background: linear-gradient(135deg, #f59e0b, #d97706); } /* Naranja */
.service-icon.mentoring { background: linear-gradient(135deg, #8b5cf6, #6d28d9); } /* Morado */
.service-icon.saas { background: linear-gradient(135deg, #3b82f6, #1d4ed8); } /* Azul */

.service-card h4 {
    margin: 0 0 15px 0; font-size: 1.15rem; color: var(--color-primary);
}

.service-features {
    list-style: none; padding: 0; margin: 0 0 25px 0; flex-grow: 1;
}
.service-features li {
    font-size: 0.85rem; color: var(--color-secondary); margin-bottom: 12px;
    display: flex; align-items: flex-start; gap: 10px; line-height: 1.3;
}
.service-features li i {
    color: var(--color-accent); font-size: 0.8rem; margin-top: 2px;
}

.btn-service {
    display: block; width: 100%; text-align: center; padding: 12px;
    border-radius: 8px; font-weight: 700; text-decoration: none;
    background: transparent; border: 1px solid var(--color-accent);
    color: var(--color-accent); transition: 0.2s; font-size: 0.95rem;
}
.btn-service:hover {
    background: var(--color-accent); color: white;
}

/* ==========================================================================
   ESTILOS PARA EL CENTRO DE MANDO (GESTIÓN Y ACTIVIDAD)
   ========================================================================== */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 30px;
}
.stat-card {
    background: var(--color-background); border: 1px solid var(--color-border); border-radius: 16px;
    padding: 20px; text-align: center; display: flex; flex-direction: column; align-items: center;
}
.stat-icon { font-size: 2rem; color: var(--color-accent); margin-bottom: 10px; opacity: 0.9; }
.stat-card h2 { margin: 0 0 5px 0; font-size: 2rem; color: var(--color-primary); font-family: var(--font-serif); }
.stat-card p { margin: 0; font-size: 0.75rem; color: var(--color-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;}

.management-section h4 { 
    margin: 0 0 15px 0; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); 
    font-size: 1.1rem; display: flex; gap: 8px; align-items: center;
}

.manage-list { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; padding-right: 5px;}
.manage-list::-webkit-scrollbar { width: 6px; }
.manage-list::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.1); border-radius: 10px; }

.manage-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 14px; border: 1px solid var(--color-border); border-radius: 12px; 
    margin-bottom: 10px; background: var(--color-surface); transition: 0.2s;
}
.manage-item:hover { border-color: var(--color-accent); transform: translateX(3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05);}

/* PROTECCIÓN CONTRA DESBORDES */
.manage-item-info { flex-grow: 1; min-width: 0; margin-right: 10px; }
.manage-item-title { 
    margin: 0 0 6px 0; font-weight: 600; font-size: 0.95rem; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--color-primary);
}
/* Flex-wrap: wrap permite que los iconos de vistas bajen de renglón si no hay espacio */
.manage-item-meta { margin: 0; font-size: 0.75rem; color: var(--color-secondary); display: flex; align-items: center; flex-wrap: wrap; gap: 8px;}

.badge-status { padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;}
.badge-draft { background: rgba(0,0,0,0.05); color: var(--color-secondary); }
.badge-published { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.event-stats-badge { display: inline-flex; gap: 10px; color: var(--color-secondary); font-weight: 600;}

.btn-delete { 
    background: rgba(239, 68, 68, 0.1); color: #ef4444; border: none; 
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer; flex-shrink: 0;
    transition: 0.2s; display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
}
.btn-delete:hover { background: #ef4444; color: white; transform: scale(1.1) rotate(5deg); }

/* ==========================================================================
   DISEÑO DE NIVELES (TIERS) - COLORES CORREGIDOS (Adiós Rosa)
   ========================================================================== */
.membership-tiers-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 25px; 
    margin: 20px 0;
    align-items: start; /* Asegura que no se estiren verticalmente si tienen distinto contenido */
}

.tier-card {
    background: var(--color-background); 
    border: 2px solid var(--color-border); 
    border-radius: 20px;
    padding: 30px 20px; 
    text-align: center; 
    position: relative; 
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex; 
    flex-direction: column;
}

/* --- ESTILOS PARA EL NIVEL DESTACADO (Dorado Premium) --- */
.tier-card.featured { 
    border-color: #f59e0b; /* Dorado/Ámbar Premium */
    transform: scale(1.03); 
    z-index: 2; 
    /* Sombra dorada suave */
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.15); 
}

.tier-tag { 
    position: absolute; 
    top: -12px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: #f59e0b; /* Dorado/Ámbar */
    color: white; 
    padding: 5px 15px; 
    border-radius: 20px; 
    font-size: 0.7rem; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.featured .btn-tier { 
    background: #f59e0b; /* Botón dorado para el nivel destacado */
}
.featured .btn-tier:hover {
    background: #d97706; /* Un tono más oscuro al hacer hover */
}

/* --- RESTO DE ESTILOS (Se mantienen igual) --- */
.tier-badge { 
    font-size: 0.75rem; 
    font-weight: bold; 
    color: var(--color-accent); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 10px; 
}
.tier-card h4 { 
    font-size: 1.4rem; 
    margin: 0 0 15px 0; 
    color: var(--color-primary); 
    font-family: var(--font-serif); /* Usando la fuente serif para títulos */
}
.tier-price { 
    font-size: 2rem; 
    font-weight: 800; 
    color: var(--color-primary); 
    margin-bottom: 20px; 
}
.tier-price span { 
    font-size: 0.85rem; 
    color: var(--color-secondary); 
    font-weight: 400; 
}

.tier-benefits { 
    list-style: none; 
    padding: 0; 
    margin: 0 0 25px 0; 
    text-align: left; 
    flex-grow: 1; 
}
.tier-benefits li { 
    font-size: 0.9rem; 
    color: var(--color-secondary); 
    margin-bottom: 12px; 
    display: flex; 
    gap: 10px; 
    line-height: 1.3;
}
.tier-benefits li i { 
    color: #10b981; /* Verde para los checks de beneficio */
    margin-top: 3px; 
}

.btn-tier { 
    width: 100%; 
    padding: 14px; 
    border-radius: 50px; 
    border: none; 
    background: var(--color-accent); /* Color de acento estándar para los otros botones */
    color: white; 
    font-weight: 700; 
    cursor: pointer; 
    transition: 0.2s; 
    font-size: 0.95rem;
}
.btn-tier:hover { 
    transform: translateY(-3px); 
    filter: brightness(1.1); 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* --- MODAL DE PAGO --- */
.payment-methods-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.payment-method-item { 
    display: flex; align-items: center; padding: 15px; border: 1px solid var(--color-border); 
    border-radius: 12px; cursor: pointer; transition: 0.2s; text-decoration: none; color: inherit;
}
.payment-method-item:hover { border-color: var(--color-accent); background: rgba(0,0,0,0.02); }
.pm-icon { width: 45px; height: 45px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; margin-right: 15px; }
.pm-info { flex-grow: 1; text-align: left; }
.pm-info strong { display: block; font-size: 0.95rem; }
.pm-info span { font-size: 0.75rem; color: var(--color-secondary); }
.pm-detail { background: var(--color-background); padding: 15px; border-radius: 12px; margin-top: -5px; border: 1px solid var(--color-border); border-top: none; }
.qr-small { width: 120px; display: block; margin: 0 auto 10px; }
.modal-footer-msg { font-size: 0.8rem; color: var(--color-secondary); text-align: center; margin-bottom: 15px; }

/* --- ESTILOS PARA EL BOTÓN OAUTH DE BLUESKY --- */
.btn-bsky-oauth {
    box-shadow: 0 4px 15px rgba(0, 133, 255, 0.3);
}

.btn-bsky-oauth:hover {
    background-color: #0070d6 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 133, 255, 0.4);
}

.btn-bsky-oauth:active {
    transform: scale(0.98);
}

/* Ajuste del modal para el nuevo contenido */
#modal-container .modal-content {
    max-width: 450px;
    border-radius: 24px;
}
/* ==========================================================================
   REINGENIERÍA MÓVIL: NAVEGACIÓN PRIORITARIA Y CENTRO DE MANDO
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. REORDENAR: Navegación arriba, Perfil después */
    .profile-container {
        display: flex !important;
        flex-direction: column !important;
    }

    .profile-tabs {
        order: -1 !important; /* Mueve las pestañas al principio de todo */
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 15px 5px !important;
        background: color-mix(in srgb, var(--color-bg) 85%, transparent);
        backdrop-filter: blur(12px) !important;
        position: sticky;
        top: 0;
        z-index: 100;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        scrollbar-width: none;
    }
    .profile-tabs::-webkit-scrollbar { display: none; }

    .profile-sidebar {
        order: 1 !important; /* La tarjeta de perfil baja después de las pestañas */
        width: 100% !important;
    }

    .profile-main-content {
        order: 2 !important;
        width: 100% !important;
    }

    /* 2. CENTRO DE MANDO: ESTADÍSTICAS A UNA SOLA COLUMNA */
    #tab-gestion .stats-grid {
        display: flex !important;
        flex-direction: column !important; /* Forzamos una sola columna */
        gap: 15px !important;
    }

    #tab-gestion .stat-card {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 20px !important;
        padding: 20px !important;
        text-align: left !important;
    }

    #tab-gestion .stat-card i {
        font-size: 1.8rem !important;
        margin: 0 !important;
    }

    #tab-gestion .stat-card h2 {
        font-size: 2rem !important;
        margin: 0 !important;
    }

    /* 3. AJUSTE DE COLUMNAS DE GESTIÓN */
    #tab-gestion .profile-tab-content {
        display: flex !important;
        flex-direction: column !important;
    }

    .main-column, .side-column {
        width: 100% !important;
        min-width: 100% !important;
        padding: 0 !important;
    }

    /* 4. MEJORA DE LISTAS DE ARTÍCULOS */
    .manage-item {
        padding: 20px !important;
        background: rgba(255,255,255,0.02) !important;
        border: 1px solid rgba(255,255,255,0.05) !important;
    }

    .manage-item-title {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
    }
}