:root {
    /* Paleta Cosmic News */
    --bg-void: #05050a;
    --bg-card: #0f0c18;
    --bg-panel: #13111c;
    
    --primary: #a855f7;    /* Morado */
    --secondary: #00f2ff;  /* Cyan (Tech) */
    --accent: #ff0055;     /* Rosa (Gaming/Anime) */
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --border: rgba(168, 85, 247, 0.2);
    --glow: 0 0 20px rgba(168, 85, 247, 0.15);
    
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-void);
    color: var(--text-main);
    font-family: var(--font-body);
    /* Fondo sutil */
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(0, 242, 255, 0.05) 0%, transparent 40%);
    min-height: 100vh;
}

/* Tipografía */
h1, h2, h3, h4, .logo { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1px; }

/* Botones Neon */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: var(--glow);
}

.btn-primary:hover { box-shadow: 0 0 30px rgba(168, 85, 247, 0.4); transform: translateY(-2px); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--secondary);
    color: var(--secondary);
}

.btn-outline:hover { background: rgba(0, 242, 255, 0.1); box-shadow: 0 0 15px rgba(0, 242, 255, 0.2); }

/* Inputs Modernos */
input, textarea, select {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    font-family: var(--font-body);
    margin-bottom: 1rem;
}
input:focus, textarea:focus { outline: none; border-color: var(--secondary); }

/* Contenedores */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* Navbar Simple (Base) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(5, 5, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- ESTILOS DEL DASHBOARD --- */

.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar (Barra Lateral) */
.sidebar {
    width: 260px;
    background: rgba(15, 12, 24, 0.95);
    border-right: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    backdrop-filter: blur(10px);
}

.user-info {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    margin-bottom: 10px;
    object-fit: cover;
}

.user-role {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    font-weight: bold;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(168, 85, 247, 0.1);
    color: white;
    border-left: 3px solid var(--primary);
}

.nav-links a.admin-link {
    color: #ffd700; /* Dorado para admins */
}

/* Área Principal */
.main-content {
    flex: 1;
    margin-left: 260px; /* Ancho del sidebar */
    padding: 2rem;
}

/* Tarjetas de Estadísticas (Stats) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s;
}

.stat-card:hover { transform: translateY(-5px); border-color: var(--secondary); }

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    background: rgba(168, 85, 247, 0.1);
    padding: 15px;
    border-radius: 10px;
}

.stat-info h3 { font-size: 2rem; margin-bottom: 5px; color: white; }
.stat-info p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }

/* Tabla de Noticias Recientes */
.recent-posts {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 15px; color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 15px; border-bottom: 1px solid rgba(255,255,255,0.05); color: white; font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

/* Badges de Estado */
.badge { padding: 5px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; text-transform: uppercase; }
.badge-published { background: rgba(0, 242, 255, 0.15); color: #00f2ff; border: 1px solid rgba(0, 242, 255, 0.3); }
.badge-pending { background: rgba(255, 215, 0, 0.15); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.3); }
.badge-rejected { background: rgba(255, 0, 85, 0.15); color: #ff0055; border: 1px solid rgba(255, 0, 85, 0.3); }

/* Responsive Dashboard */
@media (max-width: 768px) {
    .sidebar { display: none; } /* En móvil haríamos un menú hamburguesa luego */
    .main-content { margin-left: 0; }
}

/* --- ESTILOS DEL CARRUSEL (SLIDER) --- */
.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 2rem auto 4rem auto; /* Margen para separar del menú y del contenido */
    height: 450px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 10s ease; /* Transform para efecto zoom lento */
    transform: scale(1);
    z-index: 1;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 2;
    transform: scale(1.05); /* Efecto zoom sutil al estar activo */
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Degradado oscuro sobre la imagen para que se lea el texto */
.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-void) 10%, rgba(5,5,10,0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
}

.slide-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    transform: translateY(20px);
    transition: transform 1s ease;
}

.carousel-slide.active .slide-content {
    transform: translateY(0);
}

.slide-category {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 50px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.slide-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 20px rgba(0,0,0,0.8);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.slide-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Indicadores (Puntitos abajo) */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    right: 30px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    transition: 0.3s;
}

.indicator.active {
    background: var(--secondary);
    box-shadow: 0 0 10px var(--secondary);
    transform: scale(1.2);
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-container { height: 350px; border-radius: 0; margin-top: 0; }
    .slide-title { font-size: 1.5rem; }
    .slide-overlay { padding: 1.5rem; }
}

/* --- MEJORA DEL SELECTOR DE CATEGORÍA --- */

/* Estilo base del input select */
select {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* Fondo oscuro semitransparente */
    color: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 15px;
    font-family: var(--font-body);
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    
    /* TRUCO: Quitar la flecha fea por defecto del navegador */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Poner nuestra propia flecha morada usando un SVG codificado */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23a855f7%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8rem auto;
}

/* Efecto al hacer clic (Focus) */
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
    background-color: rgba(0, 0, 0, 0.5);
}

/* ESTILO CRUCIAL: Las opciones desplegables */
/* Esto arregla el fondo blanco */
option {
    background-color: #0f0c18; /* Usamos un color oscuro sólido (var(--bg-void) aprox) */
    color: white;
    padding: 10px;
}

/* Opcional: Estilo al pasar el mouse por las opciones (Solo funciona en algunos navegadores modernos) */
option:hover {
    background-color: var(--primary);
}

/* --- RESPONSIVE / DISEÑO MÓVIL --- */

@media (max-width: 850px) {
    
    /* 1. AJUSTES GENERALES */
    body { font-size: 14px; }
    h1 { font-size: 1.8rem !important; }
    .container, .dashboard-wrapper { padding: 0; }
    
    /* 2. NAVBAR PÚBLICA (Index/Post) */
    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 1rem;
    }
    .public-navbar {
        flex-direction: row; /* Mantener fila en post */
        padding: 1rem;
    }
    
    /* 3. CARRUSEL MÓVIL */
    .carousel-container {
        height: 300px; /* Más bajo en móvil */
        margin-top: 0;
        border-radius: 0;
        border-left: none; 
        border-right: none;
    }
    .slide-content { transform: translateY(0); text-align: left; }
    .slide-title { font-size: 1.5rem; }
    .slide-overlay { padding: 1.5rem; background: linear-gradient(to top, var(--bg-void) 20%, rgba(5,5,10,0.4) 80%); }

    /* 4. DASHBOARD (EL CAMBIO GRANDE) */
    .dashboard-wrapper {
        grid-template-columns: 1fr; /* Una sola columna */
    }

    /* La barra lateral se convierte en un menú oculto */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%; /* Oculto a la izquierda */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 5000;
        transition: 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        left: 0; /* Mostrar al activar */
    }

    /* Fondo oscuro cuando abres el menú */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.8);
        z-index: 4999;
        backdrop-filter: blur(3px);
    }
    .menu-overlay.active { display: block; }

    .main-content {
        padding: 1.5rem;
        width: 100%;
    }

    /* Botón de Menú (Hamburguesa) */
    .mobile-menu-btn {
        display: inline-flex; /* Visible solo en móvil */
        align-items: center; justify-content: center;
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: white;
        padding: 8px;
        border-radius: 8px;
        cursor: pointer;
        margin-right: 15px;
        vertical-align: middle;
    }

    /* 5. TABLAS RESPONSIVAS */
    /* Fuerza a las tablas a tener scroll horizontal si no caben */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table { min-width: 600px; /* Forzar ancho mínimo para que no se aplaste */ }

    /* 6. GRID DE NOTICIAS */
    .news-grid {
        grid-template-columns: 1fr; /* Una columna */
        padding: 0 1rem;
    }
    
    /* 7. PERFIL PÚBLICO */
    .profile-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1rem;
    }
    .profile-card { position: relative; top: 0; }
    
    /* 8. FORMULARIOS */
    .form-card, .settings-card { padding: 1.5rem; }
    .btn-group { flex-direction: column; }
    
    /* Ajustes Modals */
    .preview-content, .discord-box, .reject-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
}

/* Ocultar botón móvil en escritorio */
@media (min-width: 851px) {
    .mobile-menu-btn { display: none; }
}

/* --- ESTILOS DE LOGIN Y REGISTRO --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: radial-gradient(circle at center, #1a1a2e 0%, #000 100%);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px; /* En PC no pasa de este ancho */
    box-shadow: 0 0 50px rgba(168, 85, 247, 0.1);
    position: relative;
    overflow: hidden;
}

/* Decoración Neón superior */
.auth-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.auth-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: white;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* Inputs más cómodos para el dedo en móvil */
.auth-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-size: 1rem; /* Evita zoom automático en iPhone */
    transition: 0.3s;
}
.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
    outline: none;
}

/* Mensaje de Periodista (Nuevo) */
.journalist-msg {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #e2e8f0;
    text-align: center;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem; }
    .auth-title { font-size: 1.5rem; }
}

/* --- SISTEMA DE LOGROS Y TIENDA --- */

/* Badge de Puntos en el Sidebar */
.points-badge {
    background: linear-gradient(90deg, #ffd700, #ffa500);
    color: black; font-weight: bold; padding: 5px 10px;
    border-radius: 50px; font-size: 0.8rem; display: inline-block;
    margin-top: 5px; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* --- MARCOS COSMÉTICOS (AVATAR FRAMES) --- */
/* Base para que el marco se posicione sobre el avatar */
.avatar-container {
    position: relative; display: inline-block;
}
.user-avatar.framed {
    box-sizing: border-box; /* Importante para que el borde no deforme */
}

/* 1. Marco Cyber (Cian Brillante) */
.frame-cyber {
    border: 3px solid #00f2ff;
    box-shadow: 0 0 15px #00f2ff;
}

/* 2. Marco Gold (Dorado Metálico) */
.frame-gold {
    border: 3px solid #ffd700;
    box-shadow: 0 0 10px #ffd700, inset 0 0 10px #ffd700;
}

/* 3. Marco Fire (Animado) */
.frame-fire {
    border: 3px solid #ff4500;
    animation: burn 1s infinite alternate;
    box-shadow: 0 0 20px #ff4500;
}
@keyframes burn {
    from { box-shadow: 0 0 10px #ff4500; }
    to { box-shadow: 0 0 25px #ffae00, 0 0 10px #ff4500; }
}

/* 4. Marco Glitch */
.frame-glitch {
    border: 3px solid #a855f7;
    position: relative;
}
.frame-glitch::after {
    content: ''; position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px;
    border: 1px dashed white; opacity: 0.5;
    animation: spin 10s linear infinite;
    border-radius: 50%;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Tarjetas de la Tienda */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.shop-item { 
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; transition: 0.3s; 
    display: flex; flex-direction: column; justify-content: space-between;
}
.shop-item:hover { transform: translateY(-5px); border-color: var(--secondary); }
.item-preview { width: 80px; height: 80px; margin: 0 auto 1rem auto; border-radius: 50%; background: #000; object-fit: cover; }

/* --- NOTIFICACIONES FLOTANTES (TOASTS) --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: rgba(15, 12, 24, 0.95);
    border: 1px solid var(--primary);
    border-left: 4px solid var(--primary); /* Borde lateral morado */
    color: white;
    padding: 15px 25px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    
    /* Animación de entrada y salida */
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success { border-left-color: #00ff88; }
.toast.success i { color: #00ff88; }

.toast.points { border-left-color: #ffd700; background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), rgba(0,0,0,0.9)); }
.toast.points i { color: #ffd700; }

.toast-content strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.toast-content span { font-size: 0.85rem; color: var(--text-muted); }

.avatar-container {
    position: relative;
    display: inline-block;
    /* Ajuste para que el marco no se corte */
    padding: 3px; 
}