/* ============================================
   SISTEMA DE COMUNIDAD - CSS PROFESIONAL RESPONSIVO
   Autor: MiniMax Agent
   Sin modo oscuro - Optimizado para móviles
   ✅ USUARIOS SUGERIDOS ARREGLADO
   ============================================ */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --primary-light: #e8edfc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 50%;
    --transition: all 0.2s ease;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ============================================
   RESET Y BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   LAYOUT PRINCIPAL - CONTENEDOR COMUNIDAD
   ============================================ */
.comunidad-container {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR IZQUIERDO
   ============================================ */
.comunidad-sidebar-left {
    position: sticky;
    top: 16px;
    height: fit-content;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

/* Perfil del usuario en sidebar */
.sidebar-user-profile {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.user-profile-link:hover {
    opacity: 0.85;
}

.user-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.user-info h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.user-info small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Navegación sidebar */
.sidebar-nav {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 8px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.nav-item-comunidad {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item-comunidad i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.nav-item-comunidad:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-item-comunidad.active {
    background: var(--primary-color);
    color: var(--white);
}

.notification-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--danger-color);
    color: var(--white);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Filtros sidebar */
.sidebar-filters {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
}

.filter-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-left: 4px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
}

.filter-item i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.filter-item:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.filter-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */
.comunidad-main-content {
    min-width: 0;
}

/* Box crear publicación */
.crear-publicacion-box {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.user-avatar-small img,
.user-avatar-small .avatar-img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.avatar-placeholder-small {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.btn-crear-publicacion {
    flex: 1;
    background: var(--light-bg);
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    text-align: left;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-crear-publicacion:hover {
    background: #eef1f4;
}

/* Controles del feed */
.feed-controls {
    margin-bottom: 14px;
}

.feed-controls .btn-group {
    display: flex;
    gap: 6px;
}

.feed-controls .btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.feed-controls .btn i {
    font-size: 11px;
}

.feed-controls .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.feed-controls .btn-outline-primary {
    background: var(--white);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.feed-controls .btn-outline-primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   TARJETAS DE PUBLICACIÓN
   ============================================ */
.publicaciones-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.publicacion-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
}

.publicacion-card:hover {
    box-shadow: var(--shadow-md);
}

/* Header de publicación */
.publicacion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.publicacion-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.publicacion-autor {
    display: flex;
    flex-direction: column;
}

.publicacion-autor a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.publicacion-autor a:hover {
    color: var(--primary-color);
}

.publicacion-fecha {
    font-size: 11px;
    color: var(--text-muted);
}

/* Menú dropdown */
.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-toggle:hover {
    background: var(--light-bg);
    color: var(--text-secondary);
}

.dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    min-width: 160px;
    padding: 6px;
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.dropdown-menu button:hover,
.dropdown-menu a:hover {
    background: var(--light-bg);
}

.dropdown-menu button.text-danger:hover,
.dropdown-menu a.text-danger:hover {
    background: #fee2e2;
    color: var(--danger-color);
}

/* Contenido de publicación */
.publicacion-content {
    padding: 12px 14px;
}

.publicacion-texto {
    position: relative;
}

.publicacion-texto p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    word-wrap: break-word;
}

/* Sistema Ver más / Ver menos */
.texto-truncado {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.texto-expandido {
    display: block;
    overflow: visible;
}

.btn-ver-mas {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 0;
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ver-mas:hover {
    color: var(--primary-hover);
}

.btn-ver-mas i {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.btn-ver-mas.expandido i {
    transform: rotate(180deg);
}

/* Media de publicación */
.publicacion-media {
    position: relative;
    background: var(--light-bg);
    max-height: 500px;
    overflow: hidden;
    cursor: pointer;
}

.publicacion-media img,
.publicacion-media .post-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    transition: var(--transition);
}

.publicacion-media video {
    width: 100%;
    max-height: 500px;
    display: block;
}

/* Image overlay */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.publicacion-media:hover .image-overlay {
    background: rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.btn-expand {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    color: var(--primary-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    pointer-events: all;
}

.btn-expand:hover {
    background: var(--white);
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

/* Estadísticas de publicación */
.publicacion-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.stat-item.clickable {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px 0;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.stat-item.clickable:hover {
    background: var(--light-bg);
}

.stat-item i {
    font-size: 12px;
}

.stat-item i.fa-heart.text-danger {
    color: var(--danger-color);
}

.stat-item i.fa-comment.text-primary {
    color: var(--primary-color);
}

.stat-item i.fa-share.text-success {
    color: var(--success-color);
}

/* Acciones de publicación */
.publicacion-actions {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
    gap: 4px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.action-btn i {
    font-size: 14px;
}

.action-btn:hover {
    background: var(--light-bg);
}

.action-btn.btn-like:hover,
.action-btn.btn-like.active {
    color: var(--danger-color);
    background: #fee2e2;
}

.action-btn.btn-comment:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

.action-btn.btn-share:hover {
    color: var(--success-color);
    background: #d4edda;
}

/* ============================================
   PUBLICACIÓN COMPARTIDA
   ============================================ */
.compartido-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 10px;
    font-weight: 500;
    border-radius: 12px;
    margin-left: 8px;
}

.badge-compartido {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--success-color);
    color: var(--white);
    font-size: 10px;
    font-weight: 500;
    border-radius: 12px;
    margin-left: 6px;
}

.badge-compartido i {
    font-size: 9px;
}

.shared-content-wrapper {
    margin: 0 14px 10px 14px;
}

.shared-content-card {
    margin: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--white);
    transition: var(--transition);
    transform: translateY(0);
}

.shared-content-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.shared-content-card.original-eliminada {
    background: #f8f9fa;
    border: 2px dashed var(--border-color);
    opacity: 0.7;
}

.shared-content-card.original-eliminada:hover {
    border-color: var(--warning-color);
}

.shared-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--light-bg);
    border-bottom: 1px solid var(--border-color);
}

.shared-header .user-avatar-small {
    width: 32px;
    height: 32px;
}

.shared-header .user-info-header {
    flex: 1;
    min-width: 0;
}

.shared-header .user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-header .username {
    font-size: 11px;
    color: var(--text-muted);
}

.shared-text {
    padding: 10px 12px;
}

.shared-text p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.shared-text-content {
    padding: 12px;
    background: var(--white);
}

.shared-text-content p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
    word-wrap: break-word;
}

.shared-text-content .texto-truncado {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shared-text-content .texto-expandido {
    display: block;
    overflow: visible;
}

.shared-media {
    max-height: 400px;
    overflow: hidden;
}

.shared-media img,
.shared-media video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.shared-footer {
    padding: 10px 12px;
    background: var(--light-bg);
    border-top: 1px solid var(--border-color);
}

.shared-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shared-author-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    position: relative;
}

.shared-author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.avatar-placeholder-tiny {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
}

.shared-author-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.shared-author-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-author-username {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-deleted {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: var(--warning-color);
    color: #856404;
    font-size: 9px;
    font-weight: 500;
    border-radius: 10px;
    margin-top: 2px;
}

.badge-deleted i {
    font-size: 8px;
}

/* ============================================
   HEADER PRINCIPAL (USER INFO)
   ============================================ */
.user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.user-link:hover .user-name {
    color: var(--primary-color);
}

.user-info-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.user-meta .username {
    color: var(--text-muted);
}

.user-meta .separator {
    color: var(--border-color);
}

.user-meta .time {
    color: var(--text-muted);
}

/* Botón de opciones */
.btn-options {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-options:hover {
    background: var(--light-bg);
    color: var(--text-secondary);
}

.btn-options i {
    font-size: 16px;
}

/* ============================================
   SIDEBAR DERECHO
   ============================================ */
.comunidad-sidebar-right {
    position: sticky;
    top: 16px;
    height: fit-content;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.widget-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* ============================================
   📌 USUARIOS SUGERIDOS - ARREGLADO ✅
   ============================================ */
.usuario-sugerido {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.usuario-sugerido:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* ✅ Link del usuario */
.usuario-sugerido > a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
}

.usuario-sugerido > a:hover .user-name {
    color: var(--primary-color);
}

/* Avatar */
.usuario-sugerido .user-avatar-small {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.usuario-sugerido .user-avatar-small img {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
}

.usuario-sugerido .avatar-placeholder-small {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* ✅ Info del usuario */
.usuario-sugerido .user-info-sugerido {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.usuario-sugerido .user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.usuario-sugerido .user-meta {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ✅ BOTÓN SEGUIR - ARREGLADO */
.usuario-sugerido .btn-seguir {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
    border: none;
    background: var(--primary-color);
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.usuario-sugerido .btn-seguir:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Estado "Siguiendo" */
.usuario-sugerido .btn-outline-primary {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.usuario-sugerido .btn-outline-primary:hover {
    background: var(--primary-light);
}

/* Tendencias */
.trending-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.trending-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trending-tag {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.trending-item small {
    font-size: 10px;
}

/* ============================================
   ESTADO VACÍO
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state .btn {
    font-size: 13px;
}

/* ============================================
   COMENTARIOS EMPTY STATE
   ============================================ */
.comentarios-empty {
    text-align: center;
    padding: 40px 20px;
}

.comentarios-empty i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.comentarios-empty h5 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.comentarios-empty p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.page-item .page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* ============================================
   MODALES
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
}

.modal-body {
    padding: 16px 18px;
}

.modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
}

/* Formulario crear/editar publicación */
.upload-section {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--light-bg);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.upload-btn input[type="file"] {
    display: none;
}

/* Preview de archivos */
#filePreviewSection,
#filePreviewSectionEditar {
    margin-top: 12px;
    position: relative;
}

#imagePreview,
#videoPreview,
#imagePreviewEditar,
#videoPreviewEditar {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--light-bg);
}

#imagePreview img,
#imagePreviewEditar img {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
}

#videoPreview video,
#videoPreviewEditar video {
    width: 100%;
    max-height: 200px;
}

.remove-preview-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: var(--radius-full);
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition);
}

.remove-preview-btn:hover {
    background: var(--danger-color);
}

/* Current media section (editar) */
.current-media-section {
    margin-top: 12px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.current-media-section h6 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

#imagenActual,
#videoActual {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

#btnEliminarMedia {
    width: 100%;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#btnEliminarMedia:hover {
    background: #c82333;
}

/* Textarea en modales */
.modal-body textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.modal-body textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   MODAL NOTIFICACIONES
   ============================================ */
#modalNotificacionesComunidad .modal-dialog {
    max-width: 440px;
}

#notificaciones-lista-modal {
    max-height: 360px;
    overflow-y: auto;
}

.notificacion-item {
    display: flex;
    align-items: flex-start;
    padding: 10px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.notificacion-item:hover {
    background: var(--light-bg);
}

.notificacion-item.no-leida {
    background: var(--primary-light);
}

.notificacion-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.notificacion-text strong {
    font-weight: 600;
}

.notificacion-fecha {
    font-size: 10px;
}

.notificacion-preview {
    flex-shrink: 0;
    margin-left: 10px;
}

.notificacion-preview .preview-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.notificacion-preview .preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 16px;
}

.notificaciones-empty {
    text-align: center;
    padding: 30px 20px;
}

.notificaciones-empty i {
    font-size: 36px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.notificaciones-empty h5 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.notificaciones-empty p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================
   LOGIN PROMPT
   ============================================ */
.login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--light-bg);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
}

.login-prompt i {
    color: var(--text-muted);
}

.login-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.login-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================
   BOTONES GENERALES
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 14px;
}

/* ============================================
   UTILIDADES
   ============================================ */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.flex-grow-1 { flex-grow: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.ms-3 { margin-left: 12px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }
.py-5 { padding-top: 32px; padding-bottom: 32px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.fw-bold { font-weight: 600; }
.small { font-size: 12px; }

/* Spinner */
.spinner-border {
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-light);
    border-right-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spinner 0.75s linear infinite;
}

.spinner-border-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ============================================
   TOOLTIPS CUSTOM
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    margin-bottom: 4px;
    z-index: 1000;
}

/* ============================================
   SEPARADORES VISUALES
   ============================================ */
.separator-line {
    height: 1px;
    background: var(--border-color);
    margin: 12px 0;
}

.separator-dot {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    display: inline-block;
    margin: 0 6px;
    vertical-align: middle;
}

/* ============================================
   RESPONSIVO - TABLET (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .comunidad-container {
        grid-template-columns: 180px 1fr 200px;
        gap: 14px;
        padding: 12px;
    }

    .nav-item-comunidad {
        padding: 8px 10px;
        font-size: 12px;
    }

    .nav-item-comunidad i {
        font-size: 13px;
    }

    .widget-card {
        padding: 12px;
    }

    .publicacion-media {
        max-height: 450px;
    }

    .publicacion-media img {
        max-height: 450px;
    }

    .shared-media {
        max-height: 350px;
    }
    
    .shared-media img,
    .shared-media video {
        max-height: 350px;
    }
}

/* ============================================
   RESPONSIVO - TABLET PEQUEÑA (768px)
   ============================================ */
@media (max-width: 900px) {
    .comunidad-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }

    .comunidad-sidebar-left,
    .comunidad-sidebar-right {
        position: static;
        max-height: none;
    }

    .comunidad-sidebar-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .sidebar-user-profile {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .sidebar-nav {
        margin-bottom: 0;
    }

    .comunidad-sidebar-right {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .widget-card {
        margin-bottom: 0;
    }

    .shared-content-wrapper {
        margin: 0 12px 8px 12px;
    }

    .shared-header {
        padding: 8px 10px;
    }

    .shared-text-content {
        padding: 10px;
    }

    .shared-footer {
        padding: 8px 10px;
    }

    .shared-author-avatar {
        width: 26px;
        height: 26px;
    }

    .shared-author-name {
        font-size: 11px;
    }

    .shared-author-username {
        font-size: 9px;
    }
}

/* ============================================
   RESPONSIVO - MÓVIL (640px)
   ============================================ */
@media (max-width: 640px) {
    body {
        font-size: 13px;
    }

    .comunidad-container {
        padding: 8px;
        gap: 10px;
    }

    .comunidad-sidebar-left {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .sidebar-user-profile {
        padding: 10px;
    }

    .user-avatar {
        width: 34px;
        height: 34px;
    }

    .avatar-placeholder {
        font-size: 14px;
    }

    .user-info h6 {
        font-size: 12px;
    }

    .user-info small {
        font-size: 10px;
    }

    .sidebar-nav {
        padding: 6px;
    }

    .nav-item-comunidad {
        padding: 8px 10px;
        font-size: 12px;
    }

    .nav-item-comunidad i {
        width: 16px;
        font-size: 12px;
    }

    .notification-badge {
        font-size: 9px;
        padding: 1px 5px;
    }

    .sidebar-filters {
        padding: 10px;
    }

    .filter-title {
        font-size: 10px;
    }

    .filter-item {
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Contenido principal móvil */
    .crear-publicacion-box {
        padding: 10px;
    }

    .user-avatar-small {
        width: 32px;
        height: 32px;
    }

    .avatar-placeholder-small {
        font-size: 12px;
    }

    .btn-crear-publicacion {
        padding: 8px 12px;
        font-size: 12px;
    }

    .feed-controls .btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .publicaciones-feed {
        gap: 10px;
    }

    /* Cards móvil */
    .publicacion-card {
        border-radius: var(--radius-sm);
    }

    .publicacion-header {
        padding: 10px 12px;
    }

    .publicacion-autor a {
        font-size: 12px;
    }

    .publicacion-fecha {
        font-size: 10px;
    }

    .publicacion-content {
        padding: 10px 12px;
    }

    .publicacion-texto p {
        font-size: 12px;
    }

    .btn-ver-mas {
        font-size: 11px;
    }

    .publicacion-media {
        max-height: 350px;
    }

    .publicacion-media img {
        max-height: 350px;
    }

    .publicacion-stats {
        padding: 6px 12px;
        gap: 12px;
    }

    .stat-item {
        font-size: 11px;
    }

    .publicacion-actions {
        padding: 6px 8px;
    }

    .action-btn {
        padding: 6px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .action-btn i {
        font-size: 13px;
    }

    .action-btn .action-text {
        display: inline-block;
        font-size: 10px;
    }

    /* Compartido móvil */
    .compartido-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .shared-content-card {
        margin: 8px 10px;
    }

    .shared-content-wrapper {
        margin: 0 10px 6px 10px;
    }

    .shared-header {
        padding: 6px 8px;
        gap: 8px;
    }

    .shared-header .user-avatar-small {
        width: 28px;
        height: 28px;
    }

    .shared-header .user-name {
        font-size: 11px;
    }

    .shared-header .username {
        font-size: 10px;
    }

    .shared-text {
        padding: 8px 10px;
    }

    .shared-text p {
        font-size: 11px;
    }

    .shared-text-content {
        padding: 8px;
    }

    .shared-text-content p {
        font-size: 12px;
    }

    .shared-media {
        max-height: 280px;
    }

    .shared-media img,
    .shared-media video {
        max-height: 280px;
    }

    .shared-footer {
        padding: 6px 8px;
    }

    .shared-author-avatar {
        width: 24px;
        height: 24px;
    }

    .avatar-placeholder-tiny {
        font-size: 10px;
    }

    .shared-author-name {
        font-size: 10px;
    }

    .shared-author-username {
        font-size: 9px;
    }

    .badge-deleted {
        font-size: 8px;
        padding: 1px 4px;
    }

    .user-info-header {
        gap: 1px;
    }

    .user-name {
        font-size: 12px;
    }

    .user-meta {
        font-size: 10px;
        gap: 3px;
    }

    .btn-options {
        width: 28px;
        height: 28px;
    }

    .btn-options i {
        font-size: 14px;
    }

    .btn-expand {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    /* Sidebar derecho móvil */
    .comunidad-sidebar-right {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .widget-card {
        padding: 10px;
    }

    .widget-title {
        font-size: 11px;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .usuario-sugerido {
        padding: 8px 0;
        gap: 8px;
    }

    .usuario-sugerido .user-avatar-small {
        width: 36px;
        height: 36px;
    }
    
    .usuario-sugerido .avatar-placeholder-small {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    
    .usuario-sugerido .user-name {
        font-size: 12px;
    }
    
    .usuario-sugerido .user-meta {
        font-size: 10px;
    }
    
    .usuario-sugerido .btn-seguir {
        padding: 5px 14px;
        font-size: 11px;
    }

    .trending-item {
        padding: 6px 0;
    }

    .trending-tag {
        font-size: 11px;
    }

    /* Estado vacío móvil */
    .empty-state {
        padding: 30px 16px;
    }

    .empty-state i {
        font-size: 40px;
    }

    .empty-state h4 {
        font-size: 14px;
    }

    .empty-state p {
        font-size: 12px;
    }

    /* Paginación móvil */
    .pagination-container {
        margin-top: 14px;
    }

    .page-item .page-link {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* Modales móvil */
    .modal-dialog {
        margin: 8px;
    }

    .modal-content {
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal-title {
        font-size: 14px;
    }

    .modal-body {
        padding: 12px 14px;
    }

    .modal-body textarea {
        min-height: 60px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .modal-footer {
        padding: 10px 14px;
    }

    .upload-section {
        flex-wrap: wrap;
    }

    .upload-btn {
        flex: 1;
        min-width: 100px;
        padding: 6px 10px;
        font-size: 11px;
    }

    #imagePreview img,
    #imagePreviewEditar img {
        max-height: 150px;
    }

    #videoPreview video,
    #videoPreviewEditar video {
        max-height: 150px;
    }

    .current-media-section {
        padding: 10px;
    }

    #imagenActual,
    #videoActual {
        max-height: 150px;
    }

    .login-prompt {
        padding: 10px;
        font-size: 12px;
    }

    /* Modal notificaciones móvil */
    #modalNotificacionesComunidad .modal-dialog {
        max-width: none;
    }

    #notificaciones-lista-modal {
        max-height: 280px;
    }

    .notificacion-item {
        padding: 8px;
    }

    .notificacion-text {
        font-size: 11px;
    }

    .notificacion-fecha {
        font-size: 9px;
    }

    .notificacion-preview .preview-img {
        width: 34px;
        height: 34px;
    }

    .notificacion-preview .preview-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .notificaciones-empty {
        padding: 24px 16px;
    }

    .notificaciones-empty i {
        font-size: 30px;
    }

    .notificaciones-empty h5 {
        font-size: 13px;
    }

    .notificaciones-empty p {
        font-size: 11px;
    }

    /* Botones móvil */
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* Utilidades móvil */
    .gap-2 { gap: 6px; }
    .gap-3 { gap: 10px; }
    .ms-3 { margin-left: 10px; }
}

/* ============================================
   RESPONSIVO - MÓVIL PEQUEÑO (480px)
   ============================================ */
@media (max-width: 480px) {
    .comunidad-container {
        padding: 6px;
        gap: 8px;
    }

    .sidebar-user-profile {
        padding: 8px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }

    .user-info h6 {
        font-size: 11px;
    }

    .sidebar-nav {
        padding: 4px;
    }

    .nav-item-comunidad {
        padding: 6px 8px;
        font-size: 11px;
        gap: 8px;
    }

    .crear-publicacion-box {
        padding: 8px;
        gap: 8px;
    }

    .user-avatar-small {
        width: 28px;
        height: 28px;
    }

    .btn-crear-publicacion {
        padding: 6px 10px;
        font-size: 11px;
    }

    .feed-controls .btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .publicacion-header {
        padding: 8px 10px;
    }

    .publicacion-content {
        padding: 8px 10px;
    }

    .publicacion-texto p {
        font-size: 11px;
    }

    .publicacion-media {
        max-height: 250px;
    }

    .publicacion-media img {
        max-height: 250px;
    }

    .publicacion-stats {
        padding: 5px 10px;
        gap: 10px;
    }

    .stat-item {
        font-size: 10px;
    }

    .publicacion-actions {
        padding: 5px 6px;
    }

    .action-btn {
        padding: 5px 6px;
        font-size: 10px;
        gap: 3px;
    }

    .action-btn i {
        font-size: 12px;
    }

    .action-btn .action-text {
        display: inline-block;
        font-size: 9px;
    }

    .shared-content-card {
        margin: 6px 8px;
    }

    .shared-content-wrapper {
        margin: 0 8px 6px 8px;
    }

    .shared-header {
        padding: 6px;
        gap: 6px;
    }

    .shared-header .user-avatar-small {
        width: 26px;
        height: 26px;
    }

    .shared-header .user-name {
        font-size: 10px;
    }

    .shared-header .username {
        font-size: 9px;
    }

    .shared-text {
        padding: 6px 8px;
    }

    .shared-text p {
        font-size: 10px;
    }

    .shared-text-content {
        padding: 6px 8px;
    }

    .shared-text-content p {
        font-size: 11px;
    }

    .shared-media {
        max-height: 240px;
    }

    .shared-media img,
    .shared-media video {
        max-height: 240px;
    }

    .shared-footer {
        padding: 6px;
    }

    .shared-author-avatar {
        width: 22px;
        height: 22px;
    }

    .avatar-placeholder-tiny {
        font-size: 9px;
    }

    .shared-author-name {
        font-size: 9px;
    }

    .shared-author-username {
        font-size: 8px;
    }

    .user-name {
        font-size: 11px;
    }

    .user-meta {
        font-size: 9px;
    }

    .btn-options {
        width: 26px;
        height: 26px;
    }

    .btn-options i {
        font-size: 13px;
    }

    .btn-expand {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .widget-card {
        padding: 8px;
    }

    .widget-title {
        font-size: 10px;
    }

    .usuario-sugerido .user-avatar-small,
    .usuario-sugerido .avatar-placeholder-small {
        width: 32px;
        height: 32px;
    }
    
    .usuario-sugerido .avatar-placeholder-small {
        font-size: 12px;
    }
    
    .usuario-sugerido .user-name {
        font-size: 11px;
    }
    
    .usuario-sugerido .btn-seguir {
        padding: 4px 12px;
        font-size: 10px;
    }

    .trending-tag {
        font-size: 10px;
    }

    .modal-header {
        padding: 10px 12px;
    }

    .modal-title {
        font-size: 13px;
    }

    .modal-body {
        padding: 10px 12px;
    }

    .modal-body textarea {
        min-height: 50px;
        font-size: 11px;
    }

    .current-media-section {
        padding: 8px;
    }

    #imagenActual,
    #videoActual {
        max-height: 120px;
    }

    #btnEliminarMedia {
        padding: 5px 10px;
        font-size: 11px;
    }

    .login-prompt {
        padding: 8px;
        font-size: 11px;
    }

    .badge-compartido {
        font-size: 9px;
        padding: 2px 6px;
    }

    #notificaciones-lista-modal {
        max-height: 220px;
    }

    .notificacion-text {
        font-size: 10px;
    }

    .notificacion-preview .preview-img,
    .notificacion-preview .preview-icon {
        width: 30px;
        height: 30px;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.2); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.publicacion-card {
    animation: fadeIn 0.3s ease;
}

.publicacion-compartida {
    animation: fadeInUp 0.3s ease;
}

.loading-skeleton {
    background: linear-gradient(90deg, 
        var(--light-bg) 25%, 
        #e9ecef 50%, 
        var(--light-bg) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

/* ============================================
   SCROLLBAR PERSONALIZADO
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--light-bg);
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para accesibilidad */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.shared-content-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-options:focus-visible,
.btn-expand:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .comunidad-sidebar-left,
    .comunidad-sidebar-right,
    .publicacion-actions,
    .feed-controls,
    .crear-publicacion-box {
        display: none !important;
    }

    .comunidad-container {
        display: block;
    }

    .publicacion-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 16px;
    }
}