html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* ===================================================
   NEWSLETTER FEED - SIDEBAR NAVIGATION
   =================================================== */

/* Layout principal del feed */
.feed-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* ===== SIDEBAR DE TEMAS ===== */
.temas-sidebar {
  position: sticky;
  top: 1rem;
  width: 240px;
  min-width: 240px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
  flex-shrink: 0;
}

/* Scrollbar personalizada para sidebar */
.temas-sidebar::-webkit-scrollbar {
  width: 6px;
}

.temas-sidebar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.temas-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.temas-sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Header del sidebar */
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
}

/* Links del sidebar */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0;
  border-radius: 8px;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sidebar-link:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-link.active {
  background: var(--color-primary, #667eea);
  color: white;
}

.sidebar-link.active:hover {
  background: var(--color-primary, #667eea);
  filter: brightness(1.1);
}

.sidebar-link.disabled {
  color: #cbd5e1;
  cursor: default;
  pointer-events: none;
}

.sidebar-link .link-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-link .link-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-link .link-count {
  font-size: 0.75rem;
  opacity: 0.8;
  flex-shrink: 0;
}

/* ===== CINTILLO DIVISOR DE TEMA ===== */
.tema-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--color-primary, #667eea), var(--color-secondary, #764ba2));
  color: white;
  border-radius: 10px;
  margin: 2rem 0 1.25rem 0;
  scroll-margin-top: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tema-divider:first-of-type {
  margin-top: 0;
}

.tema-divider .tema-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tema-divider .tema-nombre {
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
}

.tema-divider .tema-count {
  font-size: 0.875rem;
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

/* Mensaje de tema vacío */
.tema-empty {
  text-align: center;
  padding: 2rem;
  color: #94a3b8;
  background: white;
  border-radius: 8px;
  border: 2px dashed #e2e8f0;
  margin-bottom: 2rem;
}

.tema-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* ===== CONTENIDO DEL FEED ===== */
.feed-content {
  flex: 1;
  min-width: 0;
}

/* Grid de notas */
.notas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Lista de notas */
.notas-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ===== BOTÓN FLOTANTE MÓVIL ===== */
.mobile-nav-button {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 1000;
  background: var(--color-primary, #667eea);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.875rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  align-items: center;
  gap: 0.5rem;
}

.mobile-nav-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.mobile-nav-button.active {
  background: #ef4444;
}

.mobile-nav-button .nav-icon {
  font-size: 1rem;
}

.mobile-nav-button .nav-text {
  font-size: 0.85rem;
}

/* ===== OVERLAY PARA MÓVIL ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
}

/* ===== RESPONSIVE - TABLET Y MÓVIL ===== */
@media (max-width: 992px) {
  .feed-layout {
    flex-direction: column;
  }
  
  .temas-sidebar {
    position: fixed;
    top: 0;
    left: -3050px;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 1001;
    transition: left 0.3s ease;
    padding-top: 1.5rem;
  }
  
  .temas-sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  }
  
  .mobile-nav-button {
    display: flex;
  }
  
  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }
  
  .sidebar-overlay.visible {
    pointer-events: auto;
  }
  
  .notas-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }
  
  .tema-divider {
    padding: 0.875rem 1.25rem;
  }
  
  .tema-divider .tema-nombre {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .notas-grid {
    grid-template-columns: 1fr;
  }
  
  .tema-divider {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  
  .tema-divider .tema-nombre {
    flex: 0 0 100%;
    order: 2;
    margin-top: 0.5rem;
  }
  
  .tema-divider .tema-icon {
    order: 1;
  }
  
  .tema-divider .tema-count {
    order: 1;
    margin-left: auto;
  }
  
  .mobile-nav-button {
    bottom: 1rem;
    left: 1rem;
    padding: 0.75rem 1rem;
  }
  
  .newsletter-feed-section {
    padding: 1.5rem 0 !important;
  }
}

/* ===== ANIMACIONES ===== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tema-divider {
  animation: slideIn 0.3s ease-out;
}

/* Smooth scroll behavior para toda la página */
html {
  scroll-behavior: smooth;
}
