/* ============================================================
   ENHANCED STYLES — Mejoras visuales elegantes
   ============================================================ */

/* ── ANIMACIONES Y TRANSICIONES BASE ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
  50% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.1); }
}

/* ── SUPERCHARGED NAV & MENU ANIMATIONS ── */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] nav {
  background: rgba(28, 25, 23, 0.85);
}

nav.scrolled {
  border-bottom-color: var(--border2);
  box-shadow: 0 6px 24px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] nav.scrolled {
  box-shadow: 0 6px 24px -4px rgba(0, 0, 0, 0.45);
}

/* ── NAV LOGO INTERACTIVE ── */
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-logo:hover {
  transform: scale(1.04);
}

.nav-logo svg,
.nav-logo i {
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
}

.nav-logo:hover svg,
.nav-logo:hover i {
  transform: rotate(-8deg) scale(1.14);
  filter: drop-shadow(0 2px 10px var(--primary));
}

.nav-logo span {
  transition: filter 0.25s ease, letter-spacing 0.25s ease;
}

.nav-logo:hover span {
  filter: brightness(1.15);
  letter-spacing: -0.01em;
}

/* ── NAV BUTTONS WITH SPRING PHYSICS ── */
.nav-btn {
  position: relative;
  padding: 7px 15px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease,
              box-shadow 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Garantizar que el texto y los iconos SIEMPRE estén por encima y 100% visibles */
.nav-btn span,
.nav-btn .nav-txt {
  position: relative;
  z-index: 2;
  opacity: 1 !important;
  visibility: visible !important;
  color: inherit;
  transition: color 0.2s ease;
}

@media (min-width: 769px) {
  .nav-btn .nav-txt {
    display: inline !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

.nav-btn i {
  position: relative;
  z-index: 2;
  font-size: 16px;
  display: inline-block;
  opacity: 1 !important;
  visibility: visible !important;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.22s ease;
}

.nav-btn:hover {
  background: var(--surface2);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.08);
}

.nav-btn:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.nav-btn.active {
  border-color: var(--primary);
  background: var(--surface2);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Micro-animaciones en iconos del menú al hover */
.nav-btn:hover i.ti-code {
  transform: scale(1.25) rotate(-8deg);
  color: var(--primary);
}

.nav-btn:hover i.ti-search {
  transform: scale(1.22) rotate(18deg);
  color: var(--primary);
}

.nav-btn:hover i.ti-file-text {
  transform: translateY(-2px) scale(1.18);
  color: var(--primary);
}

.nav-btn:hover i.ti-plus {
  transform: rotate(90deg) scale(1.22);
}

.nav-btn:hover i.ti-user {
  transform: translateY(-2px) scale(1.2);
  color: var(--primary);
}

.nav-btn:hover i.ti-login {
  transform: translateX(3px) scale(1.16);
  color: var(--primary);
}

.nav-btn:hover i.ti-home {
  transform: scale(1.22) translateY(-1px);
  color: var(--primary);
}

/* ── BOTÓN DE ACCIÓN PRINCIPAL (NUEVA ENCUESTA) ── */
.nav-btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 3px 12px -2px var(--primary), 0 2px 6px rgba(0, 0, 0, 0.12) !important;
  position: relative;
  overflow: hidden;
}

.nav-btn.primary span,
.nav-btn.primary .nav-txt,
.nav-btn.primary i {
  color: #ffffff !important;
}

.nav-btn.primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-25deg);
  transition: left 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

.nav-btn.primary:hover {
  background: linear-gradient(135deg, var(--primary) 20%, var(--primary-dark) 100%) !important;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px -2px var(--primary), 0 3px 8px rgba(0, 0, 0, 0.2) !important;
  color: #ffffff !important;
}

.nav-btn.primary:hover span,
.nav-btn.primary:hover .nav-txt,
.nav-btn.primary:hover i {
  color: #ffffff !important;
}

.nav-btn.primary:hover::after {
  left: 160%;
}

/* ── TOGGLE TEMA & SELECTOR IDIOMA ── */
#theme-toggle-btn {
  padding: 7px 10px;
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#theme-toggle-btn:hover {
  background: var(--surface2);
  transform: translateY(-2px);
}

#theme-toggle-btn:hover i {
  transform: rotate(35deg) scale(1.22);
  color: var(--primary);
}

#theme-toggle-btn:active i {
  transform: rotate(180deg) scale(0.9);
}

#lang-selector {
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

#lang-selector:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px var(--primary-light);
}

#lang-selector:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── AVATAR EN LA BARRA DE NAVEGACIÓN ── */
#nav-user-area img,
nav img[onclick*="renderProfileScreen"],
nav div[onclick*="renderProfileScreen"] {
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

#nav-user-area img:hover,
nav img[onclick*="renderProfileScreen"]:hover,
nav div[onclick*="renderProfileScreen"]:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 3px var(--primary-light), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── CARDS CON PROFUNDIDAD ── */
.survey-card,
.feed-card,
.how-card,
.privacy-card,
.response-history-card {
  animation: fadeInUp 0.5s ease-out;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.survey-card::before,
.feed-card::before,
.how-card::before,
.privacy-card::before,
.response-history-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.survey-card:hover::before,
.feed-card:hover::before,
.how-card:hover::before,
.privacy-card:hover::before,
.response-history-card:hover::before {
  opacity: 1;
}

.survey-card:hover,
.feed-card:hover,
.how-card:hover,
.privacy-card:hover,
.response-history-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

/* ── HERO MEJORADO ── */
.home-hero {
  position: relative;
  overflow: hidden;
}

.home-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}

.hero-badge {
  animation: slideInLeft 0.6s ease-out 0.1s both;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.hero-badge:hover {
  background: rgba(255,255,255,0.2);
  transform: translateX(2px);
}

.home-hero h1 {
  animation: slideInLeft 0.6s ease-out 0.2s both;
}

.home-hero p {
  animation: slideInLeft 0.6s ease-out 0.3s both;
}

.hero-btn {
  animation: fadeInUp 0.6s ease-out 0.4s both;
  position: relative;
  overflow: hidden;
}

.hero-btn.white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.hero-btn.outline:hover {
  transform: translateY(-2px);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.15);
}

/* ── INPUTS Y FORMS MEJORADOS ── */
.form-input,
.form-select,
.form-textarea {
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--surface);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 
              inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.form-input::placeholder {
  transition: color 0.25s ease;
}

.form-input:focus::placeholder {
  color: var(--text3);
}

/* ── BADGES MEJORADAS ── */
.badge {
  animation: fadeInUp 0.4s ease-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  font-weight: 600;
  letter-spacing: 0.3px;
}

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

.badge.active {
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.badge.draft {
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

/* ── QUESTION TYPES MEJORADOS ── */
.q-type-btn {
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.4s ease-out;
}

.q-type-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.5), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.q-type-btn:hover::after {
  opacity: 1;
}

.q-type-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.2);
  border-color: var(--primary);
}

.q-type-btn i {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.q-type-btn:hover i {
  transform: scale(1.15) rotate(2deg);
}

/* ── FEED CARDS MEJORADAS (Estilo Glassmórfico Táctil unificado) ── */
.feed-card-icon {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feed-quiz-badge {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeInUp 0.4s ease-out;
}

/* ── FEED CARD BUTTONS ── */
.feed-card-btn {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: var(--primary);
  color: white;
  border: none;
}

.feed-card-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.feed-card-btn:hover::before {
  left: 100%;
}

.feed-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(79, 70, 229, 0.3);
}

.feed-card-share {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.feed-card-share:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── PROFILE TABS MEJORADOS ── */
.profile-tab {
  position: relative;
}

.profile-tab.active {
  animation: fadeInUp 0.3s ease-out;
}

/* ── FILTER CHIPS MEJORADOS ── */
.filter-chip {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  border-radius: inherit;
}

.filter-chip:hover::before,
.filter-chip.active::before {
  transform: scaleX(1);
}

.filter-chip:hover {
  color: white;
  border-color: var(--primary);
}

/* ── SPINNER MEJORADO ── */
.spinner {
  animation: spin 1s linear infinite;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* ── MODALES MEJORADOS ── */
.modal-overlay {
  animation: fadeInUp 0.25s ease-out;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* ── LOGIN CARD MEJORADA ── */
.login-card {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.login-card h2 {
  animation: slideInLeft 0.5s ease-out 0.1s both;
}

/* ── QUESTION CARD MEJORADA ── */
.question-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-left: 3px solid var(--primary);
}

.question-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  transform: translateX(2px);
}

.question-card.selected {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--surface) 100%);
  box-shadow: 0 0 0 2px var(--primary);
}

/* ── ANÁLISIS Y CHARTS MEJORADOS ── */
.analysis-card {
  animation: fadeInUp 0.4s ease-out;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.analysis-card:hover {
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.chart-wrap {
  transition: opacity 0.3s ease;
}

.analysis-card:hover .chart-wrap {
  opacity: 1;
}

/* ── SECTION HEADERS MEJORADOS ── */
.section-header h2 {
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-header:hover h2::after {
  width: 100%;
}

/* ── SEARCH BAR MEJORADA ── */
.search-bar {
  position: relative;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255,255,255,0.3) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-bar:focus-within {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2),
              0 8px 20px rgba(79, 70, 229, 0.15);
  transform: translateY(-2px);
}

.search-bar:focus-within::before {
  opacity: 1;
}

/* ── LINK HOVER EFFECTS ── */
a {
  position: relative;
  transition: color 0.25s ease;
}

/* ── SMOOTH PAGE TRANSITIONS & HARDWARE ACCELERATION ── */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
  animation: screenEnter 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenEnter {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* ── SKELETON LOADERS (High-Performance Data Loading) ── */
.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    var(--surface2) 0%,
    var(--border) 50%,
    var(--surface2) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite ease-in-out;
  border-radius: 6px;
  transform: translateZ(0);
}

[data-theme="dark"] .skeleton-shimmer {
  background: linear-gradient(
    90deg,
    #24201e 0%,
    #38322e 50%,
    #24201e 100%
  );
  background-size: 200% 100%;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.feed-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.skeleton-feed-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  height: 230px;
}

.skeleton-feed-card-header {
  height: 52px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.skeleton-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.skeleton-badge {
  width: 90px;
  height: 22px;
  border-radius: 12px;
}

.skeleton-feed-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-title {
  height: 20px;
  width: 75%;
}

.skeleton-desc {
  height: 14px;
  width: 90%;
}

.skeleton-desc-sub {
  height: 14px;
  width: 55%;
}

.skeleton-meta {
  height: 16px;
  width: 60%;
  margin-top: auto;
}

/* Card rendering optimization (off-screen layout containment) */
.feed-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 240px;
  contain: layout style paint;
}

.survey-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 160px;
}

/* ── ICON ANIMATIONS ── */
i[class*="ti-"] {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

/* ── HOW CARD MEJORADA ── */
.how-icon {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.how-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.3));
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.how-card:hover .how-icon::before {
  transform: translateX(100%);
}

.how-card:hover .how-icon {
  transform: scale(1.1) rotate(-5deg);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
}

/* ── PRIVACY ICON MEJORADO ── */
.privacy-icon {
  position: relative;
  transition: all 0.3s ease;
  animation: fadeInUp 0.4s ease-out;
}

.privacy-card:hover .privacy-icon {
  transform: scale(1.15) rotate(3deg);
}

/* ── FAQ MEJORADO ── */
.faq-item {
  animation: fadeInUp 0.4s ease-out;
  transition: all 0.3s ease;
}

.faq-item:hover {
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.15);
  transform: translateX(2px);
}

.faq-question {
  transition: all 0.25s ease;
  position: relative;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer.open {
  animation: slideInLeft 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── PROFILE AVATAR MEJORADO ── */
.profile-avatar {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid var(--primary);
}

.profile-avatar-wrap:hover .profile-avatar {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.2);
}

.profile-avatar-edit {
  transition: all 0.25s ease;
  animation: fadeInUp 0.4s ease-out;
}

.profile-avatar-edit:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* ── STAT CARDS MEJORADOS ── */
.stat-card {
  animation: fadeInUp 0.4s ease-out;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

/* ── EMPTY STATE MEJORADO ── */
.empty-state {
  animation: fadeInUp 0.5s ease-out;
}

.empty-state i {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: pulse 2s ease-in-out infinite;
}

/* ── LOADING STATE ── */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2s infinite;
  background-size: 1000px 100%;
}

/* ── DARK MODE COMPATIBILITY ── */
[data-theme="dark"] .search-bar {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255,255,255,0.1) 100%);
}

[data-theme="dark"] .feed-card {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255,255,255,0.1) 100%);
}

[data-theme="dark"] .hero-badge {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── SMOOTH TRANSITIONS ── */
* {
  transition-property: background-color, border-color, color, box-shadow, transform, opacity;
}

html {
  scroll-behavior: smooth;
}

/* ── FOCUS VISIBLE MEJORADO ── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── SELECTION MEJORADA ── */
::selection {
  background: var(--primary);
  color: white;
}

::-moz-selection {
  background: var(--primary);
  color: white;
}

/* ── RESPONSIVE ANIMATIONS ── */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── PERFORMANCE OPTIMIZATIONS ── */
@media (hover: hover) and (pointer: fine) {
  .nav-btn:hover,
  .hero-btn:hover,
  .feed-card:hover,
  .q-type-btn:hover {
    will-change: transform, box-shadow;
  }
}

@media (hover: none) {
  .nav-btn:hover,
  .hero-btn:hover,
  .feed-card:hover {
    transform: none;
  }
}
