/* VARIABLES Y PALETA DE COLORES BASE */
:root {
    --bg-main: #0d0b14;
    --bg-card: #1a1625;
    --bg-hover: #261f36;
    --purple-accent: #8b5cf6;
    --purple-dark: #6d28d9;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #2e2440;
    --danger: #ef4444;
}

/* RESET GENERAL */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; 
}

body { 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh; 
}

/* CABECERA Y NAVBAR */
.navbar { 
    background-color: rgba(13, 11, 20, 0.9); 
    backdrop-filter: blur(10px); 
    border-bottom: 1px solid var(--border-color); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    padding: 15px 30px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.brand { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--text-main); 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.brand i { 
    color: var(--purple-accent); 
}

/* CONTENEDOR PRINCIPAL */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    flex-grow: 1;
}

/* CLASES DE UTILIDAD */
.hidden { 
    display: none !important; 
}

/* Añadir al final de styles.css */

/* ESTRUCTURA SOCIAL */
.wiki-container { 
    display: flex; 
    gap: 30px; 
    width: 100%; 
}

.sidebar { 
    width: 250px; 
    background-color: var(--bg-card); 
    border-radius: 12px; 
    padding: 20px; 
    border: 1px solid var(--border-color); 
    height: fit-content; 
    position: sticky; 
    top: 90px; 
}

.sidebar h3 { color: var(--text-muted); margin-bottom: 15px; font-size: 0.9rem; text-transform: uppercase; }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.sidebar-menu li a { color: var(--text-main); text-decoration: none; padding: 10px 15px; display: block; border-radius: 6px; transition: 0.2s; }
.sidebar-menu li:hover a, .sidebar-menu li.active a { background-color: var(--purple-accent); color: white; }

.content { flex-grow: 1; max-width: 800px; }

/* POSTS Y CREADOR */
.card { 
    background-color: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    padding: 25px; 
    margin-bottom: 25px; 
}

.post-textarea { 
    width: 100%; background-color: var(--bg-main); border: 1px solid var(--border-color); 
    color: white; padding: 15px; border-radius: 8px; outline: none; min-height: 80px; resize: vertical; 
}
.post-textarea:focus { border-color: var(--purple-accent); }

.btn { padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; border: none; color: white; }
.btn-primary { background-color: var(--purple-accent); }
.btn-primary:hover { background-color: var(--purple-dark); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.post-user-info { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.avatar { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--purple-accent); display:flex; align-items:center; justify-content:center; font-weight:bold; background: var(--bg-main);}
.post-text { line-height: 1.6; margin-bottom: 15px; font-size: 1.05rem; white-space: pre-wrap; }

/* INTERACCIONES Y COMENTARIOS */
.interaction-bar { display: flex; gap: 20px; border-top: 1px solid var(--border-color); padding-top: 15px; }
.interact-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.interact-btn:hover { color: var(--purple-accent); }
.interact-btn.liked { color: var(--danger); }

.comments-area { margin-top: 15px; padding-left: 20px; border-left: 2px solid var(--border-color); }
.comment-item { background: var(--bg-main); padding: 8px 12px; border-radius: 6px; margin-bottom: 10px; font-size: 0.9rem; }
.comment-box { display: flex; gap: 10px; margin-top: 10px; }
.comment-input { flex-grow: 1; background: var(--bg-main); border: 1px solid var(--border-color); color: white; padding: 10px; border-radius: 6px; outline: none; }

/* --- Añadir al final de styles.css --- */

/* CABECERA Y BOTONES DE AUTENTICACIÓN */
.auth-header {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--purple-accent);
    color: var(--text-main);
}
.btn-outline:hover {
    background: var(--bg-hover);
    border-color: var(--purple-dark);
}

/* FORMULARIOS DE CUENTAS */
.auth-container {
    max-width: 400px;
    margin: 40px auto;
}

.auth-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--purple-accent);
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: white;
    padding: 12px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--purple-accent);
}

.error-msg {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/* --- ESTILOS DE PERFIL (ESTILO DISCORD) --- */
.profile-wrapper {
    max-width: 850px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.profile-banner {
    height: 200px;
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-accent));
    background-size: cover;
    background-position: center;
    position: relative;
}

.btn-personalizar {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(13, 11, 20, 0.7);
    color: white;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
    backdrop-filter: blur(5px);
}
.btn-personalizar:hover {
    background: var(--purple-accent);
}

.profile-body {
    padding: 65px 30px 30px 30px;
    position: relative;
}

.profile-avatar-large {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 6px solid var(--bg-card);
    background: var(--bg-main);
    position: absolute;
    top: -65px;
    left: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--purple-accent);
}

.profile-name {
    font-size: 2rem;
    font-weight: 800;
}

.profile-handle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.profile-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin: 25px 0 15px 0;
}

.profile-desc-box {
    background: var(--bg-main);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    line-height: 1.6;
    font-size: 0.95rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-box {
    background: var(--bg-main);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 5px;
}
.info-value {
    font-size: 1.05rem;
    font-weight: 500;
}

/* --- ESTILOS DE MENSAJERÍA DIRECTA (MD) --- */
.md-contact-item {
    display: flex; gap: 12px; padding: 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s; border: 1px solid transparent; background: transparent;
}
.md-contact-item:hover {
    background: rgba(139, 92, 246, 0.1); /* Brillo morado transparente */
    border-color: rgba(139, 92, 246, 0.3);
}

.chat-header {
    padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 15px; background: rgba(0,0,0,0.2); box-shadow: 0 4px 10px rgba(0,0,0,0.1); z-index: 2;
}

.chat-messages {
    flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth;
}

.chat-input-area {
    padding: 15px 20px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; background: rgba(0,0,0,0.2);
}

.msg-bubble {
    max-width: 75%; padding: 10px 15px; border-radius: 12px; font-size: 0.95rem; line-height: 1.4; word-wrap: break-word;
}
.msg-mine {
    background: var(--purple-accent); color: white; border-bottom-right-radius: 2px;
}
.msg-theirs {
    background: var(--bg-main); color: var(--text-main); border-bottom-left-radius: 2px; border: 1px solid var(--border-color);
}

/* Burbuja de Notificación Global */
.notif-badge-global {
    background-color: var(--danger);
    color: white;
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    margin-left: auto; /* Lo empuja a la derecha */
}

/* LOGO OFICIAL DE STEVSCON */
.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

/* --- FORMATOS DE TEXTO DINÁMICOS (fonts.js) --- */

/* 2. Cita (> texto) */
.md-quote {
    border-left: 3px solid #6b7280;
    margin: 4px 0;
    padding-left: 10px;
    color: #9ca3af;
    font-style: normal;
}

/* 4. Código inline (`texto`) */
.md-code {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px 7px;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: var(--text-main);
    display: inline-block;
}

/* 6. Lista (- texto) */
.md-bullet {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 3px 0;
}
.bullet-dot {
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-main);
}

/* 7. Header grande (# texto) */
.md-h1 {
    font-size: 1.7rem;
    font-weight: 900;
    margin: 8px 0 4px 0;
    color: var(--text-main);
}

/* --- ESTILOS DE BADGES Y VERIFICADO (ESTILO DISCORD) --- */

.verified-badge-icon {
    color: var(--purple-accent);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

/* Icono de verificado ampliado específicamente en la cabecera del Perfil */
.profile-name .verified-badge-icon {
    font-size: 1.35rem;
    margin-left: 2px;
}

.badges-container-discord {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.badge-item-discord {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.badge-item-discord:hover {
    background: var(--purple-accent);
    color: #fff;
    transform: translateY(-2px);
}

/* Tooltip emergente rápido al pasar el ratón */
.badge-item-discord .badge-tooltip-popover {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #0d0b14;
    color: #fff;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid var(--purple-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 100;
}

.badge-item-discord:hover .badge-tooltip-popover {
    visibility: visible;
    opacity: 1;
}

/* Toast flotante para clicks en dispositivos móviles/pantalla */
.badge-toast-popup {
    position: fixed;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--purple-accent);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.8);
    z-index: 2000;
    text-align: center;
    pointer-events: none;
    animation: fadeInBadge 0.2s ease-out;
}

.badge-toast-popup strong {
    color: var(--purple-accent);
    font-size: 0.85rem;
    display: block;
}

.badge-toast-popup p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

@keyframes fadeInBadge {
    from { opacity: 0; transform: translate(-50%, 5px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- ESTILOS MEJORADOS PARA STEVSCON ACCOUNTS --- */

.stevscon-accounts-card {
    background: linear-gradient(145deg, rgba(26, 22, 37, 0.95), rgba(15, 12, 24, 0.98));
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 30px 25px;
}

.accounts-header {
    text-align: center;
    margin-bottom: 20px;
}

.accounts-logo {
    font-size: 2.2rem;
    color: var(--purple-accent);
    margin-bottom: 8px;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.auth-tabs {
    display: flex;
    background: var(--bg-main);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 9px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-tab-btn.active {
    background: var(--purple-accent);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.google-auth-box {
    margin-bottom: 15px;
}

.btn-google-custom {
    width: 100%;
    background: #ffffff;
    color: #3c4043;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 11px 16px;
    border-radius: 8px;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google-custom:hover {
    background-color: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===================================================
   ADAPTACIÓN PARA CELULARES Y TABLETS (Pantallas < 768px)
   =================================================== */
@media (max-width: 768px) {

    /* 1. Ajustar el contenedor principal */
    .main-container {
        padding: 10px;
        width: 100%;
    }

    /* 2. Cambiar la barra de navegación de horizontal a vertical */
    .navbar {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }

    /* 3. Asegurar que las imágenes y elementos no se salgan de pantalla */
    img {
        max-width: 100%;
        height: auto;
    }

    /* 4. Ajustar fuentes grandes */
    h1 {
        font-size: 1.5rem;
    }

    /* 5. Si tienes columnas lado a lado (ej. Feed y Barra Lateral), apilarlas */
    .grid-container, .social-layout {
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
    }
}