/* ===== DOCS THEME — Colorful & Alive ===== */

/* Primary color variables (blue instead of violet) */
:root {
  --primary-hue: 217deg;
  --primary-saturation: 91%;
  --primary-lightness: 60%;
  --hextra-max-content-width: 85rem;
}

/* Sidebar: ensure container is visible on desktop */
@media (min-width: 768px) {
  .hextra-sidebar-container {
    display: flex;
  }
}

/* Gradient text for main heading */
.content h1:first-of-type {
  background: linear-gradient(135deg, #3b82f6, #06b6d4, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Colorful h2 headings */
.content h2 {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981) 1;
  padding-bottom: 4px;
}

/* Animated h3 headings */
.content h3 {
  color: #2563eb;
  position: relative;
  display: block;
}
.content h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.4s ease;
}
.content h3:hover::after {
  width: 100%;
}

/* Colorful cards with rainbow icon colors */
.hextra-card {
  border: 1px solid rgba(59, 130, 246, 0.2) !important;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(6, 182, 212, 0.03)) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.hextra-card:hover {
  transform: translateY(-4px) scale(1.01) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(6, 182, 212, 0.1) !important;
}
.hextra-card-icon {
  position: relative;
  overflow: hidden;
}
.hextra-card-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hextra-card:hover .hextra-card-icon::before {
  opacity: 1;
}

/* Rainbow colors for card icons */
.hextra-cards .hextra-card:nth-child(1) .hextra-card-icon svg { color: #3b82f6; }
.hextra-cards .hextra-card:nth-child(2) .hextra-card-icon svg { color: #06b6d4; }
.hextra-cards .hextra-card:nth-child(3) .hextra-card-icon svg { color: #10b981; }
.hextra-cards .hextra-card:nth-child(4) .hextra-card-icon svg { color: #f59e0b; }
.hextra-cards .hextra-card:nth-child(5) .hextra-card-icon svg { color: #ef4444; }
.hextra-cards .hextra-card:nth-child(6) .hextra-card-icon svg { color: #8b5cf6; }
.hextra-cards .hextra-card:nth-child(7) .hextra-card-icon svg { color: #ec4899; }
.hextra-cards .hextra-card:nth-child(8) .hextra-card-icon svg { color: #f97316; }

/* Colorful table */
.content table {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}
.content table thead {
  background: linear-gradient(135deg, #2563eb, #06b6d4) !important;
}
.content table thead th {
  color: white !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.content table tbody tr {
  transition: all 0.2s ease;
}
.content table tbody tr:hover {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), rgba(6, 182, 212, 0.03)) !important;
  transform: scale(1.002);
}

/* Code blocks with gradient border */
.content pre {
  border-left: 3px solid;
  border-image: linear-gradient(180deg, #3b82f6, #06b6d4) 1;
  border-radius: 8px;
}

/* Inline code */
.content code:not(pre code) {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.08)) !important;
  color: #2563eb !important;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* Blockquotes with gradient */
.content blockquote {
  border-left: 3px solid;
  border-image: linear-gradient(180deg, #3b82f6, #06b6d4, #10b981) 1;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), rgba(6, 182, 212, 0.03));
  border-radius: 0 8px 8px 0;
  padding: 12px 20px;
}

/* Lists with colorful bullets */
.content ul li::marker {
  color: #06b6d4;
}
.content ol li::marker {
  color: #3b82f6;
  font-weight: 600;
}

/* Horizontal rule with gradient */
.content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #10b981, transparent);
  margin: 2rem 0;
}

/* Sidebar active item glow */
.hextra-sidebar-active-item {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.06)) !important;
  border-right: 3px solid;
  border-image: linear-gradient(180deg, #3b82f6, #06b6d4) 1;
}

/* Table of contents links */
.hextra-toc a {
  position: relative;
  transition: all 0.2s ease;
}
.hextra-toc a:hover {
  color: #2563eb !important;
  padding-left: 4px;
}

/* Links with underline animation (exclude card links) */
.content a:not(.hextra-card) {
  position: relative;
  text-decoration: none !important;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 500;
}
.content a:not(.hextra-card)::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.content a:not(.hextra-card):hover::after {
  transform: scaleX(1);
}

/* Gradient badge for note/warning */
.content blockquote strong:first-child {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: white !important;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  -webkit-text-fill-color: white;
}

/* Definition lists / technical status tables */
.content table:nth-of-type(2) tbody tr td:first-child {
  font-weight: 600;
  color: #2563eb;
}

/* Card grid animation */
.hextra-cards {
  animation: fade-up 0.6s ease both;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hextra-cards .hextra-card:nth-child(1) { animation-delay: 0.05s; }
.hextra-cards .hextra-card:nth-child(2) { animation-delay: 0.1s; }
.hextra-cards .hextra-card:nth-child(3) { animation-delay: 0.15s; }
.hextra-cards .hextra-card:nth-child(4) { animation-delay: 0.2s; }
.hextra-cards .hextra-card:nth-child(5) { animation-delay: 0.25s; }
.hextra-cards .hextra-card:nth-child(6) { animation-delay: 0.3s; }
.hextra-cards .hextra-card:nth-child(7) { animation-delay: 0.35s; }
.hextra-cards .hextra-card:nth-child(8) { animation-delay: 0.4s; }

/* Page content fade-in */
.content {
  animation: content-fade 0.5s ease both;
}
@keyframes content-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scrollbar styling */
.hextra-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.hextra-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.hextra-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #06b6d4);
  border-radius: 3px;
}

/* ===== TUTORIALS THEME — Interactive Sandbox & Language Accents ===== */

/* Language accent colors */
body[class*="html"]  { --accent: #f97316; --accent-gradient: linear-gradient(135deg, #f97316, #fb923c); }
body[class*="css"]   { --accent: #3b82f6; --accent-gradient: linear-gradient(135deg, #3b82f6, #60a5fa); }
body[class*="javascript"] { --accent: #eab308; --accent-gradient: linear-gradient(135deg, #eab308, #facc15); }
body[class*="python"]{ --accent: #22c55e; --accent-gradient: linear-gradient(135deg, #22c55e, #4ade80); }
body[class*="bash"]  { --accent: #a855f7; --accent-gradient: linear-gradient(135deg, #a855f7, #c084fc); }
body[class*="ide"]   { --accent: #ec4899; --accent-gradient: linear-gradient(135deg, #ec4899, #f472b6); }

/* Sandbox container */
.sandbox-container {
  border: 2px dashed var(--accent, #f97316);
  border-radius: 16px;
  padding: 24px;
  margin: 2rem 0;
  background: linear-gradient(135deg, rgba(249,115,22,.04), rgba(251,146,60,.02));
  animation: sandbox-fade .4s ease both;
}
@keyframes sandbox-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.sandbox-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.sandbox-label {
  display: inline-block;
  background: var(--accent-gradient, linear-gradient(135deg, #f97316, #fb923c));
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sandbox-hint {
  color: #64748b;
  font-size: .8rem;
}
.sandbox-data {
  display: none;
}

/* Sandbox textarea */
.sandbox-textarea {
  width: 100%;
  min-height: 180px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  padding: 16px;
  border: 1px solid #334155;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  background: #0f172a;
  color: #e2e8f0;
  resize: vertical;
  tab-size: 2;
  outline: none;
  transition: border-color .2s ease;
  box-sizing: border-box;
}
.sandbox-textarea:focus {
  border-color: var(--accent, #f97316);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

/* Sandbox actions row */
.sandbox-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Sandbox buttons */
.sandbox-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .875rem;
  border: none;
  cursor: pointer;
  transition: all .2s ease;
}
.sandbox-btn-run {
  background: var(--accent-gradient, linear-gradient(135deg, #f97316, #fb923c));
  color: #fff;
}
.sandbox-btn-reset {
  background: #e2e8f0;
  color: #475569;
}
.sandbox-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.sandbox-btn:active { transform: translateY(0); }

/* Sandbox iframe preview */
.sandbox-preview {
  width: 100%;
  min-height: 220px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  margin-top: 12px;
  background: #fff;
  box-sizing: border-box;
  transition: opacity .2s ease;
}

/* Language badge */
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #fff;
}

/* Responsive sandbox */
@media (max-width: 640px) {
  .sandbox-textarea { min-height: 140px; font-size: 13px; padding: 12px; }
  .sandbox-preview { min-height: 160px; }
}

/* Dark mode sandbox */
.dark .sandbox-container {
  border-color: rgba(249,115,22,.3) !important;
  background: linear-gradient(135deg, rgba(249,115,22,.06), rgba(251,146,60,.03)) !important;
}
.dark .sandbox-btn-reset { background: #334155 !important; color: #cbd5e1 !important; }
.dark .sandbox-preview { border-color: #334155 !important; }
