/* ================================= */
/* RESET Y ESTILOS BASE (MOBILE FIRST) */
/* ================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background-color: #1e1e1e;
    color: #fff;
    line-height: 1.6;
}

h1 {
    color: #ffcc00;
}



/* ================================= */
/* HEADER Y NAVEGACIÓN (SOLO CSS) */
/* ================================= */
header {
  background-color: #282828;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Contenedor flexible */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.news-header {
    background-color: #333;
    padding: 1rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 1rem auto;
    color: #fff;
}


/* Hamburguesa CSS-only */
.menu-toggle {
  display: none;
}

.menu-label {
   display: inline-block;
  cursor: pointer;
  font-size: 2rem;
  color: white;
  padding: 0.5rem;
}

nav {
    width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: #282828;
}

nav ul {
     list-style: none;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.8rem 1rem;
    margin: 0;
    transition: all 0.3s;
    text-align: center;
}

nav a:hover {
    background-color: #ffcc00;
    color: #000;
    text-decoration: none;
}

.menu-toggle:checked ~ nav {
    max-height: 500px;
}

.menu-label::before {
    content: '☰';
}

.menu-toggle:checked ~ .menu-label::before {
    content: '✕';
}

/* ================================= */
/* CONTENIDO PRINCIPAL (MOBILE FIRST) */
/* ================================= */
.welcome {
    padding: 3rem 1rem;
    background-color: #333;
    text-align: center;
}
canvas {
    background-image: url('../img/carta.png'); /* Ajusta la ruta de la imagen */
    background-size: cover;
    background-position: center;
    display: block;
    margin: 10px auto;
    border: 2px solid white;
}

.latest-news {
    padding: 2rem 1rem;
}

/* Noticias */
.news-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.news-item {
    background: #444;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.news-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-content {
    padding: 1.5rem;
    text-align: left;
}

.news-meta {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

.news-text {
    margin: 1rem 0;
    font-size: 1rem;
}

/* Detalle de Noticias */
.news-detail-container {
    padding: 1rem;
}

.news-detail {
    background: #444;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.news-detail img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    margin: 1rem 0;
    border-radius: 8px;
}

/* Perfil de Usuario */
.profile-container {
    padding: 1rem;
}

.profile-card {
    background: #ffaa00;
    padding: 1.5rem;
    border-radius: 8px;
    max-width: 400px;
    margin: 0 auto;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    color: #000;
}

.profile-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.profile-card p {
    margin: 0.8rem 0;
    font-size: 1rem;
}

/* Botones */
.btn {
    display: block;
    padding: 0.8rem 1rem;
    margin: 1rem auto;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #ffcc00;
    color: #000;
}

.btn-primary:hover {
    background: #ffaa00;
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #1e7e34;
}

.btn-tercero {
    background: #5c5cff;
    color: white;
}

.btn-tercero:hover {
    background: #3d3dff;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 0.5rem 1rem;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-restart {
    background-color: #ffaa00;
    color: white;
    padding: 0.8rem;
    border-radius: 5px;
    font-weight: bold;
}

.btn-restart:hover {
    background-color: #ffcc00;
}

/* Formularios */
.form-container, .form-containeropinion {
    background-color: #333;
    padding: 1.5rem;
    border-radius: 10px;
    max-width: 400px;
    margin: 1rem auto;
    text-align: center;
}

.form-containeropinion {
    background-color: #2c2c2c;
    border-left: 5px solid #ffcc00;
    border-right: 5px solid #ffcc00;
    color: #eee;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #666;
    border-radius: 5px;
    background-color: #222;
    color: #fff;
    font-size: 1rem;
}

.form-input:focus {
    border-color: #ffcc00;
    outline: none;
}

/* Trivia */
.trivia-container {
    background-color: #444;
    padding: 1.5rem;
    border-radius: 10px;
    max-width: 600px;
    margin: 1rem auto;
}

.option {
    display: block;
    width: 100%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    background-color: #ffcc00;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 5px;
    transition: all 0.3s;
}

.option:hover {
    background-color: #ffaa00;
}

#next {
    background-color: #007BFF;
    color: white;
}

#next:hover {
    background-color: #0056b3;
}

/* Panel de Administración */
.admin-container {
    padding: 1rem;
}

.admin-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: #ffaa00;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.admin-table th, .admin-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.admin-table th {
    background: #444;
    color: white;
}

.admin-table tr:nth-child(even) {
    background: #ffaa00;
}

/* Juego de Memoria */
.game-container {
    padding: 1rem;
}

#memory-game {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    max-width: 600px;
    margin: 0 auto;
}

.card {
    width: 100%;
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
}

.card-front {
    background: #444 url("../img/carta.png") center/cover;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back img {
    width: 80%;
    height: 80%;
}

.highlight-search {
    background: #ffeb3b;
    color: #222;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 3px;
}

#difficulty-selection {
    margin: 1rem;
    text-align: center;
}

.difficulty-btn {
    padding: 0.8rem 1.2rem;
    margin: 0.5rem;
    font-size: 1rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    color: white;
}

#easy { 
    background-color: green; 
}
#medium { 
    background-color: orange; 
}
#hard { 
    background-color: red; 
}
#easy:hover { 
    background-color: darkgreen; 
}
#medium:hover { 
    background-color: darkorange; 
}
#hard:hover { 
    background-color: darkred; 
}

#countdown {
    font-size: 3rem;
    font-weight: bold;
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 1.5rem;
    border-radius: 10px;
    z-index: 1000;
}

/* Foro */
.forum-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.forum-container article {
    background-color: #2c2c2c;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    min-width: 0;
}

.forum-container article:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

.forum-container article h3 {
    color: #ffcc00;
    margin-bottom: 0.5rem;
}

.highlight-link {
    color: #ffcc00;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.highlight-link:hover {
    color: #ffaa00;
    text-decoration: underline;
}

.forum-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.foro-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.foro-left, .foro-center, .foro-right {
    display: flex;
    justify-content: center;
    width: 100%;
}

.forum-search input, 
.forum-search select, 
.forum-search button {
    padding: 0.5rem;
    margin: 0.25rem;
    font-size: 1rem;
}

.pagination-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Comentarios */
.comments-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #1e1e1e;
    border-radius: 10px;
}

.comment {
    background-color: #2c2c2c;
    color: #eee;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 4px solid #ffcc00;
    border-radius: 5px;
}

.comment-date {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 0.5rem;
}

.no-comments {
    color: #999;
    font-style: italic;
}

/* Opiniones */
.opinion-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.opinion-item {
    background: #2c2c2c;
    color: #eee;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid #ffcc00;
    border-right: 5px solid #ffcc00;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;
}

.opinions-list p {
    margin: 0.5rem 0;
}

/* Chat */
.chat-container {
    padding: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.chat-box {
    height: 60vh;
    overflow-y: auto;
    background: #111;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin: 0.8rem 0;
    animation: fadeIn 0.3s ease-in;
}

.chat-message.own-message {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.bubble {
    background-color: #2e2e2e;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    color: #eee;
    max-width: 80%;
}

.own-message .bubble {
    background-color: #4CAF50;
    color: white;
}

.meta {
    font-size: 0.8rem;
    color: #bbb;
    margin-bottom: 0.3rem;
}

.chat-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.chat-input textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 5px;
    background: #222;
    color: white;
    border: none;
    resize: none;
    min-height: 60px;
}

.chat-input-actions {
    display: flex;
    gap: 0.5rem;
}

.emoji-button {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #ffcc00;
}

#emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 10px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    z-index: 100;
}

#emoji-picker span {
    font-size: 1.3rem;
    margin: 0.3rem;
    cursor: pointer;
    display: inline-block;
}

.chat-input button[type="submit"] {
    background-color: #ffcc00;
    color: #000;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.reactions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.react-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 12px;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.react-btn:hover {
    background: rgba(255,255,255,0.2);
}

.edit-msg, .delete-msg {
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.edit-msg { color: #00c8ff; }
.delete-msg { color: #ff5555; }

.chat-image img {
    max-width: 100%;
    max-height: 200px;
    margin-top: 0.5rem;
    border-radius: 8px;
    border: 1px solid #444;
}

/* Busqueda */
.search-container {
    position: static !important;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
    right: auto !important;
    left: auto !important;
    top: auto !important;
    max-width: 100% !important;
    width: 100% !important;
    background: #ffcc00;
    padding: 0.8rem;
    border-radius: 10px;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#search-input {
    padding: 0.5rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    width: 100%;
    margin-bottom: 0.5rem;
}

#search-btn {
    padding: 0.5rem;
    background: #0099ff;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 0.5rem;
}

.search-result-item {
    background: #ffcc00;
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #cc9900;
}

#close-search {
    float: right;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #888;
}

#close-search:hover {
    color: #e00;
}

.download-btn {
    background-color: #0099ff;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: inline-block;
    margin: 0.5rem 0;
}

.download-btn:hover {
    background-color: #007acc;
}

/* Tema claro/oscuro */
#theme-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #333;
    color: #fff;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
}

body.light-mode {
    background-color: #f5f5f5;
    color: #111;
}

body.light-mode header {
    background-color: #e0e0e0;
}

body.light-mode .news-item,
body.light-mode .news-detail,
body.light-mode .forum-container article,
body.light-mode .comment,
body.light-mode .opinion-item {
    background-color: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body.light-mode .bubble {
    background-color: #eee;
    color: #111;
}

body.light-mode .own-message .bubble {
    background-color: #4CAF50;
    color: white;
}

body.light-mode .form-input,
body.light-mode .chat-input textarea {
    background: #f0f0f0;
    color: #000;
}

/* Status bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: #111;
    font-size: 0.8rem;
    color: #ccc;
    border-top: 1px solid #222;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-item.online::before {
    background-color: limegreen;
    animation: pulse-green 1.5s infinite;
}

.status-item.offline::before {
    background-color: red;
    animation: pulse-red 1.5s infinite;
}

.status-item.typing::before {
    background-color: deepskyblue;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

@keyframes pulse-green {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

@keyframes pulse-red {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

/* Animaciones */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================= */
/* MEDIA QUERIES - TABLET (768px) */
/* ================================= */
@media (min-width: 768px) {
    /* Header */
    .menu-label {
        display: none;
    }
    
    nav {
        width: auto;
        max-height: none;
        display: block;
        order: 2;
    }
    
    nav ul {
        flex-direction: row;
        padding: 0;
    }
    
    nav a {
        padding: 0.5rem 1rem;
    }
    
    /* Contenido */
    .news-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .news-item {
        flex: 1 1 calc(50% - 1rem);
    }
    
    #memory-game {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .forum-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .forum-container article {
        flex: 1 1 calc(50% - 1rem);
    }
    
    .btn {
        width: auto;
        display: inline-block;
    }
    
    .chat-message {
        max-width: 70%;
    }
    
    .forum-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .foro-toolbar {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .foro-left {
        justify-content: flex-start;
    }
    
    .foro-right {
        justify-content: flex-end;
    }
    
    .chat-input {
        flex-direction: row;
        align-items: flex-end;
    }
    
    .chat-input textarea {
        min-height: 50px;
    }
}

/* ================================= */
/* MEDIA QUERIES - DESKTOP (1024px) */
/* ================================= */
@media (min-width: 1024px) {
 /* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

h1{
    color: #ffcc00; 
}

/* Estilos generales */
body {
    background-color: #1e1e1e;
    color: #fff;
    text-align: center;
}

/* Header */
header {
    background-color: #282828;
}

header h1 {
  color: #ffcc00;
  margin: 0;
  font-size: 1.8rem;
}
nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
}

nav a:hover {
    text-decoration: underline;
}

/* Secciones */
.welcome {
    padding: 50px;
    background-color: #333;
}

.latest-news {
    padding: 30px;
}

/* Estilos para la Sección de Noticias */
.news-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.news-item {
    max-width: 800px; /* Limita el ancho de cada noticia */
    margin: 0 auto; /* Centra la noticia */
    overflow: hidden; /* Evita que el contenido desborde */
    display: flex;
    flex-direction: column;
}
.news-image img {
    max-width: 100%; /* Asegura que las imágenes no excedan el ancho del contenedor */
    height: auto; /* Mantiene la proporción de la imagen */
}

.news-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-content {
    flex: 2;
    padding: 20px;
}

.news-meta {
    font-size: 14px;
    color: #777;
}

.news-text {
    font-size: 16px;
    margin: 10px 0;
}

/* Estilos para Detalle de Noticias */
.news-detail-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.news-detail {
    background: #444;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

.news-meta {
    font-size: 14px;
    color: #777;
    margin-bottom: 10px;
}

.news-detail img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
    margin: 20px 0;
    border-radius: 8px;
}

.news-content {
    font-size: 16px;
    line-height: 1.6;
    text-align: justify;
}

/* Estilos para el Perfil de Usuario */
.profile-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.profile-card {
    background: #ffaa00;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.profile-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.profile-card p {
    font-size: 16px;
    margin: 8px 0;
}

.btn-primary, .btn-secondary {
    display: block;
    padding: 10px;
    margin: 10px 0;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.btn-primary {
    background: #007bff;
    color: white;
}



.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #1e7e34;
}


article {
    background-color: #444;
    padding: 20px;
}

.profile-card {
    background: #ffaa00;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.profile-card h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.profile-card p {
    font-size: 16px;
    margin: 8px 0;
}

/* Botón principal */
.btn-primary {
    display: block;
    margin: 20px auto;
    padding: 10px 10px;
    background: #ffcc00;
    color: black;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #ffaa00;
}

.btn-secondary {
    display: block;
    padding: 10px;
    margin: 10px 0;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #1e7e34;
}

/* Estilos para formularios */
.form-container {
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    width: 300px;
    margin: 20px auto;
    text-align: center;
}

.form-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #666;
    border-radius: 5px;
    background-color: #222;
    color: #fff;
}

.form-input:focus {
    border-color: #ffcc00;
    outline: none;
}



/* Estilo para la sección de noticias */
.news-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

article {
    background-color: #444;
    padding: 20px;
    border-radius: 10px;
    width: 40%;
    text-align: center;
}

article a {
    display: block;
    margin-top: 10px;
    color: #ffcc00;
}


article img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}


.highlight-link {
    color: #ffcc00;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s ease-in-out;
}

.highlight-link:hover {
    color: #ffaa00;
    text-decoration: underline;
}

.trivia-container {
    background-color: #444;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 50%;
    margin: auto;
}

.option {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background-color: #ffcc00;
    border: none;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
}

.option:hover {
    background-color: #ffaa00;
}

#next {
    display: block;
    margin-top: 15px;
    padding: 10px;
    background-color: #007BFF;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
}

#next:hover {
    background-color: #0056b3;
}

/* Panel de Administración */
.admin-container {
    padding: 20px;
    text-align: center;
}

.admin-table {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-collapse: collapse;
    background: #ffaa00;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.admin-table th, .admin-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background: #444;
    color: white;
}

.admin-table tr:nth-child(even) {
    background: #ffaa00;
}

.btn-danger {
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.btn-danger:hover {
    background: #c82333;
}

/* Contenedor del juego */
.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 600px;
    margin: 20px auto;
}
#memory-game {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 4 cartas por fila */
    gap: 10px;
    justify-content: center;
}
/* Tarjetas */
.card {
    width: 100px;
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
}


.card-back {
    background: white;
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back img {
    width: 80%;
    height: 80%;
}


.btn-primary {
    display: block;
    margin: 20px auto;
    padding: 10px 15px;
    background: #ffcc00;
    color: black;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
}


.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 600px;
    margin: 20px auto;
}

/* Tarjetas */
.card {
    width: 100px;
    height: 120px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
}

.card-front {
    background-image: url("../img/carta.png"); /* Ruta de la imagen */
    background-size: cover; /* Ajusta la imagen para cubrir toda la carta */
    background-position: center; /* Centra la imagen */
    border-radius: 8px; /* Mantiene el mismo estilo de bordes */
}


.card-back {
    background: white;
    transform: rotateY(180deg);
    display: flex;
    justify-content: center;
    align-items: center;
}

.card-back img {
    width: 80%;
    height: 80%;
}

canvas {
    background-image: url('../img/carta.png'); /* Ajusta la ruta de la imagen */
    background-size: cover;
    background-position: center;
    display: block;
    margin: 10px auto;
    border: 2px solid white;
}
#difficulty-selection {
    margin: 20px;
}

.btn {
    padding: 10px 20px;
    margin: 5px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    color: white;
    border-radius: 5px;
}
#easy { background-color: green; }
#medium { background-color: orange; }
#hard { background-color: red; }
#easy:hover { background-color: darkgreen; }
#medium:hover { background-color: darkorange; }
#hard:hover { background-color: darkred; }


#countdown {
    font-size: 50px;
    font-weight: bold;
    display: none;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    border-radius: 10px;
}

.btn-restart {
    background-color: #bd8b26;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

.btn-restart:hover {
    background-color: #ffcc00;
}


/* CONTENEDOR DEL FORO */
.forum-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* TARJETA DEL TEMA */
.forum-container article {
    flex: 1 1 calc(50% - 40px);
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    min-width: 300px;
    


}

/* EFECTO HOVER */
.forum-container article:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
}

/* TITULOS DE TEMAS */
.forum-container article h3 {
    margin: 0;
    color: #ffcc00;
}

/* TEXTO */
.forum-container article p {
    color: #ccc;
    margin: 10px 0;
}

/* ENLACES */
.forum-container article a.highlight-link {
    color: #ffcc00;
    font-weight: bold;
    text-decoration: none;
}

.forum-container article a.highlight-link:hover {
    text-decoration: underline;
}

/* Animación de entrada para artículos */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.comments-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #1e1e1e;
    border-radius: 10px;
}

.comment {
    background-color: #2c2c2c;
    color: #eee;
    padding: 10px 15px;
    margin-bottom: 12px;
    border-left: 4px solid #ffcc00;
    border-radius: 5px;
}

.comment-date {
    font-size: 0.8em;
    color: #aaa;
    margin-top: 5px;
    display: block;
}

.no-comments {
    color: #999;
    font-style: italic;
}

.opinion-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.opinion-item {
    background: #2c2c2c ;
    color: #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 5px solid #ffcc00;
    border-right: 5px solid #ffcc00;
    border-radius: 8px;
    width: 100%;
    max-width: 700px;

}


.opinions-list p {
    margin: 5px 0;
}

.form-containeropinion{
        background-color: #2c2c2c;
        color: #eee;
        padding: 15px;
        margin-bottom: 15px;
        border-left: 5px solid #ffcc00;
        border-right: 5px solid #ffcc00;
        border-radius: 8px;
        width: 100%;
        max-width: 700px;
}


.forum-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

/* Botón tercero personalizado (ya tienes parte de esto, pero por si acaso) */
.btn-tercero {
    background-color: #5c5cff;
    color: white;
    margin: 20px auto;
    padding: 10px 10px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.btn-tercero:hover {
    background-color: #3d3dff;
}

.foro-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 240px;
    margin-bottom: 10px;
}

.foro-left,
.foro-center,
.foro-right {
    display: flex;
    align-items: center;
}

.foro-left {
    flex: 1;
    justify-content: flex-start;
}

.foro-center {
    flex: 1;
    justify-content: center;
}

.foro-right {
    flex: 1;
    justify-content: flex-end;
    padding: 0px 120px;
}

.forum-search input,
.forum-search select,
.forum-search button {
    margin-left: 5px;
    padding: 6px 10px;
    font-size: 14px;
}

.pagination-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}
.chat-box {
    height: 420px;
    overflow-y: auto;
    border-radius: 10px;
    padding: 15px;
    background: #111;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
}
.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
    animation: fadeIn 0.3s ease-in;
}
.chat-message.own-message {
    flex-direction: row-reverse;
    justify-content: flex-end;
    text-align: right;
}
.chat-message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.bubble {
    background-color: #2e2e2e;
    padding: 10px 14px;
    border-radius: 10px;
    color: #eee;
    max-width: 60%;
    position: relative;
}
.own-message .bubble {
    background-color: #4CAF50;
    color: white;
}
.meta {
    font-size: 0.75rem;
    margin-bottom: 5px;
    color: #bbb;
}
.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.chat-input textarea {
    flex: 1;
    height: 50px;
    resize: none;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    position: relative;
}
.chat-input textarea {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    resize: none;
    background: #222;
    color: white;
    border: none;
}

.chat-input button,
.chat-input label {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
}

.chat-input button[type="submit"] {
    margin-left: 10px;
    background-color: #ffcc00;
    border: none;
    padding: 10px 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
}

/* Emoji picker */
.emoji-button {
    background: none;
    border: none;
    font-size: 20px;
    margin-right: 8px;
    cursor: pointer;
}
#emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 0;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    display: none;
    z-index: 999;
}
#emoji-picker span {
    font-size: 1.3rem;
    margin: 5px;
    cursor: pointer;
}
#emoji-picker span:hover {
    background: #333;
    border-radius: 5px;
}
.reactions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.react-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 12px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.react-btn:hover {
    background: rgba(0,0,0,0.1);
    transform: scale(1.1);
}

/* Indicador de carga */
.load-more-indicator {
    height: 1px;
    width: 100%;
    visibility: hidden;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.edit-msg, .delete-msg {
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 5px;
}
.edit-msg { color: #00c8ff; }
.delete-msg { color: #ff5555; }

.chat-image img {
    max-width: 220px;
    max-height: 200px;
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid #444;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Botón del modo claro/oscuro */
#theme-toggle {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #333;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 999;
}

body.light-mode {
    background-color: #f5f5f5;
    color: #111;
}

body.light-mode .chat-box {
    background-color: #fff;
    border-color: #ddd;
}

body.light-mode .chat-message .bubble {
    background-color: #eee;
    color: #111;
}

body.light-mode .chat-input textarea {
    background: #f0f0f0;
    color: #000;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #ccc;
    margin: 8px 0 4px 0;
    padding: 0 8px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-item.typing::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: deepskyblue;
    border-radius: 50%;
    animation: pulse 1s ease-in-out infinite;
}


@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.4); opacity: 1; }
}
.status-bar {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: #111;
    font-size: 0.85rem;
    border-top: 1px solid #222;
    color: #ccc;
}

.status-item::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-item.online::before {
    background-color: limegreen;
    animation: pulse-green 1.5s infinite;
}

.status-item.offline::before {
    background-color: red;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-green {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}
@keyframes pulse-red {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}


#search-input {
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#search-btn {
    padding: 5px 10px;
    background: #0099ff;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.search-results {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    background: #ffcc00;
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #cc9900;
}

.chat-message.highlight {
    background: #cc9900;
    transition: background-color 0.6s ease;
}

#close-search {
    float: right;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #888;
}

#close-search:hover {
    color: #e00;
}

.download-btn {
    background-color: #0099ff;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
.download-btn:hover {
    background-color: #007acc;
}
.highlight-search {
    background: #ffeb3b;
    color: #222;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 3px;
}

}
