/* ================================
   ESTILOS NAVBAR MODERNO
   ================================ */

/* Header/Navbar Principal */
#navbar {
  background: linear-gradient(180deg, rgba(4, 13, 33, 0.95) 0%, rgba(4, 13, 33, 0.85) 100%);
  border-bottom: 2px solid rgba(0, 212, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.8s ease-out;
  position: relative;
  z-index: 999;
}

#navbar .container-fluid {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

#navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
}

/* Logo con animación mejorada */
.navbar-brand {
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.logo-container {
  position: relative;
}

.logo-circle {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #0d6efd 0%, #00d4ff 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  animation: pulse 2s ease-in-out infinite;
  position: relative;
}

.logo-circle::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: linear-gradient(135deg, #0d6efd 0%, #00d4ff 100%);
  border-radius: 50%;
  opacity: 0.2;
  animation: spin 3s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  }
  50% {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.logo-initial {
  position: relative;
  z-index: 2;
  font-size: 1.5rem;
  font-family: 'Syne', sans-serif;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  animation: slideInLeft 0.8s ease-out;
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #00d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-title {
  font-family: 'Poppins', sans-serif;
  font-size: 0.7rem;
  color: #00d4ff;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Navegación mejorada */
.navbar-nav {
  gap: 0.5rem;
}

/* Navbar nav desktop - sin ms-auto para dejar espacio a la derecha */
.navbar-nav-desktop {
  gap: 0.5rem;
  position: relative;
  flex-grow: 1;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-link-modern {
  position: relative;
  padding: 0.6rem 1.2rem !important;
  color: rgba(255, 255, 255, 0.8) !important;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 212, 255, 0.2), rgba(13, 110, 253, 0.2));
  transition: left 0.5s ease;
  z-index: -1;
}

.nav-link-modern:hover::before {
  left: 100%;
}

.nav-link-modern:hover {
  color: #00d4ff !important;
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.nav-link-modern.active {
  color: #fff !important;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(13, 110, 253, 0.2) 100%);
  box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.nav-text {
  display: inline-block;
  transition: all 0.3s ease;
}

.nav-indicator {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #0d6efd, #00d4ff);
  transition: width 0.3s ease;
  display: inline-block;
}

.nav-link-modern:hover .nav-indicator {
  width: 20px;
}

.nav-link-modern.active .nav-indicator {
  width: 20px;
}

/* Botón CV mejorado */
#cv-button {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  border: 2px solid #0d6efd !important;
  color: #fff !important;
  font-weight: 700;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

#cv-button::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;
}

#cv-button:hover::before {
  left: 100%;
}

#cv-button:hover {
  background: linear-gradient(135deg, #00d4ff 0%, #0d6efd 100%);
  border-color: #00d4ff !important;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

/* Botón CV en móvil - más pequeño */
.btn-cv-mobile {
  padding: 0.35rem 0.75rem !important;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-cv-mobile i {
  margin-right: 0.3rem !important;
}

.btn-cv-mobile span {
  display: inline;
}
}

/* Hamburger menu mejorado */
.navbar-toggler-modern {
  position: relative;
  width: 45px;
  height: 45px;
  background: rgba(0, 212, 255, 0.1);
  border-radius: 8px !important;
  transition: all 0.3s ease;
  padding: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler-modern:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.hamburger {
  width: 24px;
  height: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: #00d4ff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Navbar blur effect */
.navbar-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Animaciones de entrada */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive */
@media (max-width: 991px) {
  .nav-link-modern {
    padding: 0.8rem 1rem !important;
    margin-bottom: 0.5rem;
    border-radius: 8px;
  }

  .navbar-nav {
    margin-top: 1rem;
    gap: 0.3rem;
  }

  /* Ocultar CV desktop en móvil */
  #cv-button {
    display: none !important;
  }

  .collapse.navbar-collapse {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(0, 212, 255, 0.05) 100%);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(0, 212, 255, 0.1);
    backdrop-filter: blur(10px);
  }

  .brand-text {
    display: none;
  }

  /* Banderas centradas en móvil */
  .lang-switch-mobile {
    display: flex !important;
    gap: 12px;
    padding: 0.5rem 0;
  }
}

@media (max-width: 576px) {
  #navbar {
    padding: 1rem 1rem !important;
  }

  .logo-circle {
    width: 40px;
    height: 40px;
  }

  .logo-initial {
    font-size: 1.2rem;
  }

  .nav-link-modern {
    font-size: 0.9rem;
    padding: 0.7rem 1rem !important;
  }

  #cv-button {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem !important;
  }

  .nav-indicator {
    display: none;
  }
}

/* Estado scroll - navbar más compacto */
#navbar.scrolled {
  padding: 1rem 1rem !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Efecto de enfoque en section activa */
.nav-link-modern[data-section] {
  cursor: pointer;
}

.nav-link-modern[data-section].active {
  font-weight: 700;
}

/* Tooltip en hover para mobile */
@media (hover: none) {
  .nav-link-modern:active {
    background: rgba(0, 212, 255, 0.15);
    transform: scale(0.98);
  }
}

/* Botón de tema en navbar */
.theme-btn-navbar {
  border: 2px solid rgba(0, 212, 255, 0.4);
  color: #00d4ff;
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.theme-btn-navbar:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: #00d4ff;
  color: #00d4ff;
  transform: rotate(20deg);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.theme-btn-navbar:active {
  transform: rotate(20deg) scale(0.95);
}

.theme-btn-navbar i {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive navbar theme button */
@media (max-width: 768px) {
  .theme-btn-navbar {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
}
/* Botón X para cerrar menú en móviles */
.btn-close-mobile {
  background: transparent;
  border: none;
  color: #00d4ff;
  font-size: 1.8rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 8px;
}

.btn-close-mobile:hover {
  background: rgba(0, 212, 255, 0.2);
  color: #ffffff;
  transform: rotate(90deg);
}

.btn-close-mobile:active {
  transform: rotate(90deg) scale(0.95);
}

.btn-close-mobile i {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Language switch styles - DESKTOP */
.lang-switch-navbar {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  z-index: 1000;
  margin-left: 0;
  margin-right: auto;
}

/* Asegurar que se vea en desktop */
.d-lg-flex.lang-switch-navbar {
  display: flex !important;
  gap: 8px;
  align-items: center;
  margin-left: 0;
  margin-right: auto;
  position: relative;
  z-index: 1000;
}

.lang-switch {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-switch-mobile {
  width: 100%;
}

.btn-lang {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  padding: 0;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
}

.flag-icon {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.btn-lang:hover {
  transform: scale(1.1);
  border-color: rgba(0,212,255,0.3);
  box-shadow: 0 0 15px rgba(0,212,255,0.15);
}

.btn-lang:hover .flag-icon {
  transform: scale(1.05);
}

.btn-lang.lang-active {
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0,212,255,0.3), inset 0 0 10px rgba(0,212,255,0.1);
}

/* Nav item para banderas desktop */
.nav-item .lang-switch-navbar {
  padding: 0;
  margin: 0;
  gap: 0.5rem;
}

.nav-item .btn-lang {
  width: 40px;
  height: 40px;
  padding: 0.25rem;
}

.nav-item .flag-icon {
  width: 32px;
  height: 32px;
}

/* Asegurar que el nav-item con banderas se alinee bien */
.nav-item.d-lg-flex {
  padding: 0;
  margin: 0;
}

/* Div de banderas en navbar desktop - SUPER VISIBLE */
.d-lg-flex.lang-switch-navbar {
  display: flex !important;
  visibility: visible;
  opacity: 1;
  position: relative;
  z-index: 1050;
  padding: 0 !important;
  margin: 0 !important;
  margin-left: auto !important;
  height: auto;
  min-height: 44px;
  align-items: center;
  gap: 12px !important;
  order: 999;
  flex-shrink: 0;
}

/* Botones dentro del div de banderas desktop */
.d-lg-flex.lang-switch-navbar .btn-lang,
.d-lg-flex.lang-switch-navbar .theme-btn-navbar {
  visibility: visible;
  opacity: 1;
  display: flex !important;
  position: relative;
  z-index: 1051;
}

/* Tema claro - Botones de idioma */
body.light-theme .btn-lang {
  border-color: rgba(13, 110, 253, 0.2);
}

body.light-theme .btn-lang:hover {
  border-color: rgba(13, 110, 253, 0.4);
  box-shadow: 0 0 15px rgba(13, 110, 253, 0.15);
}

body.light-theme .btn-lang.lang-active {
  border-color: #0d6efd;
  box-shadow: 0 0 20px rgba(13, 110, 253, 0.3), inset 0 0 10px rgba(13, 110, 253, 0.1);
}

