:root {
  --bg: #0b1020;
  --card: #121a36;
  --text: #e8ecff;
  --muted: #a5b2ff;
  --accent: #6aa9ff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial,
    sans-serif;
  background: linear-gradient(180deg, #0b1020, #0f1630 40%, #0b1020);
  color: var(--text);
  line-height: 1.6;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.header {
  position: sticky;
  top: 0;
  background: rgba(11, 16, 32, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 10;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: radial-gradient(100% 100% at 50% 0%, #6aa9ff 0%, #3c75ff 100%);
  box-shadow: 0 8px 24px rgba(58, 118, 255, 0.35);
}
h1 {
  font-size: 18px;
  margin: 0;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  background: #1a2756;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn:hover {
  background: #22306a;
  transform: translateY(-1px);
}
.download-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}
.download-btn:hover {
  background: linear-gradient(135deg, #218838, #1ea085);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}
.search {
  margin: 16px 0;
  display: flex;
  gap: 10px;
}
.search input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c1330;
  color: var(--text);
  outline: none;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.meta {
  opacity: 0.75;
  font-size: 13px;
  margin-top: 6px;
}
.note {
  max-width: 900px;
  margin: 24px auto;
  padding: 0 20px;
}
.note h1,
h2,
h3,
h4 {
  scroll-margin-top: 90px;
}
pre,
code {
  background: #0c1330;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  overflow: auto;
}
.footer {
  opacity: 0.75;
  font-size: 14px;
  margin: 28px 0;
}
.hidden {
  display: none;
}

/* Responsive para botón de descarga */
@media (max-width: 768px) {
  .search {
    flex-direction: column;
    gap: 8px;
  }

  .search input {
    order: 1;
  }

  .search #count {
    order: 2;
    align-self: flex-start;
  }

  .download-btn {
    order: 3;
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .download-btn {
    font-size: 13px;
    padding: 10px 14px;
  }
}

/* Estilos del Menú Desplegable Original */
:root {
  --israel-blue: #0038b8;
  --israel-white: #ffffff;
  --israel-gold: #ffd700;
  --israel-dark-blue: #001f5c;
  --israel-darker-blue: #000033;
  --israel-light-blue: #1e4a8c;
  --israel-very-dark: #000011;

  /* Light Mode Colors */
  --menu-bg-color: linear-gradient(
    135deg,
    var(--israel-blue) 0%,
    var(--israel-dark-blue) 100%
  );
  --menu-hover-color: rgba(255, 215, 0, 0.2);
  --line-color: rgba(255, 255, 255, 0.3);
  --text-color: var(--israel-white);
  --header-bg-color: rgba(255, 255, 255, 0.1);
  --button-bg-color: linear-gradient(
    135deg,
    var(--israel-blue) 0%,
    var(--israel-dark-blue) 100%
  );
  --button-hover-color: linear-gradient(
    135deg,
    var(--israel-gold) 0%,
    #ffed4e 100%
  );
  --shadow-color: rgba(0, 56, 184, 0.3);
  --shadow-hover-color: rgba(0, 56, 184, 0.4);
  --scroll-button-bg: var(--israel-blue);
  --scroll-button-color: var(--israel-white);
}

body.light-mode {
  --menu-bg-color: linear-gradient(
    135deg,
    var(--israel-blue) 0%,
    var(--israel-dark-blue) 100%
  );
  --text-color: var(--israel-white);
  --header-bg-color: rgba(255, 255, 255, 0.1);
  --button-bg-color: linear-gradient(
    135deg,
    var(--israel-blue) 0%,
    var(--israel-dark-blue) 100%
  );
  --button-hover-color: linear-gradient(
    135deg,
    var(--israel-gold) 0%,
    #ffed4e 100%
  );
  --shadow-color: rgba(0, 56, 184, 0.3);
  --shadow-hover-color: rgba(0, 56, 184, 0.4);
  --scroll-button-bg: var(--israel-blue);
  --scroll-button-color: var(--israel-white);
}

body.dark-mode {
  --menu-bg-color: linear-gradient(
    135deg,
    var(--israel-very-dark) 0%,
    var(--israel-darker-blue) 100%
  );
  --text-color: var(--israel-white);
  --header-bg-color: rgba(255, 255, 255, 0.05);
  --button-bg-color: linear-gradient(
    135deg,
    var(--israel-darker-blue) 0%,
    var(--israel-very-dark) 100%
  );
  --button-hover-color: linear-gradient(
    135deg,
    var(--israel-light-blue) 0%,
    var(--israel-blue) 100%
  );
  --shadow-color: rgba(0, 0, 0, 0.5);
  --shadow-hover-color: rgba(0, 0, 0, 0.7);
  --scroll-button-bg: var(--israel-darker-blue);
  --scroll-button-color: var(--israel-white);
}

.menu-container {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1000;
}

.menu-button {
  background: var(--button-bg-color);
  color: var(--israel-white);
  border: none;
  padding: 12px 18px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.menu-button:hover {
  background: var(--button-hover-color);
  color: var(--israel-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover-color);
}

.dropdown-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 75%;
  height: 100%;
  background: var(--menu-bg-color);
  z-index: 999;
  overflow-y: auto;
  padding: 20px;
  display: none !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.8s ease;
  visibility: hidden;
  opacity: 0;
}

.dropdown-menu.active {
  right: 0 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dropdown-menu .header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-menu .header .profile-img {
  max-width: 120px;
  width: 120px;
  height: 120px;
  object-fit: cover;
  margin: 0 auto 15px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: block;
}

.dropdown-menu .header a {
  display: block;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}

.dropdown-menu .header a:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.dropdown-menu .header a:hover .profile-img {
  box-shadow: 0 4px 16px rgba(0, 56, 184, 0.4);
  border: 2px solid var(--israel-gold);
}

.dropdown-menu .header .title {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  color: var(--israel-white);
}

.elegant-title {
  font-family: "Great Vibes", cursive;
  font-size: 38px;
  font-weight: 400;
  font-style: normal;
  text-align: center;
  color: var(--israel-white);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.3);
  letter-spacing: 2px;
  line-height: 1.2;
  margin: 15px 0;
  transform: rotate(-1deg);
  animation: elegantWhiteGlow 4s ease-in-out infinite alternate;
}

@keyframes elegantWhiteGlow {
  0% {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5),
      0 0 15px rgba(255, 255, 255, 0.3), 0 0 25px rgba(255, 255, 255, 0.1);
  }
  100% {
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.7),
      0 0 25px rgba(255, 255, 255, 0.6), 0 0 40px rgba(255, 255, 255, 0.3);
  }
}

.elegant-subtitle {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  font-weight: 400;
  font-style: normal;
  text-align: center;
  color: var(--israel-white);
  line-height: 1.5;
  margin: 8px 0 20px 0;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
  transform: none;
}

.theme-toggle {
  margin-top: 10px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.close-button {
  background: rgba(255, 255, 255, 0.2);
  color: var(--israel-white);
  border: none;
  padding: 10px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 50%;
  align-self: flex-end;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.close-button:hover {
  background-color: #e74c3c;
  color: white;
}

.dropdown-menu a {
  color: var(--text-color);
  padding: 12px 20px;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-size: 18px;
  width: 100%;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-menu a:hover {
  background-color: var(--menu-hover-color);
}

.dropdown-menu a img {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  object-fit: contain;
}

.dropdown-menu a + a {
  border-top: 2px solid var(--line-color);
}

.scroll-up-button {
  background-color: var(--scroll-button-bg);
  color: var(--scroll-button-color);
  border: none;
  padding: 10px 15px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  display: none;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.scroll-up-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover-color);
}

.scroll-up-button i {
  font-size: 20px;
}

.scroll-up-button.show {
  display: block;
}

/* Mejoras para el modo oscuro */
body.dark-mode .dropdown-menu {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

body.dark-mode .header {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-mode .elegant-title {
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.2);
}

body.dark-mode .elegant-subtitle {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

body.dark-mode .dropdown-menu a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .dropdown-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Animación suave para el cambio de tema */
* {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Asegurar que el menú esté oculto por defecto */
.menu-container .dropdown-menu:not(.active) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  right: -100% !important;
}

/* Indicador visual del tema activo */
.theme-toggle {
  position: relative;
  overflow: hidden;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.theme-toggle:hover::before {
  left: 100%;
}
