/* Reset y base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

:root {
  /* Minimalist Corporate Palette */
  --primary: #111827;
  --secondary: #374151;
  --accent: #3b82f6;
  --background: #f9fafb;
  --surface: #ffffff;
  --success: #065f46;
  --border: #d1d5db;
  --text: #111827;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;

  /* Tech accent colors */
  --tech-blue: #0ea5e9;
  --tech-green: #10b981;
  --tech-purple: #8b5cf6;
  --tech-orange: #f97316;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--accent), #1d4ed8);
  --gradient-tech: linear-gradient(45deg, var(--tech-blue), var(--tech-purple));
  --gradient-success: linear-gradient(135deg, var(--success), var(--tech-green));

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-tech: 0 0 20px rgba(59, 130, 246, 0.3);

  /* Animation durations */
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.6s;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  padding-top: 260px;
}

/* Tech Background */
.tech-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.circuit-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px), linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: circuitMove 20s linear infinite;
}

.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.floating-particles::before,
.floating-particles::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--tech-blue);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 0 10px var(--tech-blue);
}

.floating-particles::before {
  top: 20%;
  left: 10%;
  animation-delay: -2s;
}

.floating-particles::after {
  top: 60%;
  right: 15%;
  animation-delay: -4s;
}

.grid-overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.02) 0%, transparent 50%), radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.02) 0%, transparent 50%);
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(50px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-tech-accent {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.3;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: var(--tech-blue);
  letter-spacing: 2px;
}

.binary-stream {
  animation: binaryScroll 8s linear infinite;
}

.header-content {
  position: relative;
}

.tech-icon-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.tech-main-icon {
  font-size: 3rem;
  color: var(--accent);
  position: relative;
  z-index: 2;
}

.icon-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: iconPulse 2s ease-in-out infinite;
}

.header h1 {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 15px;
  letter-spacing: -0.5px;
  position: relative;
}

.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glitch-text:hover::before {
  animation: glitch1 0.5s ease-in-out;
  color: var(--tech-blue);
  z-index: -1;
}

.glitch-text:hover::after {
  animation: glitch2 0.5s ease-in-out;
  color: var(--tech-purple);
  z-index: -2;
}

.subtitle {
  font-size: 1.4rem;
  color: var(--secondary);
  font-weight: 400;
  margin-bottom: 30px;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--accent);
  animation: typewriter 3s steps(30) 1s forwards, blink 1s infinite;
  width: 0;
  margin: 0 auto 30px;
}

.tech-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
  gap: 20px;
}

.divider-line {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

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

.description {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
  margin-bottom: 20px;
  line-height: 1;
}

.highlight-tech {
  color: var(--accent);
  font-weight: 600;
  position: relative;
}

.highlight-tech::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient-tech);
  transform: scaleX(0);
  transition: transform var(--duration-normal) ease;
}

.highlight-tech:hover::after {
  transform: scaleX(1);
}

/* API Grid - Nuevo diseño de 4 columnas exactas */
.api-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 60px;
  min-height: 600px; /* Altura mínima para mantener consistencia */
}

/* API Card */
.api-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--duration-normal) ease;
  overflow: hidden;
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  display: flex;
  flex-direction: column;
}

.api-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-5px);
  border-color: var(--accent);
}

.card-tech-border {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-tech);
  transform: scaleX(0);
  transition: transform var(--duration-normal) ease;
}

.api-card:hover .card-tech-border {
  transform: scaleX(1);
}

.api-card-header {
  padding: 25px 25px 20px;
  border-bottom: 1px solid rgba(209, 213, 219, 0.5);
}

.api-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.api-icon {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.api-icon-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  z-index: 2;
  position: relative;
}

.icon-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65px;
  height: 65px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  animation: iconGlow 3s ease-in-out infinite;
}

.title-content {
  flex: 1;
  min-width: 0;
}

.api-title h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.2;
}

.api-tech-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tech-tag {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.api-version {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--gradient-success);
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.3);
  flex-shrink: 0;
}

.api-description {
  color: var(--secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.api-description strong {
  color: var(--primary);
  font-weight: 600;
}

.api-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--success);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.pulse {
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px var(--success);
}

.status-time {
  color: var(--text-light);
  font-weight: 400;
}

/* Card Body */
.api-card-body {
  padding: 20px 25px 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.api-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--secondary);
  padding: 6px;
  border-radius: 6px;
  transition: all var(--duration-fast) ease;
  position: relative;
}

.info-item:hover {
  background: rgba(59, 130, 246, 0.05);
  color: var(--primary);
}

.info-item i {
  color: var(--accent);
  width: 14px;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.info-indicator {
  margin-left: auto;
  width: 5px;
  height: 5px;
  background: var(--tech-green);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--tech-green);
}

/* Tech Metrics */
.tech-metrics {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(59, 130, 246, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.metric {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.metric:last-child {
  margin-bottom: 0;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-light);
  width: 85px;
  flex-shrink: 0;
}

.metric-bar {
  flex: 1;
  height: 5px;
  background: rgba(209, 213, 219, 0.3);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.metric-fill {
  height: 100%;
  background: var(--gradient-tech);
  border-radius: 3px;
  transition: width 1s ease;
  width: 0;
}

.metric-value {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  width: 50px;
  text-align: right;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: auto;
  margin-bottom: 15px;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all var(--duration-normal) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: 1px solid var(--accent);
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
  background: white;
  color: var(--secondary);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--primary);
}

/* API Health */
.api-health {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(16, 185, 129, 0.05);
  border-top: 1px solid rgba(16, 185, 129, 0.1);
}

.health-dots {
  display: flex;
  gap: 5px;
}

.health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(209, 213, 219, 0.5);
  transition: all var(--duration-fast) ease;
}

.health-dot.active {
  background: var(--tech-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.health-status {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
}

/* Coming Soon Card - Adaptada al nuevo grid */
.coming-soon {
  background: var(--surface);
  border-radius: 20px;
  border: 2px dashed rgba(59, 130, 246, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  padding: 30px 20px;
  opacity: 0;
  transform: translateY(30px);
}

.coming-soon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(59, 130, 246, 0.03), transparent);
  animation: rotate 20s linear infinite;
}

.coming-soon-content {
  position: relative;
  z-index: 2;
}

.tech-pattern {
  width: 60px;
  height: 2px;
  background: var(--gradient-tech);
  margin: 0 auto 20px;
}

.coming-soon h3 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.coming-soon p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

.coming-soon i.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Footer */
.footer {
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}

.footer-tech-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-tech);
}

.footer-content {
  padding: 40px 30px 30px;
  background: var(--surface);
  border-radius: 15px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(209, 213, 219, 0.3);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  color: var(--primary);
}

.footer-brand i {
  color: var(--accent);
  font-size: 1.3rem;
}

.footer-info p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.footer-tech {
  text-align: center;
}

.tech-specs {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.spec {
  font-size: 0.8rem;
  color: var(--text-lighter);
  font-family: 'Courier New', monospace;
}

.status-online {
  color: var(--tech-green);
  font-weight: 600;
}

.build-number,
.node-id {
  color: var(--accent);
  font-weight: 600;
}

/* Animations */
@keyframes circuitMove {
  0% {
    transform: translateX(0) translateY(0);
  }
  100% {
    transform: translateX(50px) translateY(50px);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.1);
  }
}

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

@keyframes iconPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.7;
  }
}

@keyframes glitch1 {
  0%,
  100% {
    transform: translate(0);
    opacity: 0;
  }
  20% {
    transform: translate(-2px, 2px);
    opacity: 1;
  }
  40% {
    transform: translate(-2px, -2px);
    opacity: 1;
  }
  60% {
    transform: translate(2px, 2px);
    opacity: 1;
  }
  80% {
    transform: translate(2px, -2px);
    opacity: 1;
  }
}

@keyframes glitch2 {
  0%,
  100% {
    transform: translate(0);
    opacity: 0;
  }
  20% {
    transform: translate(2px, -2px);
    opacity: 1;
  }
  40% {
    transform: translate(2px, 2px);
    opacity: 1;
  }
  60% {
    transform: translate(-2px, -2px);
    opacity: 1;
  }
  80% {
    transform: translate(-2px, 2px);
    opacity: 1;
  }
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 28rem;
  }
}

@keyframes blink {
  0%,
  50% {
    border-color: var(--accent);
  }
  51%,
  100% {
    border-color: transparent;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

@keyframes iconGlow {
  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

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

/* Responsive Design */
@media (max-width: 1200px) {
  .api-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .api-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 220px;
  }

  .container {
    padding: 20px 15px;
  }

  .header h1 {
    font-size: 2.5rem;
  }

  .header .subtitle {
    font-size: 1.2rem;
  }

  .api-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .api-card-header,
  .api-card-body {
    padding: 20px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .footer-main {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .tech-specs {
    flex-direction: column;
    gap: 10px;
  }

  .api-info {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .api-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .api-version {
    align-self: flex-start;
  }

  .coming-soon {
    padding: 25px 20px;
  }
}

/* Animation for cards appearing */
.api-card.animate,
.coming-soon.animate {
  animation: slideInUp 0.6s ease forwards;
}

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