/* Variables para temas consistentes - ACTUALIZADO con colores azules */
.sidebar {
  --primary-bg: #181818;
  --primary-text: #ffffff;
  --secondary-text: #b3b3b3;
  --accent-color: #006aff; /* CAMBIADO: de #006aff a #006aff azul */
  --accent-light: #0080ff; /* CAMBIADO: colores de acento */
  --accent-bright: #339aff; /* CAMBIADO: colores de acento */
  --accent-dark: #0052cc; /* CAMBIADO: colores de acento */
  --hover-bg: #080808;
  --hover-bgg: #080808;
  --active-indicator: #1ED760;
  --transition-normal: all 0.3s ease;
  --transition-bounce: all 0.3s ease; /* MODIFICADO: eliminado el cubic-bezier por un simple ease */
  --border-light: rgba(255, 255, 255, 0.1);
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.5);
  --sidebar-width: 240px;
  --header-height: 70px;
  --accent-gradient: linear-gradient(135deg, var(--accent-color), var(--accent-bright)); /* AÑADIDO: gradiente de azul */
  --glow-accent: 0 0 15px rgba(0, 106, 255, 0.4); /* AÑADIDO: brillo azul */
}
/* Base Layout Styles */
.mainContent {
  z-index: 10;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 2rem;
  transition: var(--transition-normal);
}

/* Desktop Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  color: var(--primary-text);
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--border-light);
  transition: var(--transition-bounce);
  padding: 0;
  background-color: var(--primary-bg); /* AÑADIDO: color de fondo explícito */
}

/* Logo Area */
.logo {
  padding: 1.5rem;
  width: 100%;
  align-items: center;
}

.logoContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
  width: 100%;
  margin-bottom: 5px;
}

.logoContainer img{
  width: 80%;
  height: auto;
}

.logoContainer:hover {
  transform: scale(1.05);
}

/* Navigation Styles */
.navigation {
  flex: 1;
  width: 100%;
}

.navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Mejora para cada elemento li: espaciado y línea superior */
.navigation li {
  position: relative;
  width: 100%;
  padding-bottom: 0.4rem;
  border-top: none !important; /* Forzar eliminación de cualquier borde */
}

/* Quitar borde del primer elemento */
.navigation li:first-child {
  border-top: none;
}

.navLink {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  margin: 0 0.5rem;
  color: var(--secondary-text);
  text-decoration: none;
  transition: var(--transition-normal);
  border-radius: 0.5rem;
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: calc(100% - 1rem);
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
}

.navLink:hover {
  color: var(--primary-text);
  background-color: var(--hover-bg);
}

.navLink.active {
  color: var(--primary-text);
  background-color: var(--hover-bgg);
  font-weight: 500;
}

.activeIndicator {
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.25rem;
  height: 1.5rem;
  background-color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
  border-radius: 0.125rem;
  opacity: 0;
  transition: var(--transition-normal);
}

.navLink.active .activeIndicator {
  opacity: 1;
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.25rem;
  color: currentColor;
  transition: var(--transition-normal);
  width: 1.5rem;
}

.text {
  font-size: 0.95rem;
  font-weight: 400;
  transition: var(--transition-normal);
  white-space: nowrap;
  color: var(--primary-text); /* Color por defecto en modo oscuro (blanco) */
}

/* Botón de configuración mejorado */
.settingsContainer {
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  margin-bottom: 1rem;
  position: relative;
}

.settingsContainer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-light), transparent);
}

.settingsIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background-color: var(--primary-bg);
  color: var(--primary-text);
  border-radius: 50%;
  transition: var(--transition-bounce);
  font-size: 1.35rem;
}

.settingsIcon:hover {
  background-color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
  transform: rotate(30deg) scale(1.1);
  box-shadow: 0 0 20px rgba(0, 106, 255, 0.6); /* CAMBIADO: color de la sombra */
}

/* Mobile Header Styles */
.mobileHeader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  color: var(--primary-text);
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  z-index: 98;
  border-bottom: 1px solid var(--border-light);
}

.menuButton, 
.searchButton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--hover-bg);
  border: none;
  border-radius: 50%;
  color: var(--primary-text);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.menuButton:hover, 
.searchButton:hover {
  background-color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
}

.mobileLogo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-text);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.25rem;
  position: relative;
  width: 30px;
  height: 30px;
}

.mobileLogo span {
  margin-left: 0.5rem;
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
  .sidebar {
    --sidebar-width: 80%;
    --header-height: 60px;
    left: 0;
    transform: translateX(-100%);
    width: var(--sidebar-width);
    max-width: 320px;
    z-index: 99;
    box-shadow: var(--shadow-dark);
    overflow-y: auto;
  }
  
  .mainContent {
    margin-left: 0;
    margin-top: var(--header-height);
    padding: 1rem;
  }
  
  .mobileHeader {
    display: flex;
  }
  
  .sidebarOpen {
    transform: translateX(0);
  }
  
  .sidebarClosed {
    transform: translateX(-100%);
  }
  
  .logo {
    padding: 1.25rem;
    margin-bottom: 0;
  }
  
  .navigation li {
    margin-bottom: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
  
  .navLink {
    padding: 0.875rem 1.25rem;
  }
  
  .icon {
    margin-right: 0.875rem;
  }
  
  .text {
    font-size: 0.9rem;
  }
  
  .settingsContainer {
    margin-top: auto;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
  }
  
  .settingsIcon {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
    background-color: var(--primary-bg);
  }
}

@media screen and (max-width: 576px) {
  .sidebar {
    --header-height: 56px;
    width: 85%;
  }
  
  .menuButton, 
  .searchButton {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .mobileLogo {
    font-size: 1.125rem;
  }
  
  .settingsIcon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }
}

/* Active states */
.navLink:active .icon {
  color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
  text-shadow: 0 0 10px rgba(0, 106, 255, 0.8), 0 0 20px rgba(0, 106, 255, 0.4); /* CAMBIADO: color del resplandor */
}

.navLink:active {
  transform: scale(0.95);
}

/* Tema claro para el sidebar */
/* Variables para el tema claro */
:global(.light-theme) .sidebar {
  --primary-bg: #f5f5f7;
  --primary-text: #1a1a1a;
  --secondary-text: #555555;
  --accent-color: #0066ee; /* CAMBIADO: ahora usa azul para tema claro */
  --accent-light: #0080ff; /* CAMBIADO: variantes de color azul */
  --accent-bright: #339aff; /* CAMBIADO: variantes de color azul */
  --accent-dark: #0052cc; /* CAMBIADO: variantes de color azul */
  --hover-bg: #e8e8f0;
  --active-indicator: #1DB954;
  --border-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.1);
  --glow-accent: 0 0 15px rgba(0, 106, 255, 0.2); /* CAMBIADO: brillo azul para tema claro */
}
/* Base Layout Styles */
:global(.light-theme) .sidebar {
  background-color: var(--primary-bg);
  border-right: 1px solid var(--border-light);
}
/* Navigation Styles */
:global(.light-theme) .navigation li {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
:global(.light-theme) .navLink {
  color: var(--secondary-text);
}
:global(.light-theme) .navLink:hover {
  color: var(--primary-text);
  background-color: var(--hover-bg);
}
:global(.light-theme) .navLink.active {
  color: var(--primary-text);
  background-color: var(--hover-bg);
}
/* Botón de configuración */
:global(.light-theme) .settingsContainer::before {
  background: linear-gradient(to right, transparent, var(--border-light), transparent);
}
:global(.light-theme) .settingsIcon {
  background-color: var(--primary-bg);
  color: var(--primary-text);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
:global(.light-theme) .settingsIcon:hover {
  background-color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
  color: white;
  box-shadow: 0 0 20px rgba(0, 102, 238, 0.4); /* CAMBIADO: color del brillo */
}
/* Mobile Header Styles */
:global(.light-theme) .mobileHeader {
  background-color: var(--primary-bg);
  color: var(--primary-text);
  border-bottom: 1px solid var(--border-light);
}
:global(.light-theme) .menuButton, 
:global(.light-theme) .searchButton {
  background: var(--hover-bg);
  color: var(--primary-text);
}
:global(.light-theme) .menuButton:hover, 
:global(.light-theme) .searchButton:hover {
  background-color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
  color: white;
}
:global(.light-theme) .mobileLogo {
  color: var(--primary-text);
}

/* Active states */
:global(.light-theme) .navLink:active .icon {
  color: var(--accent-color); /* CAMBIADO: ahora usa el color azul */
  text-shadow: 0 0 10px rgba(0, 102, 238, 0.5), 0 0 20px rgba(0, 102, 238, 0.3); /* CAMBIADO: color del resplandor */
}

/* Estilos para manejar los logos según el tema */

/* En tema oscuro (por defecto): mostrar logo claro, ocultar logo oscuro */
.logoOscuro {
  display: block;
}

.logoClaro {
  display: none;
}

/* En tema claro: mostrar logo oscuro, ocultar logo claro */
:global(.light-theme) .logoOscuro {
  display: none;
}

:global(.light-theme) .logoClaro {
  display: block;
}

.adContainer {
  position: relative;
  margin: 0 auto;
  max-width: 160px;
  height: auto;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.anuncioScript {
  max-width: 100%;
  height: auto;
  overflow: hidden;
  margin: 0 auto;
}

.anuncioEnlace {
  display: block;
  text-decoration: none;
  color: inherit;
  max-width: 100%;
  max-height: 180px; /* Limitar la altura del enlace */
  overflow: hidden;
}

.anuncioVacio {
  font-size: 0.8rem;
  color: var(--secondary-text);
  text-align: center;
  padding: 10px;
}

/* Añadimos backdrop para el menú móvil */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 97;
  animation: fadeIn 0.3s ease;
}

/* Estilos para el botón de cierre móvil */
.closeButtonContainer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem;
}

.closeButton {
  background: none;
  border: none;
  color: var(--primary-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.closeButton:hover {
  background-color: var(--accent-color);
  color: white;
  transform: rotate(90deg);
}