/* ==========================================================================
   Aiversely — Tutorials & How-To Guides Hub Styles
   ========================================================================== */

.tutorials-hero {
  position: relative;
  padding: 2.5rem 0 1.5rem;
  background: radial-gradient(circle at top center, rgba(253, 42, 81, 0.08) 0%, transparent 70%);
}

.tutorials-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(253, 42, 81, 0.2);
  margin-bottom: 0.75rem;
}

body.dark .tutorials-kicker {
  background: rgba(253, 42, 81, 0.15);
  border-color: rgba(253, 42, 81, 0.35);
}

.tutorials-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.tutorials-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 720px;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

.tutorials-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

/* Control Bar */
.tutorials-control-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.tutorials-search-wrap {
  position: relative;
}

.tutorials-search-wrap .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}

.tutorials-search-input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.tutorials-search-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(253, 42, 81, 0.15);
}

/* Filter Buttons */
.filter-btn-pill {
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-secondary);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-btn-pill:hover {
  background: var(--surface-alt);
  color: var(--ink);
  border-color: var(--muted);
}

.filter-btn-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(253, 42, 81, 0.3);
}

/* Featured Tutorial Banner */
.featured-tutorial-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-tutorial-card:hover {
  border-color: rgba(253, 42, 81, 0.4);
  box-shadow: var(--shadow-lg);
}

.featured-tutorial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), #BC0650);
}

/* Tutorial Grid Cards */
.tutorial-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.tutorial-card:hover {
  transform: translateY(-3px);
  border-color: rgba(253, 42, 81, 0.35);
  box-shadow: var(--shadow-lg);
}

/* Header Inside Card */
.tutorial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.level-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.level-beginner {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.level-intermediate {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.level-advanced {
  background: #f5f3ff;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

body.dark .level-beginner {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

body.dark .level-intermediate {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

body.dark .level-advanced {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border-color: rgba(139, 92, 246, 0.3);
}

.tutorial-time {
  font-size: 0.8125rem;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.tutorial-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 0.65rem;
  transition: color 0.15s ease;
}

.tutorial-card-title a {
  color: inherit;
  text-decoration: none;
}

.tutorial-card-title a:hover {
  color: var(--primary);
}

.tutorial-card-desc {
  font-size: 0.8875rem;
  color: var(--ink-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

/* Info Box (Prereqs & Outcome) */
.tutorial-info-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.tutorial-info-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.tutorial-info-row:last-child {
  margin-bottom: 0;
}

.tutorial-info-label {
  font-weight: 700;
  color: var(--ink);
  min-width: 82px;
  flex-shrink: 0;
}

.tutorial-info-val {
  color: var(--muted);
}

.tutorial-outcome-val {
  color: var(--ink);
  font-weight: 500;
}

/* Step Milestone Pills */
.tutorial-steps-preview {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.tutorial-step-chip {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-secondary);
}

.tutorial-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

body.dark .tutorial-step-num {
  background: rgba(253, 42, 81, 0.2);
}

.tutorial-step-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* Footer & Buttons */
.tutorial-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.btn-start-tut {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.835rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.18s ease;
}

.btn-start-tut:hover {
  background: var(--primary-hover);
  color: #ffffff;
  border-color: var(--primary-hover);
  box-shadow: 0 3px 10px rgba(253, 42, 81, 0.25);
}

.btn-preview-tut {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  background: var(--surface-alt);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-preview-tut:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--muted);
}

/* Quick Modal Styling */
.tut-modal-code {
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  position: relative;
  overflow-x: auto;
  line-height: 1.5;
}

.tut-modal-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tut-modal-copy-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .tutorial-card {
    padding: 1.25rem;
  }
  .tutorial-card-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .btn-start-tut, .btn-preview-tut {
    justify-content: center;
    width: 100%;
  }
}

/* ==========================================================================
   Dedicated Standalone Tutorial Detail Page Styles (/tutorial/{slug})
   ========================================================================== */
.tutorial-detail-hero {
  position: relative;
  background: radial-gradient(circle at top left, rgba(253, 42, 81, 0.07) 0%, transparent 60%);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.tutorial-step-circle-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  border: 2px solid rgba(253, 42, 81, 0.25);
  flex-shrink: 0;
}

body.dark .tutorial-step-circle-badge {
  background: rgba(253, 42, 81, 0.18);
  border-color: rgba(253, 42, 81, 0.4);
}

.tutorial-step-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tutorial-step-card:hover {
  border-color: rgba(253, 42, 81, 0.3);
}

.cursor-pointer {
  cursor: pointer;
}
