/* ============================================================
   CV Interattivo — Estefanía Gadea Aliaga
   Tema: Azzurro Mare / Turchese
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --ocean-deep: #023E8A;
  --ocean-mid: #0077B6;
  --ocean-light: #0096C7;
  --turquoise: #00B4D8;
  --sky: #48CAE4;
  --sky-light: #90E0EF;
  --foam: #CAF0F8;
  --accent: #5EEAD4;
  --accent-deep: #14B8A6;
  --white: #FFFFFF;
  --text-dark: #1B2838;
  --text-on-dark: #F0F8FF;
  --card-bg: rgba(255, 255, 255, 0.12);
  --card-bg-solid: rgba(255, 255, 255, 0.95);
  --card-border: rgba(255, 255, 255, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 1rem;
  --radius-sm: 0.6rem;
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --nav-height: 60px;
  --wave-height: 100px;
  --transition: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-on-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Accessibilita: Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--text-dark);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 1rem;
}

/* --- Language Selector --- */
.lang-selector {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 110;
  display: flex;
  gap: 0.25rem;
  background: rgba(2, 62, 138, 0.75);
  backdrop-filter: blur(12px);
  padding: 0.3rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.flag-icon {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
}

.lang-btn {
  background: transparent;
  border: 2px solid transparent;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  border-radius: 2rem;
  transition: all 0.3s;
  opacity: 0.55;
  line-height: 1;
}

.lang-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.lang-btn--active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--accent);
}

/* --- Focus visibile WCAG --- */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================================
   SLIDES
   ============================================================ */
main {
  position: relative;
  width: 100%;
  height: 100%;
}

.slides-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(80px);
  pointer-events: none;
  transition: opacity var(--transition), transform var(--transition);
  padding: 1.5rem 1.5rem calc(var(--nav-height) + var(--wave-height) + 0.5rem);
  overflow: hidden;
}

.slide--active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  z-index: 2;
}

.slide--exit-left {
  opacity: 0;
  transform: translateX(-80px);
  z-index: 1;
}

.slide--exit-right {
  opacity: 0;
  transform: translateX(80px);
  z-index: 1;
}

/* Sfondi per ogni sezione */
#chi-sono    { background: linear-gradient(135deg, #023E8A 0%, #0077B6 50%, #0096C7 100%); }
#cosa-faccio { background: linear-gradient(135deg, #0077B6 0%, #00B4D8 100%); }
#studi       { background: linear-gradient(135deg, #0096C7 0%, #48CAE4 100%); }
#esperienze  { background: linear-gradient(135deg, #023E8A 0%, #0077B6 100%); }
#contatti    { background: linear-gradient(135deg, #014F86 0%, #0077B6 40%, #48CAE4 100%); }

/* Contenuto slide */
.slide__content {
  width: 100%;
  max-width: 900px;
  text-align: center;
}

.slide__content--hero {
  max-width: 1000px;
}

.slide__content--wide {
  max-width: 1100px;
}

/* ============================================================
   ANIMAZIONI IN-VIEW
   ============================================================ */
.anim-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide--active .anim-in {
  opacity: 1;
  transform: translateY(0);
}

.anim-delay-1 { transition-delay: 0.15s; }
.anim-delay-2 { transition-delay: 0.3s; }
.anim-delay-3 { transition-delay: 0.45s; }

/* ============================================================
   0. SOBRE MÍ — Hero
   ============================================================ */
.hero {
  display: flex;
  align-items: center;
  gap: 3rem;
  text-align: left;
}

.hero__photo-wrap {
  flex-shrink: 0;
}

.hero__photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent);
  box-shadow: 0 0 0 8px rgba(94, 234, 212, 0.2), var(--shadow);
  animation: float 4s ease-in-out infinite;
  background: linear-gradient(135deg, var(--turquoise), var(--ocean-mid));
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__initials {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero__name {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}

.hero__role {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.hero__bio {
  font-size: clamp(0.82rem, 1.4vw, 0.98rem);
  line-height: 1.65;
  opacity: 0.9;
  margin-bottom: 1.2rem;
  max-width: 52ch;
}

.hero__langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.lang-tag {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 0.4rem 0.9rem;
  border-radius: 2rem;
  font-size: 0.85rem;
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-tag small {
  opacity: 0.7;
  font-size: 0.75rem;
}

.slide__hint {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  opacity: 0.6;
  animation: pulseRight 2s ease-in-out infinite;
  text-align: center;
}

@keyframes pulseRight {
  0%, 100% { transform: translateX(0); opacity: 0.6; }
  50% { transform: translateX(8px); opacity: 1; }
}

/* ============================================================
   SECTION TITLE (comune a tutte le sezioni)
   ============================================================ */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.section-title i {
  margin-right: 0.5rem;
  color: var(--accent);
}

/* ============================================================
   1. HABILIDADES — Skills
   ============================================================ */
.skills-wrap {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
  padding-right: 0.2rem;
}

.skills-wrap::-webkit-scrollbar {
  width: 4px;
}

.skills-wrap::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.skill-category {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.2rem;
  backdrop-filter: blur(10px);
  text-align: left;
  transition: transform 0.3s, box-shadow 0.3s;
}

.skill-category:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-category h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.skill-category h3 i {
  color: var(--accent);
  margin-right: 0.4rem;
  width: 1.2em;
  text-align: center;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  background: rgba(94, 234, 212, 0.15);
  border: 1px solid rgba(94, 234, 212, 0.35);
  color: var(--white);
  padding: 0.3rem 0.7rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.3s, transform 0.3s;
}

.skill-tag:hover {
  background: var(--accent);
  color: var(--text-dark);
  transform: scale(1.08);
}

/* ============================================================
   2. FORMACIÓN — Education
   ============================================================ */
.edu-cards {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.edu-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.8rem 1.5rem;
  backdrop-filter: blur(10px);
  flex: 1;
  min-width: 260px;
  max-width: 500px;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}

.edu-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.edu-card__icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.edu-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.edu-card__location {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.6rem;
}

.edu-card__degree {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.edu-card__period {
  font-size: 0.85rem;
  opacity: 0.7;
}

.edu-card__thesis {
  font-size: 0.82rem;
  opacity: 0.85;
  line-height: 1.5;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--card-border);
}

.edu-card__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent);
  color: var(--text-dark);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 2rem;
}

/* ============================================================
   3. EXPERIENCIA — Experience
   ============================================================ */
.exp-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.exp-tab {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  color: var(--text-on-dark);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.exp-tab:hover {
  border-color: var(--accent);
}

.exp-tab--active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-dark);
}

.exp-panel {
  display: none;
}

.exp-panel--active {
  display: block;
}

.timeline {
  position: relative;
  padding-left: 2rem;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.timeline::-webkit-scrollbar {
  width: 4px;
}

.timeline::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--turquoise));
}

.timeline__item {
  position: relative;
  margin-bottom: 1.2rem;
  padding-left: 1rem;
}

.timeline__item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.7rem;
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: 3px solid var(--ocean-deep);
  border-radius: 50%;
  z-index: 1;
}

.timeline__year {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.2rem;
  letter-spacing: 0.5px;
}

.timeline__card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  backdrop-filter: blur(10px);
  transition: transform 0.3s;
}

.timeline__card:hover {
  transform: translateX(4px);
}

.timeline__card h3 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.timeline__card h3 small {
  font-weight: 400;
  opacity: 0.7;
  font-size: 0.8rem;
  margin-left: 0.3rem;
}

.timeline__card p {
  font-size: 0.82rem;
  line-height: 1.5;
  opacity: 0.9;
}

/* ============================================================
   4. CONTACTO
   ============================================================ */
.contact-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.9;
  margin-bottom: 2rem;
}

.contact-selector {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-card {
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  backdrop-filter: blur(10px);
  min-width: 200px;
  max-width: 250px;
  flex: 1;
  text-decoration: none;
  color: var(--text-on-dark);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.contact-card:hover,
.contact-card:focus-visible {
  transform: translateY(-8px) scale(1.03);
  background: var(--accent);
  color: var(--text-dark);
  border-color: var(--accent);
  box-shadow: 0 12px 40px rgba(94, 234, 212, 0.4);
}

.contact-card:hover .contact-card__icon,
.contact-card:focus-visible .contact-card__icon {
  color: var(--text-dark);
  transform: scale(1.2);
}

.contact-card__icon {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 0.8rem;
  transition: all 0.3s;
}

.contact-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.contact-card p {
  font-size: 0.8rem;
  opacity: 0.8;
}

.contact-card:hover p {
  opacity: 1;
}

/* ============================================================
   ONDE SVG
   ============================================================ */
.waves {
  position: fixed;
  bottom: var(--nav-height);
  left: 0;
  width: 100%;
  height: var(--wave-height);
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.waves svg {
  display: block;
  width: 200%;
  height: 100%;
}

.wave {
  fill: rgba(2, 62, 138, 0.3);
}

.wave--1 {
  fill: rgba(0, 119, 182, 0.25);
  animation: waveMove 8s linear infinite;
}

.wave--2 {
  fill: rgba(0, 180, 216, 0.2);
  animation: waveMove 6s linear infinite reverse;
}

.wave--3 {
  fill: rgba(2, 62, 138, 0.4);
  animation: waveMove 10s linear infinite;
}

@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   NAVIGAZIONE INFERIORE
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: rgba(2, 62, 138, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  z-index: 100;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 0.5rem;
}

.bottom-nav__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  font-family: var(--font-body);
  position: relative;
}

.bottom-nav__btn i {
  font-size: 1.1rem;
  transition: transform 0.3s;
}

.bottom-nav__btn span {
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
}

.bottom-nav__btn:hover {
  color: var(--white);
}

.bottom-nav__btn:hover i {
  transform: translateY(-2px);
}

.bottom-nav__btn--active {
  color: var(--accent);
}

.bottom-nav__btn--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

/* ============================================================
   FRECCE LATERALI
   ============================================================ */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 60;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
  opacity: 0.7;
}

.nav-arrow:hover {
  opacity: 1;
  background: var(--accent);
  color: var(--text-dark);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow--left {
  left: 1rem;
}

.nav-arrow--right {
  right: 1rem;
}

.nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Mobile small */
@media (max-width: 480px) {
  :root {
    --nav-height: 52px;
    --wave-height: 60px;
  }

  .slide {
    padding: 1rem 1rem calc(var(--nav-height) + var(--wave-height) + 0.3rem);
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .hero__photo {
    width: 120px;
    height: 120px;
  }

  .hero__langs {
    justify-content: center;
  }

  .section-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .skills-wrap {
    max-height: calc(100vh - 180px);
  }

  .skills-grid {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .skill-category {
    padding: 0.8rem;
  }

  .edu-cards {
    flex-direction: column;
    align-items: center;
  }

  .edu-card {
    min-width: unset;
    width: 100%;
    padding: 1.2rem 1rem;
  }

  .contact-selector {
    flex-direction: column;
    align-items: center;
  }

  .contact-card {
    min-width: unset;
    width: 100%;
    max-width: 300px;
    padding: 1.2rem;
  }

  .bottom-nav__btn span {
    display: none;
  }

  .bottom-nav__btn i {
    font-size: 1.3rem;
  }

  .bottom-nav {
    gap: 0.2rem;
  }

  .nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .nav-arrow--left { left: 0.4rem; }
  .nav-arrow--right { right: 0.4rem; }

  .lang-selector {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.2rem;
  }

  .lang-btn {
    font-size: 1rem;
    padding: 0.2rem 0.35rem;
  }

  .timeline {
    max-height: calc(100vh - 230px);
  }

  .timeline__card {
    padding: 0.6rem 0.8rem;
  }

  .timeline__card h3 {
    font-size: 0.85rem;
  }

  .timeline__card p {
    font-size: 0.75rem;
  }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    --nav-height: 55px;
    --wave-height: 70px;
  }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .hero__photo {
    width: 140px;
    height: 140px;
  }

  .hero__langs {
    justify-content: center;
  }

  .bottom-nav__btn span {
    font-size: 0.6rem;
  }

  .timeline {
    max-height: calc(100vh - 260px);
  }
}

/* Desktop large */
@media (min-width: 1200px) {
  .slide {
    padding: 2rem 3rem calc(var(--nav-height) + var(--wave-height) + 1rem);
  }

  .bottom-nav {
    gap: 0.5rem;
  }

  .bottom-nav__btn {
    padding: 0.5rem 1rem;
  }

  .bottom-nav__btn i {
    font-size: 1.2rem;
  }

  .bottom-nav__btn span {
    font-size: 0.72rem;
  }
}

/* ============================================================
   REDUCED MOTION — Accessibilita
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero__photo {
    animation: none;
  }

  .slide__hint {
    animation: none;
  }
}

/* ============================================================
   HIGH CONTRAST — Accessibilita
   ============================================================ */
@media (prefers-contrast: high) {
  .skill-tag,
  .lang-tag,
  .edu-card,
  .contact-card,
  .timeline__card,
  .skill-category {
    border-width: 2px;
    border-color: var(--white);
  }

  .bottom-nav {
    border-top-width: 2px;
  }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .bottom-nav,
  .waves,
  .nav-arrow,
  .skip-link,
  .slide__hint,
  .lang-selector {
    display: none !important;
  }

  .slide {
    position: relative !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: all !important;
    page-break-after: always;
    padding: 2rem;
    height: auto;
    min-height: 100vh;
  }

  body {
    overflow: auto;
  }
}
