:root {
  --primary: #0066cc;
  --secondary: #004a99;
  --light: #f5f9ff;
  --dark: #222;
  --text: #333;
  --accent: #ffcc00;
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Muli', sans-serif;
  color: var(--text);
  background: var(--light);
}

a {
  text-decoration: none;
  color: inherit;
}

/* SIDEBAR */
#sideNav {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  color: #fff;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  transition: width .3s ease;
}

#sideNav:hover {
  width: 260px;
}

/* PERFIL */
.sidebar-header {
  text-align: center;
}

.img-profile {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  transition: transform .3s ease;
}

.img-profile:hover {
  transform: scale(1.05);
}

#sideNav h4 {
  margin: .5rem 0 .2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

#sideNav p {
  font-size: .9rem;
  font-weight: 300;
  line-height: 1.2;
}

/* BANDERAS */
.lang-switch {
  display: flex;
  gap: .5rem;
  margin: 1rem 0;
}

.lang-switch .flag {
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .3s ease;
}

.lang-switch .flag.active {
  opacity: 1;
}

/* BOTÓN HAMBURGUESA (solo móvil) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 1rem;
}

/* NAVEGACIÓN */
ul.nav {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

ul.nav li {
  margin: .5rem 0;
}

ul.nav a {
  display: block;
  padding: .6rem 1rem;
  border-radius: 4px;
  transition: background .3s ease, padding-left .3s ease;
  font-weight: 500;
}

ul.nav a:hover,
ul.nav a.active {
  background: var(--accent);
  color: var(--dark);
  padding-left: 1.4rem;
}

/* MAIN CONTENT */
#mainContent {
  margin-left: 260px;
  padding: 2rem;
  transition: margin-left .3s ease;
}

section {
  background: #fff;
  margin-bottom: 2rem;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

section h2 {
  position: relative;
  padding-bottom: .5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--primary);
}

section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

section h4 {
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--secondary);
}

ul.list-unstyled {
  padding: 0;
  list-style: none;
}

ul.list-unstyled li {
  margin-bottom: .5rem;
  position: relative;
  padding-left: 1.2rem;
}

ul.list-unstyled li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

p,
li {
  line-height: 1.6;
  font-size: .95rem;
}

/* CURRICULUM */

.cv-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--light);
  border: 1px solid rgba(0, 0, 0, .06);
  padding: 1rem 1.25rem;
  border-radius: 8px;
}

.cv-card i {
  font-size: 1.75rem;
  color: var(--primary);
}

.btn-cv {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 6px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.btn-cv:hover {
  background: var(--secondary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.cv-note {
  margin-left: auto;
  color: #666;
  font-size: .85rem;
}

/* FOOTER */
footer {
  text-align: center;
  font-size: .85rem;
  color: #777;
  margin-top: 4rem;
}

/* Hover para enlaces de contenido (sin afectar .nav-link ni .btn-cv) */
a {
  transition: color .2s ease, text-underline-offset .2s ease;
  text-underline-offset: 2px;
}

a:hover:not(.nav-link):not(.btn-cv) {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Accesibilidad: visible al tabular */
a:focus-visible {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}


/* RESPONSIVE: móviles */
@media (max-width:768px) {
  #sideNav {
    position: relative;
    width: 100%;
    height: auto;
    padding: 1rem;
    flex-direction: column;
    align-items: center;
  }

  #sideNav:hover {
    width: 100%;
  }

  .img-profile {
    width: 80px;
    height: 80px;
  }

  /* mostrar hamburguesa */
  .menu-toggle {
    display: block;
  }

  /* ocultar menú hasta abrir */
  ul.nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin: 0;
  }

  /* abrir menú */
  #sideNav.open ul.nav {
    display: flex;
  }

  /* main content */
  #mainContent {
    margin-left: 0;
    padding: 1rem;
  }

  section {
    padding: 1.5rem;
  }

  .cv-card {
    flex-direction: row;
    align-items: center;
  }

  .cv-note {
    margin-left: 0;
  }
}