/* ========================================
   FORO MEJORADO - ESTILOS COMPLETO (RESPONSIVO)
   ======================================== */

/* -------------------------
   Contenedor principal
   ------------------------- */
.foro-container {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
    min-height: calc(100vh - 200px);
    position: relative;
    z-index: 2;
}

/* -------------------------
   Header del foro
   ------------------------- */
.foro-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    position: relative;
    z-index: 2;
}

.foro-title {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    font-weight: 700;
}

.foro-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

/* ========================================
   ESTADÍSTICAS DEL FORO
   ======================================== */
.foro-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0 30px;
    padding: 20px;
    background: rgba(11, 13, 27, 0.6);
    border-radius: 15px;
    border: 1px solid rgba(114, 214, 255, 0.2);
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   BARRA DE BÚSQUEDA
   ======================================== */
.search-container {
    margin-bottom: 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(114, 214, 255, 0.3);
    border-radius: 25px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #72d6ff;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(114, 214, 255, 0.1);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* ========================================
   ÁREA DE MENSAJES
   ======================================== */
.mensajes-container {
    /* puedes poner padding o max-height si lo deseas */
}

/* ========================================
   MENSAJE ITEM (MEJORADO CON AVATAR)
   ======================================== */
.mensaje-item {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    margin: 10px 0;
    border-radius: 12px;
    border-left: 3px solid #72d6ff;
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Avatar */
.mensaje-avatar {
    flex-shrink: 0;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #0b0d1b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Contenido del mensaje */
.mensaje-content {
    flex: 1;
    min-width: 0;
}

.mensaje-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.mensaje-nombre {
    color: #72d6ff;
    font-weight: 600;
    font-size: 1em;
}

.badge-editado {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.mensaje-fecha {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
    white-space: nowrap;
    margin-left: auto;
}

.mensaje-texto {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    word-wrap: break-word;
    margin-bottom: 10px;
}

/* ========================================
   MENCIONES Y HASHTAGS
   ======================================== */
.mencion {
    color: #72d6ff;
    font-weight: 600;
    background: rgba(114, 214, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mencion:hover {
    background: rgba(114, 214, 255, 0.25);
}

.hashtag {
    color: #ff7fff;
    font-weight: 600;
    background: rgba(255, 127, 255, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.hashtag:hover {
    background: rgba(255, 127, 255, 0.25);
}

.mensaje-link {
    color: #7fffcc;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.mensaje-link:hover {
    color: #9fffdd;
}

/* ========================================
   SISTEMA DE REACCIONES
   ======================================== */
.mensaje-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.reacciones-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.reaccion-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.reaccion-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.btn-reaccion {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-reaccion:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #72d6ff;
    color: #72d6ff;
    transform: translateY(-1px);
}

.reacciones-menu {
    position: absolute;
    display: flex;
    gap: 8px;
    background: rgba(11, 13, 27, 0.95);
    padding: 10px;
    border-radius: 25px;
    border: 1px solid rgba(114, 214, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    margin-top: -50px;
    animation: popIn 0.2s ease;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.reacciones-menu button {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.reacciones-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

/* ========================================
   FORMULARIO MEJORADO (COMPLETO)
   ======================================== */
.formulario-integrado {
    border-radius: 20px;
    border: 1px solid rgba(114, 214, 255, 0.25);
    padding: 25px;
    margin: 25px 0;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.form-header {
    color: #72d6ff;
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-header::before {
    content: '💬';
    font-size: 1.3em;
}

.form-container {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    width: 100%;
}

/* columna izquierda (nombre arriba, textarea abajo) */
.input-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* estilos de inputs/textarea (unificados y pulidos) */
.foro-input,
.foro-textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.foro-textarea {
    resize: vertical;
    min-height: 85px;
    line-height: 1.4;
}

.foro-input:focus,
.foro-textarea:focus {
    outline: none;
    border-color: #72d6ff;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(114, 214, 255, 0.12);
    transform: translateY(-2px);
}

/* Botón principal del foro */
.btn-foro {
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    color: #0b0d1b;
    border: none;
    padding: 15px 32px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    height: fit-content;
    transition: all 0.3s ease;
    min-height: 52px;
    box-shadow: 0 6px 20px rgba(114, 214, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-foro::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-foro:hover::before {
    left: 100%;
}

/* Contador de caracteres */
.counter {
    position: absolute;
    bottom: -18px;
    right: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
}

/* ========================================
   NOTIFICACIONES
   ======================================== */
.new-message-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    color: #0b0d1b;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.new-message-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.new-message-notification button {
    background: rgba(11, 13, 27, 0.9);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.new-message-notification button:hover {
    background: #0b0d1b;
    transform: scale(1.05);
}

/* ========================================
   SISTEMA DE ALERTAS
   ======================================== */
.alerta {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.alerta.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.alerta-success {
    background: rgba(127, 255, 127, 0.9);
    color: #0b0d1b;
}

.alerta-error {
    background: rgba(255, 127, 127, 0.9);
    color: #0b0d1b;
}

.alerta-warning {
    background: rgba(255, 255, 127, 0.9);
    color: #0b0d1b;
}

.alerta-info {
    background: rgba(114, 214, 255, 0.9);
    color: #0b0d1b;
}

/* ========================================
   ESTADOS (loading / empty)
   ======================================== */
.loading, .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
}

.empty-state::before {
    content: '💬';
    font-size: 3em;
    display: block;
    margin-bottom: 15px;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ========================================
   SCROLLBAR PERSONALIZADO (mensajes)
   ======================================== */
.mensajes-container::-webkit-scrollbar {
    width: 10px;
}

.mensajes-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.mensajes-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    border-radius: 5px;
}

.mensajes-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #8adfff, #ff99ff);
}

/* ========================================
   CONTROLES DE MÚSICA
   ======================================== */
.music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(11, 13, 27, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 8px 15px;
    border: 1px solid rgba(114, 214, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.music-controls:hover {
    background: rgba(11, 13, 27, 0.9);
    border-color: rgba(114, 214, 255, 0.6);
}

.music-toggle {
    background: none;
    border: none;
    color: #72d6ff;
    cursor: pointer;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.music-toggle:hover {
    background: rgba(114, 214, 255, 0.1);
    transform: scale(1.1);
}

.volume-control {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.volume-slider {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #72d6ff;
    border-radius: 2px;
    width: 70%;
    transition: width 0.1s ease;
}

.volume-handle {
    position: absolute;
    top: 50%;
    right: 0;
    width: 12px;
    height: 12px;
    background: #72d6ff;
    border-radius: 50%;
    transform: translate(50%, -50%);
    box-shadow: 0 0 5px rgba(114, 214, 255, 0.8);
    cursor: grab;
}

.volume-handle:active {
    cursor: grabbing;
}

.music-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* ========================================
   ANIMACIONES Y TRANSICIONES
   ======================================== */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Asegurar z-index correcto */
.foro-container,
.mensajes-container,
.formulario-integrado,
.foro-stats,
.search-container {
    position: relative;
    z-index: 2;
}

/* Prevenir interferencias con elementos espaciales */
#starfield,
.spiral-galaxy,
.aurora,
.star,
.shooting-star,
.comet,
.planet {
    pointer-events: none;
}

/* ========================================
   SISTEMA DE AVATAR PERSONALIZADO
   ======================================== */
.avatar-nombre-container {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.avatar-editable {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.avatar-editable:hover .avatar-cambiar {
    opacity: 1;
}

.avatar-iniciales {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #0b0d1b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.avatar-imagen {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.avatar-emoji {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.avatar-cambiar {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: rgba(114, 214, 255, 0.9);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.nombre-input {
    flex: 1;
}

/* Modal de Avatar */
.modal-avatar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: rgba(11, 13, 27, 0.95);
    border: 2px solid rgba(114, 214, 255, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(114, 214, 255, 0.2);
}

.modal-header h3 {
    color: #72d6ff;
    font-size: 1.3rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.avatar-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(114, 214, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #72d6ff;
    transform: translateY(-3px);
}

.avatar-option-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.avatar-option span {
    color: white;
    font-size: 0.9rem;
}

.avatar-seccion {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.btn-subir-foto {
    background: linear-gradient(135deg, #72d6ff, #ff7fff);
    color: #0b0d1b;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.btn-subir-foto:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(114, 214, 255, 0.4);
}

.info-avatar {
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 15px;
}

.preview-area {
    text-align: center;
    margin-top: 15px;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-confirmar {
    background: rgba(127, 255, 127, 0.9);
    color: #0b0d1b;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-confirmar:hover {
    background: rgba(127, 255, 127, 1);
    transform: scale(1.05);
}

.emojis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.emojis-grid span {
    font-size: 2rem;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.emojis-grid span:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
}

/* Indicador de respuesta mejorado */
#indicador-respuesta {
    background: linear-gradient(135deg, #72d6ff, #7fff7f);
    color: #000;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    animation: slideDown 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.indicador-respuesta-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.respuesta-info {
    flex: 1;
}

.respuesta-titulo {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 14px;
}

.respuesta-mensaje {
    font-style: italic;
    opacity: 0.8;
    font-size: 13px;
    line-height: 1.3;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 5px;
    border-left: 3px solid rgba(0, 0, 0, 0.3);
}

.btn-cancelar-respuesta {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #000;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.btn-cancelar-respuesta:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

/* Botón de responder */
.btn-responder {
    background: rgba(114, 214, 255, 0.2);
    border: 1px solid rgba(114, 214, 255, 0.5);
    color: #72d6ff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 10px;
    transition: all 0.2s ease;
}

.btn-responder:hover {
    background: rgba(114, 214, 255, 0.3);
    transform: translateY(-1px);
}

/* Animaciones */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para mensajes seleccionados */
.mensaje-item.seleccionado {
    border-left: 4px solid #72d6ff;
    background: rgba(114, 214, 255, 0.05);
    margin-left: -4px;
}

/* ========================================
   RESPONSIVE MÓVIL - MEJORADO
   ======================================== */

/* Prevenir zoom accidental en iOS */
@media (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }

    /* Contenedor principal */
    .foro-container {
        margin: 10px auto;
        padding: 0 8px;
        min-height: auto;
    }

    /* Título */
    .foro-title {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .foro-subtitle {
        font-size: 0.95rem;
    }

    /* Estadísticas en dos filas */
    .foro-stats {
        gap: 20px;
        padding: 12px;
        margin: 15px 0 20px;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .stat-item {
        gap: 3px;
    }

    .stat-number {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    /* Búsqueda */
    .search-input {
        padding: 10px 35px 10px 12px;
        font-size: 16px;
        border-radius: 20px;
    }

    .search-icon {
        right: 12px;
    }

    /* Contenedor de mensajes */
    .mensajes-container {
        padding: 10px;
        max-height: 45vh;
        margin-bottom: 15px;
        overflow-y: auto;
    }

    /* Items de mensajes */
    .mensaje-item {
        gap: 8px;
        padding: 10px;
        margin: 8px 0;
        border-radius: 10px;
    }

    /* Avatar pequeño */
    .avatar {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    /* Header del mensaje en columna */
    .mensaje-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        margin-bottom: 5px;
    }

    .mensaje-nombre {
        font-size: 0.95em;
    }

    .mensaje-fecha {
        font-size: 0.7em;
        width: 100%;
    }

    .badge-editado {
        font-size: 0.65em;
        padding: 1px 6px;
    }

    .mensaje-texto {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 8px;
    }

    /* Reacciones más compactas */
    .mensaje-acciones {
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 6px;
    }

    .reaccion-badge {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .btn-responder {
        font-size: 11px;
        padding: 3px 6px;
        margin-right: 6px;
    }

    .btn-reaccion {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    /* Formulario - CAMBIO PRINCIPAL */
    .formulario-integrado {
        padding: 12px;
        margin: 15px 0;
        border-radius: 15px;
    }

    .form-header {
        font-size: 1rem;
        margin-bottom: 12px;
    }

    .form-header::before {
        font-size: 1.1em;
    }

    /* Flexbox ajustado para móvil */
    .form-container {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .input-column {
        gap: 10px;
        width: 100%;
    }

    .input-wrapper {
        width: 100%;
        position: relative;
        margin-bottom: 8px;
    }

    /* Inputs ocupan todo el ancho */
    .foro-input,
    .foro-textarea {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        border-radius: 10px;
        box-sizing: border-box;
    }

    .foro-textarea {
        min-height: 80px;
        font-size: 15px;
        resize: vertical;
        max-height: 150px;
    }

    /* Botón en ancho completo */
    .btn-foro {
        width: 100%;
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 0.95rem;
        height: auto;
        min-height: 48px;
        box-shadow: 0 4px 15px rgba(114, 214, 255, 0.3);
    }

    /* Contador en posición mejorada */
    .counter {
        position: absolute;
        bottom: -16px;
        right: 8px;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.5);
    }

    /* Avatar personalizado */
    .avatar-nombre-container {
        gap: 10px;
        margin-bottom: 10px;
    }

    .avatar-iniciales,
    .avatar-imagen,
    .avatar-emoji {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }

    .nombre-input {
        font-size: 15px;
    }

    /* Indicador de respuesta */
    #indicador-respuesta {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 8px;
    }

    .indicador-respuesta-content {
        flex-direction: column;
        gap: 8px;
    }

    .respuesta-titulo {
        font-size: 12px;
    }

    .respuesta-mensaje {
        font-size: 12px;
        padding: 6px;
    }

    .btn-cancelar-respuesta {
        padding: 6px 10px;
        font-size: 11px;
        align-self: flex-end;
    }

    /* Modal mejorado */
    .modal-content {
        width: 95%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: 15px;
        padding: 0;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 15px;
        overflow-y: auto;
        max-height: 70vh;
    }

    .avatar-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .avatar-option {
        padding: 12px;
        border-radius: 10px;
    }

    .avatar-option-icon {
        font-size: 2rem;
    }

    .emojis-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 8px;
    }

    .emojis-grid span {
        font-size: 1.5rem;
        padding: 8px;
    }

    .btn-subir-foto {
        padding: 11px 15px;
        font-size: 0.9rem;
    }

    .image-preview {
        max-width: 180px;
        max-height: 180px;
    }

    /* Menú de reacciones */
    .reacciones-menu {
        gap: 6px;
        padding: 8px;
        margin-top: -40px;
        border-radius: 20px;
    }

    .reacciones-menu button {
        font-size: 1.3rem;
        padding: 6px;
    }

    /* Controles de música */
    .music-controls {
        bottom: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 14px;
    }

    .music-toggle {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .volume-control {
        width: 45px;
        height: 3px;
    }

    .music-info {
        max-width: 60px;
        font-size: 9px;
    }

    .volume-handle {
        width: 10px;
        height: 10px;
    }
}

/* Breakpoint para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .foro-container {
        max-width: 750px;
    }

    .foro-title {
        font-size: 2.2rem;
    }

    .foro-stats {
        gap: 25px;
    }

    .form-container {
        gap: 15px;
    }

    .btn-foro {
        padding: 14px 28px;
    }
}