/* Custom styles for Yaci DevKit docs */

/* Logo styling */
.nav-brand .logo {
  margin-right: 8px;
  vertical-align: middle;
}

/* Fix for navigation link underlines */
.nextra-nav-container a:visited {
  text-decoration: none !important;
}

/* Remove underline from all navigation links */
nav a,
nav a:hover,
nav a:visited,
nav a:focus,
nav a:active {
  text-decoration: none !important;
}

.hero-icon img {
  display: block;
  margin: 0 auto 16px auto;
}

.btn-primary img {
  vertical-align: middle;
}

/* Hide sidebar and TOC on homepage */
body:has([data-nextra-page-path="/"]) .nextra-sidebar-container,
body:has([data-nextra-page-path="/"]) .nextra-toc,
body:has([data-nextra-page-path="/"]) .nx-pl-max-\[16rem\] {
  display: none !important;
}

/* Make homepage full width */
body:has([data-nextra-page-path="/"]) .nextra-content {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Alternative selector for homepage layout */
[data-nextra-page-path="/"] ~ .nextra-sidebar-container,
[data-nextra-page-path="/"] ~ .nextra-toc {
  display: none !important;
}

/* Full width container for homepage */
.homepage-container {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0;
  max-width: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .homepage-container {
    margin-left: 0;
    width: 100%;
  }
}

/* Landing page specific styles */
.landing-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 12px;
  padding: 4rem 2rem 6rem 2rem;
  text-align: center;
  margin-bottom: 4rem;
}

.landing-hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #fff, #e0e7ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-hero .subtitle {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.landing-hero .description {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  background: #fff;
  color: #667eea;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-primary:hover {
  background: #f0f4ff;
  transform: translateY(-2px);
}

.btn-secondary {
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* Feature cards */
.feature-card {
  padding: 2rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  border-color: #667eea;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

/* Community links */
.community-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.community-link:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Video cards */
.video-card {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.video-card:hover {
  transform: scale(1.02);
}

/* Live Demo Section */
.live-demo {
  padding: 4rem 0;
  margin: 2rem 0;
}

.demo-header {
  text-align: center;
  margin-bottom: 3rem;
}

.demo-header h2 {
  margin-bottom: 1rem;
}

.demo-header p {
  color: rgba(0, 0, 0, 0.7);
}

.terminals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.mini-terminal {
  background: #0d1117;
  border-radius: 8px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 12px;
}

.terminal-header {
  background: #21262d;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #30363d;
}

.terminal-buttons {
  display: flex;
  gap: 6px;
}

.terminal-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.terminal-btn.close {
  background: #ff5f56;
}

.terminal-btn.minimize {
  background: #ffbd2e;
}

.terminal-btn.maximize {
  background: #27ca3f;
}

.terminal-title {
  color: #7d8590;
  font-size: 11px;
  font-weight: 500;
}

.terminal-body {
  padding: 12px;
  min-height: 120px;
  background: #0d1117;
  color: #7ee787;
  line-height: 1.4;
}

.terminal-line {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
}

.terminal-prompt {
  color: #7ee787;
  font-weight: 600;
}

.terminal-command {
  color: #f0f6fc;
  margin-left: 5px;
}

.terminal-output {
  margin: 6px 0 0 12px;
  color: #7ee787;
  opacity: 0;
}

.terminal-output div {
  margin-bottom: 2px;
  font-size: 11px;
}

/* Individual terminal animations - each loops independently */

/* Terminal 1: create-node (16s loop) */
.cmd-create {
  animation: typeCommand 3s steps(22) 1s infinite;
  border-right: 2px solid #7ee787;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}
.output-create {
  animation: showOutputStaggered 16s infinite;
  animation-delay: 4.4s; /* Wait for typing to complete */
}
.output-create div:nth-child(1) { animation: showLineStaggered 16s infinite; animation-delay: 4.4s; }
.output-create div:nth-child(2) { animation: showLineStaggered 16s infinite; animation-delay: 5.4s; }
.output-create div:nth-child(3) { animation: showLineStaggered 16s infinite; animation-delay: 6.4s; }
.output-create div:nth-child(4) { animation: showLineStaggered 16s infinite; animation-delay: 7.4s; }
.output-create div:nth-child(5) { animation: showLineStaggered 16s infinite; animation-delay: 8.4s; }

/* Terminal 2: topup (14s loop) */
.cmd-topup {
  animation: typeCommand 3.6s steps(30) 0.6s infinite;
  border-right: 2px solid #7ee787;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}
.output-topup {
  animation: showOutputStaggered 14s infinite;
  animation-delay: 4.6s; /* Wait for typing to complete */
}
.output-topup div:nth-child(1) { animation: showLineStaggered 14s infinite; animation-delay: 4.6s; }
.output-topup div:nth-child(2) { animation: showLineStaggered 14s infinite; animation-delay: 5.6s; }
.output-topup div:nth-child(3) { animation: showLineStaggered 14s infinite; animation-delay: 6.6s; }

/* Terminal 3: tip (10s loop) */
.cmd-tip {
  animation: typeCommand 0.8s steps(3) 0.4s infinite;
  border-right: 2px solid #7ee787;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}
.output-tip {
  animation: showOutputStaggered 10s infinite;
  animation-delay: 1.6s; /* Wait for typing to complete */
}
.output-tip div:nth-child(1) { animation: showLineStaggered 10s infinite; animation-delay: 1.6s; }
.output-tip div:nth-child(2) { animation: showLineStaggered 10s infinite; animation-delay: 2.4s; }
.output-tip div:nth-child(3) { animation: showLineStaggered 10s infinite; animation-delay: 3.2s; }
.output-tip div:nth-child(4) { animation: showLineStaggered 10s infinite; animation-delay: 4.0s; }

/* Terminal 4: utxos (12s loop) */
.cmd-utxos {
  animation: typeCommand 4s steps(26) 0.8s infinite;
  border-right: 2px solid #7ee787;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}
.output-utxos {
  animation: showOutputStaggered 12s infinite;
  animation-delay: 5.2s; /* Wait for typing to complete */
}
.output-utxos div:nth-child(1) { animation: showLineStaggered 12s infinite; animation-delay: 5.2s; }
.output-utxos div:nth-child(2) { animation: showLineStaggered 12s infinite; animation-delay: 6.0s; }
.output-utxos div:nth-child(3) { animation: showLineStaggered 12s infinite; animation-delay: 6.8s; }

/* Keyframes */
@keyframes typeCommand {
  0% {
    width: 0;
    border-right: 2px solid #7ee787;
  }
  70% {
    border-right: 2px solid #7ee787;
  }
  100% {
    width: 100%;
    border-right: none;
  }
}

@keyframes showOutputStaggered {
  0% { 
    opacity: 0; 
    transform: translateY(5px);
  }
  5% { 
    opacity: 1; 
    transform: translateY(0);
  }
  85% { 
    opacity: 1; 
    transform: translateY(0);
  }
  100% { 
    opacity: 0; 
    transform: translateY(-5px);
  }
}

/* Individual line animations for staggered effect */
.terminal-output div {
  opacity: 0;
  animation: showLineStaggered infinite;
}

@keyframes showLineStaggered {
  0% { 
    opacity: 0; 
    transform: translateY(3px);
  }
  2% { 
    opacity: 1; 
    transform: translateY(0);
  }
  85% { 
    opacity: 1; 
    transform: translateY(0);
  }
  100% { 
    opacity: 0; 
    transform: translateY(-3px);
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Responsive adjustments for live demo */
@media (max-width: 768px) {
  .live-demo {
    padding: 3rem 0;
  }
  
  .terminals-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }
  
  .mini-terminal {
    font-size: 11px;
  }
  
  .terminal-body {
    padding: 10px;
    min-height: 100px;
  }
  
  .terminal-header {
    padding: 6px 10px;
  }
  
  .terminal-title {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .demo-header h2 {
    font-size: 1.5rem;
  }
  
  .demo-header p {
    font-size: 0.9rem;
  }
  
  .mini-terminal {
    font-size: 10px;
  }
  
  .terminal-body {
    padding: 8px;
    min-height: 90px;
  }
  
  .terminal-output div {
    font-size: 10px;
  }
}

/* Professional Distribution Cards */
.distributions {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.distribution-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  padding: 0 1rem;
}

.distribution-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

.distribution-card-link:hover {
  text-decoration: none;
  transform: translateY(-8px);
}

.distribution-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.distribution-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.distribution-card:hover::before {
  opacity: 1;
}

.distribution-card:hover {
  box-shadow: 
    0 20px 25px rgba(0, 0, 0, 0.1),
    0 10px 10px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.2);
}

.distribution-card.featured {
  background: linear-gradient(145deg, #ffffff 0%, #f0f4ff 100%);
  border: 2px solid rgba(102, 126, 234, 0.2);
  transform: scale(1.02);
}

.distribution-card.featured::before {
  opacity: 1;
  height: 6px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.card-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.25);
  transition: all 0.3s ease;
}

.distribution-card:hover .card-icon-wrapper {
  transform: rotate(5deg) scale(1.1);
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.35);
}

.card-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: white;
  position: relative;
  overflow: hidden;
}

.card-badge::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.6s ease;
}

.distribution-card:hover .card-badge::before {
  left: 100%;
}

.card-badge.recommended {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.card-badge.alternative {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.card-badge.cicd {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.card-content {
  margin-bottom: 2rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.card-description {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.feature-tag {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4338ca;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(67, 56, 202, 0.1);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.card-cta {
  color: #667eea;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.distribution-card:hover .card-cta {
  color: #4f46e5;
  transform: translateX(4px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .distribution-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0;
  }
  
  .distribution-card {
    padding: 1.5rem;
  }
  
  .distribution-card.featured {
    transform: none;
  }
  
  .card-icon-wrapper {
    width: 50px;
    height: 50px;
  }
  
  .card-icon {
    font-size: 1.5rem;
  }
  
  .card-title {
    font-size: 1.3rem;
  }
}