html {
  scroll-padding-top: 100px;
  scroll-behavior: smooth;
}

/* Variables de color según el tema */
[data-bs-theme="light"] {
  --text-main: #212529;
  --btn-outline: #212529;
  --btn-text: #212529;
  --btn-hover-bg: #212529;
  --btn-hover-text: #ffffff;
}

[data-bs-theme="dark"] {
  --text-main: #f8f9fa;
  --btn-outline: #f8f9fa;
  --btn-text: #f8f9fa;
  --btn-hover-bg: #f8f9fa;
  --btn-hover-text: #212529;
}

/* Botón de código personalizado */
.btn-outline-theme {
  color: var(--btn-text);
  border-color: var(--btn-outline);
  background-color: transparent;
  transition: all 0.3s ease;
}

.btn-outline-theme:hover {
  background-color: var(--btn-hover-bg);
  color: var(--btn-hover-text);
  border-color: var(--btn-outline);
}

/* Iconos de contacto y textos generales */
.theme-text,
#contact a,
#contact i,
.titulo {
  color: var(--text-main) !important;
  text-decoration: none;
  transition: color 0.3s ease;
}

/* Forzar que las tarjetas se adapten al tema de Bootstrap */
[data-bs-theme="light"] .card {
  background-color: #ffffff !important;
  border-color: #dee2e6 !important;
  color: #212529;
}

[data-bs-theme="light"] .card-text,
[data-bs-theme="light"] .card-title,
[data-bs-theme="light"] .text-light {
  color: #212529 !important;
}

[data-bs-theme="dark"] .card {
  background-color: #212529 !important;
  border-color: #495057 !important;
  color: #ffffff;
}

[data-bs-theme="light"] .navbar-toggler-icon {
  filter: invert(1); /* Convierte el ícono blanco en negro */
}

.titulo {
  font-size: 5.2rem;
  font-weight: 600;
  border-bottom: 1px solid #dee2e6;
  padding-bottom: .5rem;
  margin-bottom: .7rem;
}

.custom-nav {
  font-size: 1.4rem;
  font-weight: 500;
  background-color: var(--card-bg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1030;
  transition: background-color 0.3s ease;
  border-bottom: 1px solid var(--card-border);
}

.parrafo {
  font-size: 1.5rem;
  margin-bottom: 4rem;
}

.card {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: transform 0.3s ease;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   RESPONSIVE (MEDIA QUERIES)
   ========================================== */

/* Pantallas medianas (Tablets para abajo) */
@media (max-width: 768px) {
  .titulo {
    font-size: 3rem !important;
  }
  header h1.display-2 {
    font-size: 3.5rem !important;
  }
  .card {
    margin-bottom: 15px;
  }
  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
}

/* Pantallas muy pequeñas (Celulares) */
@media (max-width: 576px) {
  .titulo {
    font-size: 3.2rem !important; 
  }
  
  header h1.display-2 {
    font-size: 3.8rem !important;
    line-height: 1.1 !important;  
    margin-bottom: 0.5rem;
  }
  
  header .lead {
    font-size: 1.1rem;
  }

  /* Arreglo vital para el menú (Navbar) en celular */
  .custom-nav .lang-divider {
    border-right: none !important;
    padding-right: 0 !important;
  }

  .badge {
    font-size: 0.85rem !important;
  }
}

/* ==========================================
   CLASES UTILITARIAS Y DE COMPONENTES
   ========================================== */

/* Separador del selector de idiomas */
.lang-divider {
  border-color: var(--card-border) !important;
}

/* Ícono decorativo gigante en sección About */
.hero-icon-bg {
  font-size: 14rem !important; /* Agrandado de 10 a 14rem */
  opacity: 0.8;
}

/* Ancho máximo para las alertas de envío de correo */
.alert-contact {
  max-width: 600px;
}

/* Inputs y Textarea del formulario de contacto */
.custom-input {
  border-color: var(--card-border) !important;
}

/* Efecto focus para que los inputs no pierdan estilo al escribir */
.custom-input:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-color: var(--bs-primary) !important;
}

/* ==========================================
   AJUSTE PARA TÍTULOS DENTRO DE CARDS
   ========================================== */
.card .titulo {
  font-size: 3rem !important;
  word-wrap: break-word;        
  overflow-wrap: break-word;    
  white-space: normal;
  border-bottom: none; 
}

@media (max-width: 768px) {
  .card .titulo {
    font-size: 2.5rem !important;
  }
}

/* --- Efecto de Reemplazo: Texto por Logo (Caja estática) --- */

.tech-badge-animate {
  position: relative;
  cursor: pointer;
  overflow: hidden; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem !important; 
  user-select: none; 
}

.tech-name {
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tech-logo-animated {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 1.5rem; 
  width: auto;
  opacity: 0; 
  transform: translate(-50%, 100%) scale(0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tech-badge-animate:hover .tech-name {
  opacity: 0;
  transform: translateY(-100%) scale(0.5);
}

.tech-badge-animate:hover .tech-logo-animated {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1); 
}