@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Rubik:wght@300;400;500;600;700&display=swap');

:root {
  /* CELEX Brand Colors */
  --celex-teal-dark: #003034;
  --celex-teal-primary: #075056;
  --celex-teal-sidebar: #023641;
  --celex-teal-subtle: #043E44;
  --celex-amber-accent: #FFA604;
  --celex-amber-hover: #E58E00;
  --celex-cyan-light: #AECDD1;
  --celex-cyan-bg: #E9F7F7;
  --celex-gray-dark: #16232A;
  --celex-gray-subtext: #5A6E72;
  --celex-gray-border: #E2E8F0;
  --celex-footer-bg: #003034;
  --celex-card-bg: #FFFFFF;
}

/* Base Font Families */
body {
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--celex-gray-dark);
  background-color: #FFFFFF;
  overflow-x: hidden;
  font-size: 17.6px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Montserrat', sans-serif;
}

/* ========================================================
   ESCALA TIPOGRÁFICA GLOBAL AL 110% (SOLO TIPOGRAFÍA)
   Escala exactamente al 1.10x (110%) las letras de todos los textos,
   títulos, subtítulos y badges sin alterar dimensiones de tarjetas,
   márgenes, paddings ni contenedores de la interfaz.
   ======================================================== */

p {
  font-size: 1.1rem;
  line-height: 1.62;
}

/* Utilidades estándar Tailwind escaladas al 110% */
body .text-xs { font-size: 0.825rem !important; line-height: 1.375rem !important; }
body .text-sm { font-size: 0.9625rem !important; line-height: 1.5rem !important; }
body .text-base { font-size: 1.1rem !important; line-height: 1.65rem !important; }
body .text-lg { font-size: 1.2375rem !important; line-height: 1.85rem !important; }
body .text-xl { font-size: 1.375rem !important; line-height: 2rem !important; }
body .text-2xl { font-size: 1.65rem !important; line-height: 2.25rem !important; }
body .text-3xl { font-size: 2.0625rem !important; line-height: 2.55rem !important; }
body .text-4xl { font-size: 2.475rem !important; line-height: 2.9rem !important; }
body .text-5xl { font-size: 3.3rem !important; line-height: 3.6rem !important; }
body .text-6xl { font-size: 4.125rem !important; line-height: 4.5rem !important; }

/* Tamaños arbitrarios del sistema escalados al 110% */
body .text-\[7\.5px\] { font-size: 8.25px !important; }
body .text-\[8px\] { font-size: 8.8px !important; }
body .text-\[8\.5px\] { font-size: 9.35px !important; }
body .text-\[9px\] { font-size: 9.9px !important; }
body .text-\[9\.5px\] { font-size: 10.45px !important; }
body .text-\[10px\] { font-size: 11px !important; }
body .text-\[10\.5px\] { font-size: 11.55px !important; }
body .text-\[11px\] { font-size: 12.1px !important; }
body .text-\[11\.5px\] { font-size: 12.65px !important; }
body .text-\[12px\] { font-size: 13.2px !important; }
body .text-\[12\.5px\] { font-size: 13.75px !important; }
body .text-\[13px\] { font-size: 14.3px !important; }
body .text-\[13\.5px\] { font-size: 14.85px !important; }
body .text-\[14px\] { font-size: 15.4px !important; }
body .text-\[14\.5px\] { font-size: 15.95px !important; }
body .text-\[15px\] { font-size: 16.5px !important; }
body .text-\[16px\] { font-size: 17.6px !important; }
body .text-\[17px\] { font-size: 18.7px !important; }
body .text-\[20px\] { font-size: 22px !important; }
body .text-\[22px\] { font-size: 24.2px !important; }
body .text-\[23px\] { font-size: 25.3px !important; }
body .text-\[27px\] { font-size: 29.7px !important; }
body .text-\[28px\] { font-size: 30.8px !important; }
body .text-\[42px\] { font-size: 46.2px !important; }
body .text-\[44px\] { font-size: 48.4px !important; }
body .text-\[46px\] { font-size: 50.6px !important; }
body .text-\[52px\] { font-size: 57.2px !important; }
body .text-\[56px\] { font-size: 61.6px !important; }
body .text-\[58px\] { font-size: 63.8px !important; }

/* Variantes responsive sm: (>= 640px) */
@media (min-width: 640px) {
  body .sm\:text-xs { font-size: 0.825rem !important; line-height: 1.375rem !important; }
  body .sm\:text-sm { font-size: 0.9625rem !important; line-height: 1.5rem !important; }
  body .sm\:text-base { font-size: 1.1rem !important; line-height: 1.65rem !important; }
  body .sm\:text-lg { font-size: 1.2375rem !important; line-height: 1.85rem !important; }
  body .sm\:text-xl { font-size: 1.375rem !important; line-height: 2rem !important; }
  body .sm\:text-2xl { font-size: 1.65rem !important; line-height: 2.25rem !important; }
  body .sm\:text-3xl { font-size: 2.0625rem !important; line-height: 2.55rem !important; }
  body .sm\:text-4xl { font-size: 2.475rem !important; line-height: 2.9rem !important; }
  body .sm\:text-5xl { font-size: 3.3rem !important; line-height: 3.6rem !important; }
  body .sm\:text-\[8px\] { font-size: 8.8px !important; }
  body .sm\:text-\[10px\] { font-size: 11px !important; }
  body .sm\:text-\[10\.5px\] { font-size: 11.55px !important; }
  body .sm\:text-\[11px\] { font-size: 12.1px !important; }
  body .sm\:text-\[11\.5px\] { font-size: 12.65px !important; }
  body .sm\:text-\[12px\] { font-size: 13.2px !important; }
  body .sm\:text-\[12\.5px\] { font-size: 13.75px !important; }
  body .sm\:text-\[13px\] { font-size: 14.3px !important; }
  body .sm\:text-\[13\.5px\] { font-size: 14.85px !important; }
  body .sm\:text-\[14px\] { font-size: 15.4px !important; }
  body .sm\:text-\[14\.5px\] { font-size: 15.95px !important; }
  body .sm\:text-\[15px\] { font-size: 16.5px !important; }
  body .sm\:text-\[17px\] { font-size: 18.7px !important; }
  body .sm\:text-\[23px\] { font-size: 25.3px !important; }
  body .sm\:text-\[27px\] { font-size: 29.7px !important; }
  body .sm\:text-\[28px\] { font-size: 30.8px !important; }
}

/* Variantes responsive md: (>= 768px) */
@media (min-width: 768px) {
  body .md\:text-sm { font-size: 0.9625rem !important; line-height: 1.5rem !important; }
  body .md\:text-base { font-size: 1.1rem !important; line-height: 1.65rem !important; }
  body .md\:text-lg { font-size: 1.2375rem !important; line-height: 1.85rem !important; }
  body .md\:text-xl { font-size: 1.375rem !important; line-height: 2rem !important; }
  body .md\:text-2xl { font-size: 1.65rem !important; line-height: 2.25rem !important; }
  body .md\:text-3xl { font-size: 2.0625rem !important; line-height: 2.55rem !important; }
  body .md\:text-4xl { font-size: 2.475rem !important; line-height: 2.9rem !important; }
  body .md\:text-6xl { font-size: 4.125rem !important; line-height: 4.5rem !important; }
  body .md\:text-\[17px\] { font-size: 18.7px !important; }
}

/* Variantes responsive lg: (>= 1024px) */
@media (min-width: 1024px) {
  body .lg\:text-sm { font-size: 0.9625rem !important; line-height: 1.5rem !important; }
  body .lg\:text-base { font-size: 1.1rem !important; line-height: 1.65rem !important; }
  body .lg\:text-lg { font-size: 1.2375rem !important; line-height: 1.85rem !important; }
  body .lg\:text-xl { font-size: 1.375rem !important; line-height: 2rem !important; }
  body .lg\:text-2xl { font-size: 1.65rem !important; line-height: 2.25rem !important; }
  body .lg\:text-3xl { font-size: 2.0625rem !important; line-height: 2.55rem !important; }
  body .lg\:text-4xl { font-size: 2.475rem !important; line-height: 2.9rem !important; }
  body .lg\:text-\[15px\] { font-size: 16.5px !important; }
  body .lg\:text-\[42px\] { font-size: 46.2px !important; }
  body .lg\:text-\[44px\] { font-size: 48.4px !important; }
  body .lg\:text-\[46px\] { font-size: 50.6px !important; }
  body .lg\:text-\[56px\] { font-size: 61.6px !important; }
  body .lg\:text-\[58px\] { font-size: 63.8px !important; }
}

/* Variantes responsive xl: (>= 1280px) */
@media (min-width: 1280px) {
  body .xl\:text-\[52px\] { font-size: 57.2px !important; }
}

/* Formularios y tablas */
input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]),
select,
textarea {
  font-size: 15.4px !important;
}

table td, table th {
  font-size: 15.4px;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes chatSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in-up-delay-1 {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
  opacity: 0;
}

.animate-fade-in-up-delay-2 {
  animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  opacity: 0;
}

.animate-float-mascot {
  animation: floatMascot 3.5s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2.5s ease-in-out infinite;
}

.animate-chat-open {
  animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Card Hover Micro-interactions */
.celex-card {
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.celex-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -6px rgba(7, 80, 86, 0.12), 0 4px 10px -2px rgba(7, 80, 86, 0.06);
  border-color: rgba(7, 80, 86, 0.25);
}

.celex-card:hover .celex-arrow-btn {
  transform: translateX(3px);
  background-color: var(--celex-teal-primary);
  color: #FFFFFF;
}

/* Tooltip on Sidebar buttons */
.sidebar-item {
  position: relative;
  transition: all 0.22s ease;
}

.sidebar-item:hover {
  transform: scale(1.08);
}

.sidebar-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  background-color: #023641;
  color: #FFFFFF;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 50;
}

.sidebar-item:hover .sidebar-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* Stacking Context Hierarchy: Header & Dropdown above Sidebar Dock, Modals on Top */
.celex-header-wrapper,
header,
.celex-top-header {
  position: relative;
  z-index: 60 !important;
}

#userProfileMenu {
  z-index: 70 !important;
}

#sidebarDock {
  z-index: 40 !important;
}

#toggleSidebarBtn {
  z-index: 45 !important;
}

.celex-category-banner {
  position: relative;
  z-index: 10 !important;
}

.celex-search-container,
.celex-floating-search {
  position: relative;
  z-index: 30 !important;
}

#helpFaqModal,
#notificationsModal,
#chatModal,
#welcomeModal,
#docViewerChatModal,
#voiceModal {
  z-index: 100 !important;
}
