/* ======================================================
   PALETA DE COLORES — AZUL CALMA Y QUIETUD
   Diseñada para transmitir serenidad y profesionalismo.
   
   --azul-profundo:   #1a3a5c  (navy profundo)
   --azul-principal:  #2c6faa  (azul medio, color principal)
   --azul-calma:      #3d8fd4  (cerúleo, hover/accent)
   --azul-suave:      #6bb3e0  (cielo suave)
   --azul-claro:      #b8daf0  (fondo tenue)
   --azul-hielo:      #e8f4fb  (fondo ultra ligero)
   --gris-texto:      #2c3e50  (texto principal)
   --blanco-calido:   #fafcfe  (fondo blanco)
   ====================================================== */

/* === TIPOGRAFÍA GLOBAL === */
body {
  font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  color: #2c3e50;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.title {
  font-family: 'Outfit', 'Inter', sans-serif !important;
  color: #1a3a5c;
}

/* === ACCESIBILIDAD: Skip Navigation === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2c6faa;
  color: #fff;
  padding: 12px 24px;
  z-index: 100000;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
  color: #fff;
  outline: 3px solid #6bb3e0;
  outline-offset: 2px;
}

/* === SR-ONLY para accesibilidad === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === FOCUS VISIBLE para accesibilidad === */
*:focus-visible {
  outline: 3px solid #3d8fd4;
  outline-offset: 2px;
}

/* === COLOR PRIMARIO (Green → Blue) === */
.bg-primary {
  background-color: #2c6faa !important;
}

.text-primary {
  color: #2c6faa !important;
}

/* === BOTONES === */
.btn-primary {
  background-color: #2c6faa !important;
  border-color: #2c6faa !important;
  color: #fff !important;
  border-radius: 30px;
  padding: 10px 28px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(44, 111, 170, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #3d8fd4 !important;
  border-color: #3d8fd4 !important;
  box-shadow: 0 6px 22px rgba(44, 111, 170, 0.35);
  transform: translateY(-2px);
}

.btn-primary:active {
  background-color: #1a3a5c !important;
  border-color: #1a3a5c !important;
  transform: translateY(0);
}

/* === BOTÓN DEFAULT (Social icons) === */
.btn-default {
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #fff !important;
  transition: all 0.3s ease;
}

.btn-default:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: #fff !important;
  transform: translateY(-3px);
}

/* === NAVBAR === */
.navbar-transparent {
  background-color: transparent !important;
  border: none;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.navbar.bg-primary:not(.navbar-transparent) {
  background-color: rgba(26, 58, 92, 0.95) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(26, 58, 92, 0.15);
}

.navbar-brand {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.3rem !important;
  letter-spacing: 0.5px;
}

.nav-link {
  font-family: 'Inter', sans-serif !important;
  font-weight: 500 !important;
  letter-spacing: 0.3px;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.nav-link:hover {
  opacity: 0.85;
}

/* === PAGE HEADER (Hero) === */
.page-header[filter-color="blue"]:after {
  background: rgba(26, 58, 92, 0.55);
  content: "";
  display: block;
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1;
}

.page-header-image {
  background-size: cover;
  background-position: center center;
}

.page-header .container {
  z-index: 2;
}

.content-center .h2.title,
.content-center .title {
  color: #fff !important;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.content-center .category {
  font-weight: 300;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
}

/* === PROFILE IMAGE — Pulse azul (Halo effect) === */
@keyframes pulsate {
  0% {
    transform: scale(1.0);
    opacity: 0.0;
  }

  50% {
    opacity: 1.0;
  }

  100% {
    transform: scale(1.3);
    opacity: 0.0;
  }
}

.cc-profile-image a {
  display: inline-block;
  position: relative;
}

.cc-profile-image a:before {
  content: "" !important;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 10px solid rgba(44, 111, 170, 0.6) !important;
  border-radius: 50% !important;
  animation: pulsate 2s ease-out infinite !important;
  z-index: 9998 !important;
  /* Behinds img (9999) */
  box-sizing: border-box;
}

.cc-profile-image img {
  position: relative !important;
  z-index: 9999 !important;
  border: 5px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 30px rgba(26, 58, 92, 0.3);
  object-fit: cover;
}

.cc-profile-image a:hover img {
  box-shadow: 0 12px 40px rgba(26, 58, 92, 0.45);
}

/* === CARDS === */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(26, 58, 92, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 35px rgba(26, 58, 92, 0.12);
}

.card-body .title {
  color: #1a3a5c !important;
  font-weight: 600;
  position: relative;
  padding-bottom: 12px;
}

.card-body .title:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #2c6faa, #6bb3e0);
  border-radius: 2px;
}

.text-center .title:after,
.text-center.title:after {
  left: 50%;
  transform: translateX(-50%);
}

/* === SECCIÓN GENERAL === */
.section {
  padding: 30px 0;
}

/* Offset top para las secciones en desktop cuando tienen la class navegada */
section[id] {
  scroll-margin-top: 80px;
}

.section .title.mb-4 {
  margin-bottom: 1rem !important;
}

#sobre-mi .card {
  background: linear-gradient(135deg, #fafcfe 0%, #e8f4fb 100%);
}

/* === BARRAS DE PROGRESO (Habilidades) === */
.progress-container.progress-primary .progress {
  background: rgba(44, 111, 170, 0.15) !important;
  border-radius: 10px;
  height: 8px !important;
}

.progress-container.progress-primary .progress-bar {
  background: linear-gradient(90deg, #2c6faa, #3d8fd4) !important;
  border-radius: 10px;
}

.progress-container.progress-primary .progress-value,
.progress-container.progress-primary .progress-badge {
  color: #1a3a5c !important;
  font-weight: 600;
}

.progress-container {
  margin-bottom: 25px !important;
}

.progress-container .progress-badge {
  font-size: 15px !important;
}

/* === TARJETAS DE TECNOLOGÍA === */
.tech-card {
  background: linear-gradient(135deg, #e8f4fb 0%, #fafcfe 100%);
  border-radius: 16px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(44, 111, 170, 0.08);
}

.tech-card .card-body {
  padding: 18px 15px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tech-card i.fa-2x {
  font-size: 2.4rem !important;
  margin-bottom: 14px !important;
}

.tech-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(44, 111, 170, 0.15);
  border-color: rgba(44, 111, 170, 0.2);
}

.tech-card i {
  color: #2c6faa;
  transition: color 0.3s ease, transform 0.3s ease;
}

.tech-card:hover i {
  color: #3d8fd4;
  transform: scale(1.1);
}

.tech-card .h6,
.tech-card h3 {
  color: #1a3a5c;
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 0.85rem;
}

.tech-card .small {
  font-size: 0.78rem;
  margin-bottom: 0;
}

/* === EXPERIENCIA === */
.cc-experience {
  padding-top: 0;
}

.cc-experience .bg-primary {
  background: linear-gradient(135deg, #1a3a5c, #2c6faa) !important;
  border-radius: 16px 0 0 16px;
  display: flex;
  align-items: stretch;
}

.cc-experience .card .row {
  align-items: stretch;
}

.cc-experience .cc-experience-header {
  padding: 25px 15px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.cc-experience .cc-experience-header p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.cc-experience .card-body.cc-experience-header .h5 {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0;
}

.cc-experience .card {
  margin-bottom: 16px;
  border-radius: 16px;
}

.cc-experience .card-body .h5 {
  color: #1a3a5c;
  font-weight: 600;
  margin-bottom: 6px;
}

.cc-experience .col-md-9>.card-body {
  padding: 20px 25px !important;
}

/* Lista de experiencia */
.experience-list {
  list-style: none;
  padding-left: 0;
  margin: 12px 0;
}

.experience-list li {
  padding: 5px 0 5px 22px;
  position: relative;
  color: #4a5568;
  font-size: 14px;
  line-height: 1.6;
}

.experience-list li:before {
  content: '▸';
  position: absolute;
  left: 0;
  color: #2c6faa;
  font-weight: bold;
}

/* Tags de tecnologia */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tech-tags .badge {
  background: linear-gradient(135deg, #e8f4fb, #d0e8f5);
  color: #1a3a5c;
  font-weight: 500;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(44, 111, 170, 0.15);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tech-tags .badge .tech-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.tech-tags .badge:hover {
  background: linear-gradient(135deg, #2c6faa, #3d8fd4);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(44, 111, 170, 0.25);
}

/* === EDUCACIÓN === */
.cc-education .bg-primary {
  background: linear-gradient(135deg, #1a3a5c, #2c6faa) !important;
  border-radius: 16px 0 0 16px;
  display: flex;
  align-items: stretch;
}

.cc-education .card .row {
  align-items: stretch;
}

.cc-education .cc-education-header {
  padding: 25px 15px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.cc-education .cc-education-header p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  margin-bottom: 5px;
  font-weight: 500;
}

.cc-education .card-body.cc-education-header .h5 {
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 0;
}

.cc-education .category {
  color: #6bb3e0 !important;
  font-weight: 500;
}

/* === PROYECTOS === */
.project-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(44, 111, 170, 0.06);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card .card-body {
  padding: 20px 18px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(44, 111, 170, 0.15);
}

.project-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8f4fb, #b8daf0);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.project-card:hover .project-icon {
  background: linear-gradient(135deg, #2c6faa, #3d8fd4);
}

.project-icon i {
  color: #2c6faa;
  transition: color 0.3s ease;
  font-size: 1.6em !important;
}

.project-card:hover .project-icon i {
  color: #fff;
}

.project-card .h5,
.project-card h3 {
  color: #1a3a5c;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.project-card .text-muted {
  margin-bottom: 8px;
}

.project-card ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
  width: 100%;
}

.project-card ul li {
  padding: 3px 0 3px 16px;
  position: relative;
  color: #4a5568;
  line-height: 1.45;
  font-size: 0.85rem;
}

.project-card ul li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: #2c6faa;
  font-weight: bold;
}

/* === CERTIFICACIONES === */
.cert-card {
  background: #fff;
  border: 1px solid rgba(44, 111, 170, 0.06);
  border-radius: 16px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cert-card .card-body {
  padding: 20px 15px !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cert-card i.fa-3x {
  font-size: 2em !important;
}

.cert-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(44, 111, 170, 0.15);
}

.cert-icon {
  color: #2c6faa !important;
  transition: transform 0.3s ease;
}

.cert-card:hover .cert-icon {
  transform: scale(1.1);
  color: #3d8fd4 !important;
}

.cert-card .h5,
.cert-card h3 {
  color: #1a3a5c;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.cert-card .text-muted {
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.cert-card .small {
  font-size: 0.8rem;
  margin-bottom: 0;
}

/* === HABILIDADES PROFESIONALES === */
.soft-skills-list {
  list-style: none;
  padding-left: 0;
}

.soft-skills-list li {
  padding: 8px 0;
  color: #2c3e50;
  font-size: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.soft-skills-list li i {
  color: #2c6faa;
  margin-top: 3px;
  flex-shrink: 0;
}

/* === CONTACTO === */
.cc-contact-information {
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.cc-contact-information .map-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  border: none;
  pointer-events: none;
  filter: saturate(0.7) brightness(1.05);
}

.cc-contact-information .container {
  position: relative;
  z-index: 2;
}

.cc-contact-information .card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(26, 58, 92, 0.15);
}

.cc-contact-information .card .title {
  color: #1a3a5c !important;
}

.cc-contact .card-body a {
  color: #2c6faa;
  text-decoration: none;
  transition: color 0.3s ease;
}

.cc-contact .card-body a:hover {
  color: #3d8fd4;
}

.form-control {
  border: 1px solid #b8daf0;
  border-radius: 8px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: 'Inter', sans-serif;
  color: #2c3e50;
}

.form-control::placeholder {
  color: #a0aec0;
  opacity: 1;
}

.form-control:focus {
  border-color: #2c6faa;
  box-shadow: 0 0 0 3px rgba(44, 111, 170, 0.15);
  outline: none;
}

/* Override para el textarea */
textarea.form-control {
  border: 1px solid #b8daf0 !important;
  border-radius: 8px !important;
  padding: 12px 16px !important;
  resize: vertical;
  background-color: transparent;
}

textarea.form-control:focus {
  border-color: #2c6faa !important;
}

.input-group-addon {
  background: #e8f4fb;
  border: 1px solid #b8daf0;
  border-right: none;
  color: #2c6faa;
  border-radius: 8px 0 0 8px;
  padding: 10px 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === FOOTER === */
.footer {
  background: linear-gradient(180deg, #fafcfe, #e8f4fb);
  padding: 40px 0 20px;
}

.footer .btn-link {
  color: #2c6faa !important;
  transition: all 0.3s ease;
}

.footer .btn-link:hover {
  color: #3d8fd4 !important;
  transform: translateY(-3px);
}

.footer .title {
  color: #1a3a5c !important;
  font-weight: 700;
}

.footer .text-muted {
  color: #4a5568 !important;
}

/* === LINKS GLOBALES === */
a {
  color: #2c6faa;
  transition: color 0.3s ease;
}

a:hover {
  color: #3d8fd4;
  text-decoration: none;
}

/* === ANIMACIÓN SUTIL EN SECCIONES === */
.section .title {
  position: relative;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {

  .cc-experience .bg-primary,
  .cc-education .bg-primary {
    border-radius: 16px 16px 0 0;
  }

  .cc-experience .cc-experience-header,
  .cc-education .cc-education-header {
    padding: 20px !important;
  }

  .content-center .h2.title {
    font-size: 1.6rem;
  }

  .content-center .category {
    font-size: 0.9rem;
  }

  .project-card,
  .tech-card,
  .cert-card {
    margin-bottom: 16px;
  }
}

@media (max-width: 576px) {
  .section {
    padding: 25px 0;
  }

  .card-body {
    padding: 20px 16px;
  }
}

/* === SCROLL SUAVE GLOBAL === */
html {
  scroll-behavior: smooth;
}

/* === SELECCIÓN DE TEXTO === */
::selection {
  background: rgba(44, 111, 170, 0.2);
  color: #1a3a5c;
}

::-moz-selection {
  background: rgba(44, 111, 170, 0.2);
  color: #1a3a5c;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #e8f4fb;
}

::-webkit-scrollbar-thumb {
  background: #b8daf0;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2c6faa;
}

/* === REDUCIR MOVIMIENTO (Accesibilidad) === */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === WEBP FALLBACK para navegadores sin soporte === */
/* Fallback para header background */
.page-header-image {
  background-image: url('images/header-bg.webp');
}

/* Usar @supports para detectar soporte WebP y usar PNG como fallback */
@supports not (background-image: url('images/header-bg.webp')) {
  .page-header-image {
    background-image: url('images/header-bg.png') !important;
  }
}

/* 
  Nota: El elemento <picture> en HTML ya maneja el fallback para imágenes de contenido.
  Para background-image CSS, los navegadores modernos soportan WebP.
  Safari < 14 usa PNG por defecto si WebP no está disponible.
*/