/* ==============================================================================
   VibePackr Real-World Workflow Guide (How It Works) Styles
   ============================================================================== */

.howto-header {
  padding: 130px 0 50px;
  background: radial-gradient(circle at 50% 10%, rgba(37, 99, 235, 0.12) 0%, transparent 60%);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.howto-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.howto-title {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.howto-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 780px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* Sticky Step Bar */
.step-nav-bar {
  position: sticky;
  top: 68px;
  z-index: 90;
  background: rgba(7, 11, 20, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 0;
}

.step-nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 4px 24px;
}

.step-nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.step-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.step-nav-pill:hover,
.step-nav-pill.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.5);
  color: #ffffff;
}

.step-nav-pill .badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.step-nav-pill.active .badge {
  background: #2563eb;
  color: #ffffff;
}

/* Story Sections */
.story-section {
  padding: 80px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.story-section:nth-child(even) {
  background: rgba(12, 20, 39, 0.35);
}

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.story-grid.reverse .story-image-wrap {
  order: 1;
}

.story-grid.reverse .story-content {
  order: 2;
}

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

.story-index-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  letter-spacing: 0.05em;
}

.story-category {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.story-heading {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
  color: #ffffff;
}

.story-question {
  font-size: 1.05rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.story-question-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
}

.story-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.story-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.story-point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.55;
}

.story-point-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Code / Schema Preview Snippet */
.story-code-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
  overflow-x: auto;
}

.story-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.story-code-notice {
  font-size: 0.72rem;
  color: #fbbf24;
  padding: 5px 10px;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 4px;
  border-left: 2px solid #f59e0b;
  margin-bottom: 10px;
  font-family: var(--font-sans);
  line-height: 1.4;
}

.story-code-content {
  line-height: 1.5;
}
.story-code-content .key { color: #60a5fa; }
.story-code-content .str { color: #a5b4fc; }
.story-code-content .bool { color: #34d399; }
.story-code-content .num { color: #f59e0b; }

/* Image Visual Card */
.story-image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  background: #000000;
  cursor: pointer;
  transition: all 0.3s ease;
}

.story-image-wrap:hover {
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 24px 50px rgba(37, 99, 235, 0.25);
  transform: translateY(-2px);
}

.story-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.story-image-wrap:hover img {
  transform: scale(1.015);
}

.story-image-badge {
  position: absolute;
  bottom: 16px;
  right: 16px;
  padding: 6px 14px;
  background: rgba(7, 11, 20, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  pointer-events: none;
}

/* Responsiveness & Navbar Layout */
.navbar .container {
  max-width: 1440px;
  padding: 0 16px;
}

@media (min-width: 1025px) {
  .nav-menu {
    gap: 2px;
  }
  .nav-menu .nav-link {
    padding: 4px 6px;
    font-size: 0.76rem;
    letter-spacing: -0.01em;
  }
}

@media (min-width: 1025px) and (max-width: 1240px) {
  .navbar .container {
    padding: 0 12px;
  }
  .nav-menu {
    gap: 1px;
  }
  .nav-menu .nav-link {
    padding: 4px 4px;
    font-size: 0.72rem;
  }
  .nav-brand .nav-badge {
    display: none;
  }
}

@media (max-width: 1024px) {
  .story-grid, .story-grid.reverse {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .story-grid.reverse .story-image-wrap {
    order: 0;
  }
  .story-grid.reverse .story-content {
    order: 1;
  }
  .howto-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 640px) {
  .howto-title {
    font-size: 1.8rem;
  }
  .story-heading {
    font-size: 1.6rem;
  }
  .step-nav-bar {
    top: 64px;
  }
}

/* Diagram Captions */
.story-diagram-caption {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  color: #94a3b8;
  line-height: 1.5;
}

.story-diagram-caption strong {
  color: #38bdf8;
}

/* ==============================================================================
   Lightbox Modal & Thumbnail Strip Fix
   ============================================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(4, 7, 14, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s ease;
  overflow: hidden !important;
  box-sizing: border-box;
}

.lightbox-modal.active {
  display: flex !important;
  opacity: 1;
}

.lightbox-header {
  height: 68px;
  min-height: 68px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 15, 29, 0.95);
  z-index: 20;
  flex-shrink: 0;
}

.lightbox-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  max-width: calc(100vw - 220px);
}

.lightbox-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-counter {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.lightbox-concept-badge {
  font-size: 0.72rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.lightbox-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(96, 165, 250, 0.5);
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden !important;
  padding: 16px;
  min-height: 0;
  box-sizing: border-box;
}

.lightbox-img-wrapper {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  overflow: hidden;
}

.lightbox-img {
  max-width: 90vw;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: block;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-arrow:hover {
  background: #2563eb;
  border-color: #3b82f6;
  transform: translateY(-50%) scale(1.08);
}

.lightbox-arrow.prev { left: 16px; }
.lightbox-arrow.next { right: 16px; }

/* Lightbox Thumbnail Strip Fix */
.lightbox-footer {
  height: 74px !important;
  min-height: 74px !important;
  max-height: 74px !important;
  padding: 8px 20px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(10, 15, 29, 0.95) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  z-index: 20 !important;
}

.lightbox-thumb {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  position: relative !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  opacity: 0.45;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0 !important;
  background: #0f172a !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  margin: 0 !important;
}

.lightbox-thumb.active,
.lightbox-thumb:hover {
  opacity: 1;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  transform: translateY(-2px);
}

.lightbox-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  pointer-events: none;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 4px !important;
}

.lightbox-thumb .thumb-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.85);
  color: #38bdf8;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
  border: 1px solid rgba(56, 189, 248, 0.3);
  pointer-events: none;
}
