/* =========================
   🎨 VARIABLES (THEME)
========================= */
:root {
  --primary: #00ccff;
  --primary-dark: #0077a6;
  --primary-dark-2: #004074;
  --primary-gray-1: #9ca3af;
  --primary-gray-2: #848b96;
  --primary-white: #f3f4f6;

  --background: #0f2d49;
  --surface: #0f2d49;

  --text: #e5e7eb;
  --text-light: #9ca3af;

  --border: #1f2937;
  --shadow: rgba(0, 0, 0, 0.6);

  --radius: 16px;
  --transition: all 0.3s ease;
}

/* =========================
   🌍 GLOBAL
========================= */
html,
body,
#appContent {
  height: 100% !important;
  overflow: hidden !important;
  margin: 0;
  padding: 0;
}

body {
  background: var(--background);
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
}

/* 🔥 NUEVO: controla fondo entre secciones */
.sapMPage,
.sapMPage > section {
  padding: 0 !important;
  background: var(--surface) !important;
}

/* =========================
   🔝 HEADER
========================= */
.customHeaderBar,
.customHeaderBar.sapMBar {
  background: var(--primary-gray-1) !important;
  border: none !important;
  box-shadow: none !important;
}

/* SAPUI5 ajuste */
.sapMBar {
  height: 70px !important;
  display: grid !important;
  grid-template-columns: 50px 1fr 50px;
  align-items: center;
}

/* BOTÓN */
.menuBtn {
  margin-left: 10px;
  z-index: 2;
}

.menuBtn .sapMBtnInner {
  background: var(--primary) !important;
  border: none !important;

  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.menuBtn .sapUiIcon {
  color: white !important;
}

.menuBtn .sapMBtnInner:hover {
  background: var(--primary-dark) !important;
}

.menuBtn:hover .sapMBtnInner {
  transform: scale(1.05);
}

/* LOGO */
.headerLogo {
  height: 50px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.rightSpacer {
  width: 56px;
}

/* =========================
   🖼️ BANNER
========================= */
.sapMBarPH,
.sapMBarMiddle {
  height: 100% !important;
}

.banner img {
  width: 100%;
  height: auto !important;
  object-fit: contain;
  filter: brightness(0.85);
  transition: var(--transition);
  display: block;
}

.banner img:hover {
  filter: brightness(1);
}

/* =========================
   👤 FOTO PERFIL
========================= */
.profileContainer {
  margin-top: -90px;
  animation: fadeUp 0.8s ease;
}

/* 🔥 RESPONSIVE REAL */
.profileImage {
  width: clamp(110px, 18vw, 170px);
  height: clamp(110px, 18vw, 170px);
  border-radius: 50%;
  border: 4px solid var(--primary);
  box-shadow: 0 8px 25px var(--shadow);
  transition: 0.3s ease;
}

.profileImage:hover {
  transform: scale(1.05);
}

/* =========================
   📌 NAVBAR (GRID FIX 🔥)
========================= */
.navbar {
  margin: 30px auto 0 auto;
  background: var(--primary-white) !important;

  gap: 5px;

  padding: 6px 10px;
}

/* botones contenedor */
.navbar .sapMBtn {
  flex: 1 1 120px; /* 🔥 clave */
  max-width: 200px;
  min-width: 90px;
}

.navbar .sapMBtn,
.navbar .sapMBtnInner {
  background: transparent !important;
}

/* botón interno */
.navbar .sapMBtnInner {
  border: none !important;

  padding: 8px;

  font-size: clamp(11px, 2.5vw, 16px);
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--primary-dark);
}

/* texto interno limpio */
.navbar .sapMBtnInner span {
  text-align: center;
  white-space: normal !important; /* 🔥 cambio clave */
  word-break: break-word;
}

/* hover */
.navbar .sapMBtn:hover .sapMBtnInner {
  background: rgba(0,0,0,0.1);
}

/* activo */
.navbar .sapMBtn.active .sapMBtnInner {
  background: var(--primary-dark) !important;
  color: white !important;
}

.navbar .sapMBtn {
  flex: 1 1 120px; /* 🔥 clave */
  max-width: 200px;
  min-width: 90px;
}

.navbar .sapMBtnInner {
  min-width: 0 !important;   /* 🔥 clave */
  white-space: normal !important; /* 🔥 permite saltos */
}


/* 🔥 CONTENIDO DINÁMICO */
.dynamicContent {
  padding: 20px;
  color: white; /* 👈 clave */
}

/* textos dentro */
.dynamicContent .sapMText {
  color: var(--text) !important;
  font-size: 16px;
}


.homeSection {
  background: rgba(255,255,255,0.05);
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}

.homeSection .sapMTitle {
  color: white;
}

.homeSection .sapMText {
  color: #d1d5db;
}

/* =========================
   🖼️ PORTFOLIO CARDS (Premium Style)
========================= */
.portSection {
  width: 100%;
  padding-bottom: 30px;
}

.portGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.portCard {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 204, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: fadeUp 0.6s ease both;
}

.portCard:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 204, 255, 0.25);
  border-color: var(--primary);
}

.portCardImgWrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f3f4f6;
}

.portCardImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* Placeholder cuando no hay imagen local */
.portCardImgPlaceholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary);
  opacity: 0.2;
  background: #eef2f7;
}

.portCardImgWrap:not(.portCardImgFallback) .portCardImgPlaceholder {
  display: none;
}

.portCard:hover .portCardImg {
  transform: scale(1.1);
}

.portCardImg {
  cursor: zoom-in;
}

.portCardContent {
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.portCardArrow {
  position: absolute;
  top: -25px;
  right: 25px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 204, 255, 0.4);
  transition: all 0.3s ease;
  z-index: 2;
}

.portCardArrow:hover {
  background: var(--primary-dark);
  transform: rotate(-45deg) scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 204, 255, 0.6);
}

.portCardTitle {
  margin: 0 0 10px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark-2);
}

.portCardDesc {
  margin: 0;
  font-size: 0.95rem;
  color: #4b5563;
  line-height: 1.6;
}

/* --- Badge de tipo de proyecto --- */
.portCardTag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

/* Personal → cian (color del portfolio) */
.portCardTag--personal {
  background: rgba(0, 204, 255, 0.12);
  color: #0077a6;
  border-color: rgba(0, 204, 255, 0.35);
}
.portCardTag--personal:hover {
  background: rgba(0, 204, 255, 0.22);
}

/* Group → verde */
.portCardTag--group {
  background: rgba(99, 210, 156, 0.12);
  color: #1a7a45;
  border-color: rgba(99, 210, 156, 0.35);
}
.portCardTag--group:hover {
  background: rgba(99, 210, 156, 0.22);
}

/* Freelance → naranja */
.portCardTag--freelance {
  background: rgba(251, 146, 60, 0.12);
  color: #b45309;
  border-color: rgba(251, 146, 60, 0.35);
}
.portCardTag--freelance:hover {
  background: rgba(251, 146, 60, 0.22);
}

/* Academic → morado */
.portCardTag--academic {
  background: rgba(167, 139, 250, 0.12);
  color: #6d28d9;
  border-color: rgba(167, 139, 250, 0.35);
}
.portCardTag--academic:hover {
  background: rgba(167, 139, 250, 0.22);
}

@media (max-width: 400px) {
  .portCard {
    width: 100%;
  }
}

/* =========================
   🌐 SOCIAL LINKS CARD
========================= */
.socialCard {
  background: linear-gradient(135deg, rgba(0, 204, 255, 0.07), rgba(0, 64, 116, 0.25));
  border: 1px solid rgba(0, 204, 255, 0.2);
  border-radius: 18px;
  padding: 28px 32px;
  margin: 16px 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.7s ease both;
  animation-delay: 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.socialBtns {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 8px 0;
}

.socialBtn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  color: white;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  animation: fadeUp 0.8s ease both;
}

.socialBtn:nth-child(1) { animation-delay: 0.25s; }
.socialBtn:nth-child(2) { animation-delay: 0.4s; }
.socialBtn:nth-child(3) { animation-delay: 0.55s; }
.socialBtn:nth-child(4) { animation-delay: 0.7s; } /* itch.io animación secuencial */

.socialBtn:hover {
  transform: scale(1.15);
}

/* LinkedIn */
.socialBtn-linkedin {
  background: #0077b5;
}
.socialBtn-linkedin:hover {
  box-shadow: 0 8px 28px rgba(0, 119, 181, 0.65);
}

/* GitHub */
.socialBtn-github {
  background: linear-gradient(135deg, #24292e, #6e5494);
}
.socialBtn-github:hover {
  box-shadow: 0 8px 28px rgba(110, 84, 148, 0.65);
}

/* Instagram */
.socialBtn-instagram {
  background: linear-gradient(45deg, #405de6, #5851db, #833ab4, #c13584, #e1306c, #fd1d1d);
}
.socialBtn-instagram:hover {
  box-shadow: 0 8px 28px rgba(225, 48, 108, 0.65);
}

/* itch.io */
.socialBtn-itchio {
  background: #fa5c5c !important; 
}
.socialBtn-itchio:hover {
  box-shadow: 0 8px 28px rgba(250, 92, 92, 0.8) !important;
  transform: scale(1.15);
}

/* =========================
   💼 EXPERIENCE CARDS
========================= */
.expCard {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 28px;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 204, 255, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp 0.6s ease both;
  width: 100%;
  box-sizing: border-box;
}

.expCard:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 204, 255, 0.18);
  border-color: rgba(0, 204, 255, 0.45);
}

/* Parte superior: foto + info */
.expCardTop {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

/* Contenedor de imagen */
.expCardImgWrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #e8f4fb;
  border: 2px solid rgba(0, 204, 255, 0.25);
}

.expCardImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder cuando no hay imagen */
.expCardImgPlaceholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
  opacity: 0.4;
}

.expCardImgWrap:not(.expCardImgFallback) .expCardImgPlaceholder {
  display: none;
}

/* Info: título, empresa, año */
.expCardInfo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.expCardTitle {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark-2);
}

.expCardCompany {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
}

.expCardYear {
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 5px;
}

.expCardYear i {
  color: var(--primary);
}

/* Lista de funciones */
.expCardFunctions {
  margin: 0;
  padding-left: 20px;
  border-top: 1px solid rgba(0, 204, 255, 0.15);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expCardFunctions li {
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.5;
}

.expCardFunctions li::marker {
  color: var(--primary);
}

/* Responsive: apila en móvil */
@media (max-width: 480px) {
  .expCardTop {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .expCardYear {
    justify-content: center;
  }
}

/* =========================
   🎓 EDUCATION CARDS
========================= */
/* =========================
   🎓 EDUCATION CARDS (Visual Cohesion with Experience)
========================= */
.eduCard {
  background: #ffffff; /* Mismo fondo blanco que expCard */
  border-radius: 18px;
  padding: 24px 28px;
  margin: 16px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(99, 210, 156, 0.2); /* Borde verde suave */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp 0.6s ease both;
  width: 100%;
  box-sizing: border-box;
}

.eduCard:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(99, 210, 156, 0.18);
  border-color: rgba(99, 210, 156, 0.45);
}

.eduCardTop {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}

.eduCardImgWrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #e4f7ef;
  border: 2px solid rgba(99, 210, 156, 0.25);
}

.eduCardImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.eduCardImgPlaceholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #63d29c;
  opacity: 0.4;
}

.eduCardImgWrap:not(.eduCardImgFallback) .eduCardImgPlaceholder {
  display: none;
}

.eduCardInfo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.eduCardTitle {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a4a30; /* Verde oscuro para el título */
}

.eduCardInstitution {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
}

.eduCardYear {
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 5px;
}

.eduCardYear i {
  color: #63d29c;
}

.eduCardHighlights {
  margin: 0;
  padding-left: 20px;
  border-top: 1px solid rgba(99, 210, 156, 0.15);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eduCardHighlights li {
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.5;
}

.eduCardHighlights li::marker {
  color: #63d29c;
}

@media (max-width: 480px) {
  .eduCardTop {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .eduCardYear {
    justify-content: center;
  }
}

/* =========================
   📄 EXP/EDU TWO-COLUMN LAYOUT
========================= */
.expTwoCol {
  width: 100%;
  gap: 0;
  align-items: flex-start;
}

.expColumn {
  flex: 1 1 300px;
  min-width: 280px;
  padding: 0 12px;
  box-sizing: border-box;
}

/* Cuando la columna ocupa toda la sección sola */
.expColumnFull {
  flex: 1 1 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 12px;
}

.expColTitle {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  margin-bottom: 8px !important;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(0, 204, 255, 0.25);
}

.expColumnWork .expColTitle {
  color: var(--primary) !important;
}

.expColumnEdu .expColTitle {
  color: #63d29c !important;
  border-bottom-color: rgba(99, 210, 156, 0.35) !important;
}

/* Separador vertical entre columnas */
.expColumnEdu {
  border-left: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 700px) {
  .expColumn {
    flex: 1 1 100%;
    padding: 0 4px;
  }
  .expColumnEdu {
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 16px;
    padding-top: 16px;
  }
}

/* =========================
   🎮 ITCH.IO NAVBAR BTN
========================= */
.itchBtn .sapMBtnInner {
  background: linear-gradient(135deg, #fa5c5c, #c0392b) !important;
  color: white !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

.itchBtn .sapMBtnInner:hover,
.navbar .itchBtn:hover .sapMBtnInner {
  background: linear-gradient(135deg, #e74c3c, #a93226) !important;
  box-shadow: 0 4px 14px rgba(231, 76, 60, 0.5) !important;
  transform: scale(1.04);
}

/* =========================
   🗂️ ABOUT CARDS
========================= */
.aboutCard,
.aboutCard.sapMVBox {
  background: linear-gradient(135deg, rgba(0, 204, 255, 0.07), rgba(0, 64, 116, 0.25));
  border: 1px solid rgba(0, 204, 255, 0.2);
  border-radius: 18px;
  padding: 28px 32px;
  margin: 16px 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp 0.6s ease both;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.aboutCard:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 36px rgba(0, 204, 255, 0.2);
  border-color: rgba(0, 204, 255, 0.55);
}

.aboutCardHeader,
.aboutCardHeader.sapMHBox {
  margin-bottom: 12px;
  min-width: 0;
  width: 100%;
  flex-wrap: wrap;
}

.aboutCardIcon {
  font-size: 2.2rem !important;
  line-height: 1 !important;
  margin-right: 14px;
}

.aboutCardIcon .sapMText {
  font-size: 2.2rem !important;
  color: inherit !important;
  line-height: 1 !important;
}

.aboutCardTitle,
.aboutCardTitle.sapMTitle {
  color: var(--primary) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  margin: 0 !important;
  /* clave: permite que el título se encoja dentro del HBox */
  flex: 1 1 0 !important;
  min-width: 0 !important;
  overflow: hidden;
}

/* el span interior de SAP UI5 Title debe poder partir línea */
.aboutCardTitle span,
.aboutCardTitle.sapMTitle span {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  display: block;
}

/* Tarjeta centrada (ej: bienvenida del Home) */
.centeredCard .aboutCardHeader.sapMHBox {
  justify-content: center !important;
}
.centeredCard .aboutCardText {
  text-align: center !important;
  display: block;
}
.centeredCard .aboutCardTitle.sapMTitle {
  text-align: center !important;
}

.aboutCardText {
  color: var(--text) !important;
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
}

.timelineItem {
  margin-bottom: 15px;
  padding: 10px;
  border-left: 7px solid var(--primary);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================
   🧠 SKILLS SECTION
========================= */
.skillsContainer {
  margin-bottom: 24px;
}

.skillsTitle {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}

.skillsTitle-hard {
  color: var(--primary);
  border-bottom-color: rgba(0, 204, 255, 0.25);
}

.skillsTitle-soft {
  color: #63d29c; /* Soft green */
  border-bottom-color: rgba(99, 210, 156, 0.25);
}

.skillsGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-start;
  padding: 10px 0;
}

.skillChip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid;
  border-radius: 30px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: fadeUp 0.6s ease both;
}

.skillChip:hover {
  transform: translateY(-4px) scale(1.05);
}

.skillChip-hard {
  border-color: rgba(0, 204, 255, 0.2);
}

.skillChip-hard:hover {
  background: rgba(0, 204, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(0, 204, 255, 0.25);
}

.skillChip-hard i {
  color: var(--primary);
  font-size: 1.3rem;
}

.skillChip-soft {
  border-color: rgba(99, 210, 156, 0.2);
}

.skillChip-soft:hover {
  background: rgba(99, 210, 156, 0.15);
  border-color: #63d29c;
  box-shadow: 0 6px 20px rgba(99, 210, 156, 0.25);
}

.skillChip-soft i {
  color: #63d29c;
  font-size: 1.3rem;
}

.skillName {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

/* =========================
   ✨ ANIMACIONES
========================= */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .navbar .sapMBtn {
    flex: 1 1 45%; /* 2 por fila */
  }
}

@media (max-width: 400px) {
  .navbar .sapMBtn {
    flex: 1 1 100%; /* 1 por fila */
  }
}

/* =========================
   🔍 LIGHTBOX (imagen ampliada)
========================= */
#portLightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  animation: lbFadeIn 0.25s ease;
  cursor: zoom-out;
}

#portLightbox.is-open {
  display: flex;
}

#portLightboxImg {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(0, 204, 255, 0.35);
  animation: lbZoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: default;
  object-fit: contain;
  display: block;
}

#portLightboxClose {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: white;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

#portLightboxClose:hover {
  background: rgba(0, 204, 255, 0.35);
  transform: scale(1.1) rotate(90deg);
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lbZoomIn {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}

/* =========================
   🤖 DRAKONIUS AI ASSISTANT
   ========================= */

/* Floating Action Button (FAB) */
.ai-fab {
  position: fixed !important;
  bottom: 25px !important;
  right: 25px !important;
  width: 65px !important;
  height: 65px !important;
  z-index: 1000;
  border-radius: 50% !important;
  box-shadow: 0 8px 30px rgba(0, 204, 255, 0.4) !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  background: var(--primary) !important;
  border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.ai-fab .sapMBtnInner {
  background: transparent !important;
  border: none !important;
  color: white !important;
  font-size: 1.8rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.ai-fab:hover {
  transform: scale(1.1) rotate(5deg) !important;
  box-shadow: 0 12px 40px rgba(0, 204, 255, 0.6) !important;
}

/* Chat Window Container (Side Panel) */
.ai-chat-window {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: clamp(300px, 100vw, 400px) !important;
  height: 100% !important;
  max-height: 100dvh !important;
  background: rgba(15, 45, 73, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-left: 1px solid rgba(0, 204, 255, 0.3) !important;
  border-radius: 0 !important; /* Side panel shape */
  z-index: 1001;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  animation: slideInRight 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) both;
}

/* 🔥 CRITICAL SAP UI5 VBOX FIX 🔥 */
.ai-chat-window > .sapMFlexItem:nth-child(1) {
  flex: 0 0 auto !important; /* Header: don't shrink, don't grow */
}
.ai-chat-window > .sapMFlexItem:nth-child(2) {
  flex: 1 1 auto !important; /* Messages wrapper: take remaining space */
  min-height: 0 !important; /* Prevent flex overflow */
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}
.ai-chat-window > .sapMFlexItem:nth-child(3) {
  flex: 0 0 auto !important; /* Input Area: don't shrink, don't grow */
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

.ai-chat-window.closing {
  animation: slideOutRight 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) both !important;
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* Header Area */
.ai-chat-header {
  background: rgba(0, 64, 116, 0.85) !important;
  padding: 15px 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  border-bottom: 1px solid rgba(0, 204, 255, 0.2) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
  z-index: 2;
  flex-shrink: 0 !important;
}

.ai-chat-title {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.ai-chat-title .sapMTitle,
.ai-chat-title .sapMTitle span {
  color: white !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
}

.ai-chat-close {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
  cursor: pointer !important;
  font-size: 1.2rem !important;
  transition: color 0.2s ease, transform 0.2s ease !important;
}

.ai-chat-close:hover {
  color: white !important;
  transform: scale(1.1) !important;
}

/* Message Area */
.ai-chat-messages {
  flex: 1 !important;
  height: auto !important; /* Override SAP inline height 100% to prevent overflow */
  min-height: 0 !important;
  overflow-y: auto !important;
  background: rgba(0, 0, 0, 0.15) !important;
}

.ai-chat-messages .sapMScrollContScroll {
  display: flex !important;
  flex-direction: column !important;
  gap: 22px !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  min-height: 100% !important;
}

/* Custom Scrollbar for messages */
.ai-chat-messages::-webkit-scrollbar {
  width: 6px;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 204, 255, 0.2);
  border-radius: 10px;
}

/* Message Bubbles */
.ai-msg {
  max-width: 85% !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-size: 0.95rem !important;
  line-height: 1.4 !important;
  position: relative !important;
  animation: fadeIn 0.3s ease both;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
  word-wrap: break-word !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.ai-msg-user {
  align-self: flex-end !important;
  background: var(--primary-dark) !important;
  color: white !important;
  border-top-right-radius: 2px !important; /* WhatsApp user bubble style */
}

.ai-msg-bot {
  align-self: flex-start !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-top-left-radius: 2px !important; /* WhatsApp bot bubble style */
}

/* Typing Indicator */
.ai-typing {
  font-style: italic !important;
  font-size: 0.85rem !important;
  color: var(--primary-gray-1) !important;
  margin-top: -10px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Input Area */
.ai-chat-input-area {
  padding: 15px 20px !important;
  background: rgba(0, 40, 75, 0.9) !important;
  border-top: 1px solid rgba(0, 204, 255, 0.2) !important;
  display: flex !important;
  gap: 15px !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.ai-input {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  height: 50px !important;
  margin: 0 !important;
}

/* El Wrapper será el que tenga la apariencia redondeada */
.ai-input .sapMInputBaseContentWrapper {
  border: 1px solid rgba(0, 204, 255, 0.3) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 25px !important;
  height: 50px !important;
  min-height: 50px !important;
  display: flex !important;
  align-items: center !important;
  overflow: hidden !important;
  padding: 0 !important;
  transition: all 0.3s ease !important;
}

/* El estado focus aplicado al wrapper */
.ai-input.sapMInputBaseHasFocus .sapMInputBaseContentWrapper {
  border-color: var(--primary) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 10px rgba(0, 204, 255, 0.3) !important;
}

/* El input nativo ocupará todo el espacio pero será transparente */
.ai-input .sapMInputBaseInner {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  padding: 0 20px !important;
  height: 100% !important;
  width: 100% !important;
  font-size: 1rem !important;
  line-height: normal !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.ai-input .sapMInputBaseInner::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.ai-input .sapMInputBaseInner:focus {
  border-color: var(--primary) !important;
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 10px rgba(0, 204, 255, 0.3) !important;
  outline: none !important;
}

.ai-send-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 50px !important;
  height: 50px !important;
  color: white !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  flex-shrink: 0 !important;
  box-shadow: 0 4px 15px rgba(0, 204, 255, 0.3) !important;
}

.ai-send-btn .sapMBtnInner {
  background: transparent !important;
  border: none !important;
}

.ai-send-btn:hover {
  transform: scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(0, 204, 255, 0.5) !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}