/**
 * ====================================================================
 * LYRAN - Componentes UI de Alta Fidelidad
 * Botones, Tarjetas Glassmorphism, Badges, Mockups & Modales
 * ====================================================================
 */

/* --- BOTONES (CTA & ACCIONES) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 1.1rem 2.25rem;
  font-size: var(--text-base);
  border-radius: var(--radius-full);
}

/* Botón Primario: Gradiente Cian a Violeta con Resplandor */
.btn-primary {
  background: var(--gradient-primary);
  color: #0A0E1D;
  font-weight: var(--weight-bold);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-glow-btn);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: 0.6s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(77, 183, 255, 0.5), 0 0 45px rgba(198, 162, 255, 0.35);
  color: #050811;
}

.btn-primary:hover::before {
  left: 150%;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Botón Secundario Glassmorphism */
.btn-secondary,
.btn-glass {
  background: rgba(242, 245, 255, 0.05);
  color: var(--color-text-stars);
  border: 1px solid var(--border-glass);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
}

.btn-secondary:hover,
.btn-glass:hover {
  background: rgba(77, 183, 255, 0.12);
  border-color: rgba(77, 183, 255, 0.4);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(77, 183, 255, 0.2);
}

/* Botón con Borde Neón Sutil */
.btn-outline {
  background: transparent;
  color: var(--color-text-stars);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  border-color: var(--color-accent-violet);
  background: rgba(198, 162, 255, 0.08);
  color: var(--color-accent-violet);
  box-shadow: 0 0 20px rgba(198, 162, 255, 0.2);
}

/* Iconos dentro de botones */
.btn i, .btn svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.btn:hover i.lucide-arrow-right,
.btn:hover svg.lucide-arrow-right {
  transform: translateX(4px);
}

/* --- BADGES & CHIPS TECNOLÓGICOS --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.badge-tech {
  background: rgba(77, 183, 255, 0.08);
  border: 1px solid rgba(77, 183, 255, 0.2);
  color: #BBE1FF;
}

.badge-tech-violet {
  background: rgba(198, 162, 255, 0.08);
  border: 1px solid rgba(198, 162, 255, 0.22);
  color: #E2D1FF;
}

.badge-live {
  background: rgba(46, 213, 115, 0.1);
  border: 1px solid rgba(46, 213, 115, 0.3);
  color: #4cd964;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--color-accent-blue);
  box-shadow: 0 0 10px var(--color-accent-blue);
  animation: pulse-glow 2s infinite ease-in-out;
}

.pulse-dot.dot-green {
  background-color: #2ed573;
  box-shadow: 0 0 10px #2ed573;
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.6;
  }
}

/* --- TARJETAS GLASSMORPHISM & SPOTLIGHT --- */
.card-glass {
  background: var(--color-bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  position: relative;
  transition: var(--transition-base);
  overflow: hidden;
}

/* Efecto Spotlight dinámico con cursor */
.spotlight-card {
  position: relative;
  background: linear-gradient(175deg, rgba(20, 28, 56, 0.75) 0%, rgba(16, 23, 47, 0.85) 100%);
  border: 1px solid rgba(242, 245, 255, 0.08);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.35s var(--ease-spring), border-color 0.3s ease, box-shadow 0.35s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(77, 183, 255, 0.12),
    transparent 50%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.spotlight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(77, 183, 255, 0.5),
    rgba(198, 162, 255, 0.25),
    transparent 70%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.spotlight-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6), 0 0 30px rgba(77, 183, 255, 0.15);
}

.spotlight-card:hover::before,
.spotlight-card:hover::after {
  opacity: 1;
}

/* --- TARJETAS DE SERVICIOS (Estilo Orion AI) --- */
.card-service {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 3;
}

.service-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-lg);
  background: rgba(77, 183, 255, 0.08);
  border: 1px solid rgba(77, 183, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-blue);
  margin-bottom: var(--space-6);
  transition: var(--transition-base);
  box-shadow: 0 0 20px rgba(77, 183, 255, 0.1);
}

.spotlight-card:hover .service-icon-box {
  background: var(--gradient-primary);
  color: #0A0E1D;
  border-color: transparent;
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 0 25px rgba(77, 183, 255, 0.4);
}

.service-icon-box svg,
.service-icon-box i {
  width: 26px;
  height: 26px;
}

.service-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
  color: var(--color-text-stars);
}

.service-description {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.65;
  margin-bottom: var(--space-6);
  flex-grow: 1;
}

.service-features {
  list-style: none;
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.service-features li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: rgba(242, 245, 255, 0.8);
}

.service-features li i,
.service-features li svg {
  color: var(--color-accent-blue);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-accent-blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: auto;
  transition: var(--transition-fast);
}

.spotlight-card:hover .service-link {
  color: var(--color-accent-violet);
  gap: calc(var(--space-2) + 4px);
}

/* --- TARJETAS DE APLICACIONES (Estilo Artcraft Apps) --- */
.card-app {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-2xl);
  background: linear-gradient(175deg, rgba(20, 28, 56, 0.85) 0%, rgba(16, 23, 47, 0.95) 100%);
  border: 1px solid rgba(77, 183, 255, 0.15);
  overflow: hidden;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.4);
  transition: var(--transition-base);
}

.card-app:hover {
  transform: translateY(-8px);
  border-color: rgba(198, 162, 255, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(198, 162, 255, 0.2);
}

.app-preview-container {
  position: relative;
  width: 100%;
  height: 250px;
  background: #0B1021;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(242, 245, 255, 0.08);
}

.app-preview-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(16, 23, 47, 0.95) 100%);
  pointer-events: none;
}

.app-card-body {
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(77, 183, 255, 0.2), rgba(198, 162, 255, 0.2));
  border: 1px solid rgba(77, 183, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-stars);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.app-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-stars);
}

.app-category {
  font-size: var(--text-xs);
  color: var(--color-accent-blue);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.app-description {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

.app-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.app-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(242, 245, 255, 0.06);
}

/* --- MOCKUPS NATIVOS (CSS / SVG) --- */
.mockup-window {
  width: 90%;
  max-width: 420px;
  background: #141C38;
  border-radius: var(--radius-md);
  border: 1px solid rgba(77, 183, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: perspective(1000px) rotateX(8deg) rotateY(-8deg) scale(0.95);
  transition: transform 0.5s var(--ease-spring);
}

.card-app:hover .mockup-window {
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale(1);
}

.mockup-window-header {
  height: 28px;
  background: rgba(16, 23, 47, 0.8);
  border-bottom: 1px solid rgba(242, 245, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  gap: 6px;
}

.window-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.mockup-window-body {
  padding: var(--space-4);
  background: #0E152B;
  min-height: 150px;
}

.mockup-window-search {
  height: 18px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-xs);
  margin: 0 auto;
  width: 50%;
  opacity: 0.6;
}

/* Gráficos y UI estilizada dentro de mockups */
.mockup-chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 70px;
  margin-top: 15px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-bar-item {
  flex: 1;
  background: rgba(77, 183, 255, 0.25);
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
}

.chart-bar-item.active {
  background: var(--gradient-primary);
  box-shadow: 0 0 12px rgba(77, 183, 255, 0.5);
}

/* Mockup Mobile */
.mockup-phone {
  width: 170px;
  height: 230px;
  background: #0B1021;
  border: 3px solid rgba(77, 183, 255, 0.35);
  border-radius: 26px;
  padding: 8px;
  position: relative;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
  transform: perspective(800px) rotateY(-12deg) rotateX(10deg);
  transition: transform 0.5s var(--ease-spring);
}

.card-app:hover .mockup-phone {
  transform: perspective(800px) rotateY(0deg) rotateX(0deg) scale(1.04);
}

.phone-notch {
  width: 45px;
  height: 10px;
  background: #141C38;
  border-radius: 0 0 8px 8px;
  margin: 0 auto 10px auto;
}

.phone-card-skeleton {
  height: 38px;
  background: rgba(77, 183, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid rgba(77, 183, 255, 0.2);
}

/* --- FILTROS DE APPS --- */
.filter-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-12);
}

.filter-tab-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  background: rgba(242, 245, 255, 0.03);
  border: 1px solid rgba(242, 245, 255, 0.08);
  transition: var(--transition-fast);
  cursor: pointer;
}

.filter-tab-btn:hover {
  color: var(--color-text-stars);
  border-color: rgba(77, 183, 255, 0.3);
  background: rgba(77, 183, 255, 0.06);
}

.filter-tab-btn.active {
  background: rgba(77, 183, 255, 0.15);
  border-color: var(--color-accent-blue);
  color: #FFFFFF;
  box-shadow: 0 0 20px rgba(77, 183, 255, 0.25);
}

/* --- TARJETAS DE IMPACTO & ESTADÍSTICAS --- */
.card-stat {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: linear-gradient(170deg, rgba(20, 28, 56, 0.5) 0%, rgba(16, 23, 47, 0.8) 100%);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.stat-number-wrapper {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: var(--space-2);
}

.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.5vw, 3rem);
  font-weight: var(--weight-extrabold);
  line-height: 1;
}

.stat-suffix {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--color-accent-blue);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
}

.card-stat::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}

.card-stat:hover::after {
  opacity: 1;
}

/* --- TARJETAS DE PILARES / VALORES --- */
.pillar-card {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: rgba(20, 28, 56, 0.4);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-base);
}

.pillar-card:hover {
  background: rgba(27, 36, 71, 0.6);
  border-color: rgba(198, 162, 255, 0.3);
  transform: translateY(-4px);
}

.pillar-icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(198, 162, 255, 0.1);
  border: 1px solid rgba(198, 162, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-violet);
  margin-bottom: var(--space-4);
}

.pillar-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
  color: var(--color-text-stars);
}

.pillar-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* --- MODAL DIALOG --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 29, 0.85);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 100%;
  max-width: 680px;
  background: var(--color-bg-surface-elevated);
  border: 1px solid rgba(77, 183, 255, 0.25);
  border-radius: var(--radius-2xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 50px rgba(77, 183, 255, 0.15);
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s var(--ease-spring);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6) var(--space-8);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-stars);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.modal-body {
  padding: var(--space-8);
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  background: rgba(16, 23, 47, 0.5);
}
