/* Fontes Google: Roboto (principal) + Inter (fallback) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Inter:wght@400;500;700&display=swap');

/* Reset básico e configurações globais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
  padding: 0 16px;
  /* mobile first: lateral menor */
}

/* ===== NAVBAR ===== */

.navbar {
  background-color: rgba(36, 38, 20, 0.95);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  margin: 0 -16px;
  padding: 0 16px;
}

.navbar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  max-width: 1400px;
  margin: 0 auto;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.navbar-logo {
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-link:hover {
  color: var(--accent-secondary);
  transform: translateY(-1px);
}

.navbar-link .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Responsive navbar */
@media (max-width: 768px) {
  .navbar {
    margin: 0 -16px;
  }

  .navbar-content {
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
  }

  .navbar-link {
    font-size: 0.85rem;
  }
}

@media (min-width: 768px) {
  .navbar {
    margin: 0 -40px;
    padding: 0 40px;
  }

  .navbar-content {
    padding: 14px 0;
  }

  .navbar-logo {
    font-size: 1.3rem;
  }
}

/* ===== HEADER – MOBILE FIRST ===== */

header {
  display: flex;
  flex-direction: column;
  /* empilha no mobile */
  align-items: stretch;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Estilização da barra de busca - mobile em coluna */
.search-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  margin-left: 0;
  /* sem recuo no mobile */
  gap: 8px;
}

.search-bar input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  /* pill completo no mobile */
  background-color: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-bar input[type="text"]:focus {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 8px rgba(217, 115, 26, 0.5);
}

/* Botão full-width no mobile */
.search-bar button {
  width: 100%;
  padding: 12px 18px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: var(--gradient-primary);
  color: #FFFFFF;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-bar button:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(217, 115, 26, 0.4);
}

/* ===== MAIN ===== */

main {
  flex: 1;
  padding: 16px 0 20px;
}

/* Estilização dos itens de conteúdo na seção main */
.content-item {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(191, 36, 122, 0.2);
}

.content-item h2 {
  color: var(--accent-secondary);
  margin-bottom: 12px;
}

.content-item p {
  margin-bottom: 12px;
}

.content-item .read-more {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 700;
}

/* ===== LANGUAGE TAGS – MOBILE: CARROSSEL HORIZONTAL ===== */

.language-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 20px;
  padding: 8px 0 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.language-tags::-webkit-scrollbar {
  height: 4px;
}

.language-tags::-webkit-scrollbar-track {
  background: transparent;
}

.language-tags::-webkit-scrollbar-thumb {
  background: rgba(129, 43, 140, 0.7);
  border-radius: 999px;
}

.language-tag {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  /* vira "chip" rolável */
}

.language-tag .tag-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.language-tag .tag-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.language-tag .tag-icon--fallback {
  width: auto;
  min-width: 30px;
  padding: 0 6px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.15);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.language-tag:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(191, 36, 122, 0.2);
}

/* ===== CODE BLOCKS ===== */

.doc-link {
  margin-top: 12px;
}

.doc-link a {
  color: var(--accent-secondary);
  text-decoration: underline;
  font-weight: 600;
}

.code-example {
  margin-top: 1.5rem;
}

.code-example h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* Container do código (pode ser div, pre ou code com essa classe) */
.code-block {
  background: #272822;
  color: #f8f8f2;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  max-width: 100%;
  font-family: "Fira Code", "JetBrains Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.5;

  /* garante que o bloco não “empurre” a página no mobile */
  white-space: pre;
}

/* Se você usar <pre> ou <code> dentro do .code-block */
.code-block pre,
.code-block code {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}

/* Monokai-ish */
.code-block .keyword {
  color: #66d9ef;
}

.code-block .string {
  color: #e6db74;
}

.code-block .number {
  color: #ae81ff;
}

.code-block .comment {
  color: #75715e;
}

.code-block .func {
  color: #a6e22e;
}

.code-block .var {
  color: #f92672;
}

/* ===== Ajustes responsivos específicos para o code ===== */
@media (max-width: 768px) {
  .code-block {
    font-size: 0.8rem;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .code-block {
    font-size: 0.75rem;
    padding: 0.7rem;

    /* Opcional: permite quebrar linhas ao invés de scroll infinito horizontal */
    white-space: pre-wrap;
    word-break: break-word;
  }

  .code-block pre,
  .code-block code {
    white-space: inherit;
  }
}

/* ========================================
   FOOTER - CLEAN & MODERN
   ======================================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 60px 0 20px;
  margin-top: 80px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 60px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 350px;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px;
}

.footer-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.footer-column h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 10px;
}

.footer-column a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-column a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copy,
.footer-dev,
.footer-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-dev a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-dev a:hover {
  color: var(--accent-primary);
}

.heart {
  color: var(--accent-primary);
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .footer {
    padding: 40px 0 20px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-nav {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }
}

/* =========================
   DESKTOP / TABLET – mantém "como está"
   ========================= */

@media (min-width: 768px) {
  body {
    padding: 0 40px;
    /* volta ao padding original no PC */
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
  }

  h1 {
    font-size: 1.8rem;
    white-space: nowrap;
  }

  .search-bar {
    flex-direction: row;
    align-items: center;
    width: 100%;
    flex: 1;
    margin-left: 40px;
    /* volta o espaçamento original */
    gap: 0;
  }

  .search-bar input[type="text"] {
    padding: 15px;
    border-radius: 50px 0 0 50px;
    /* como no seu layout original */
  }

  .search-bar button {
    width: auto;
    padding: 15px 25px;
    border-radius: 0 50px 50px 0;
  }

  main {
    padding: 20px;
  }

  .content-item {
    padding: 25px;
    margin-bottom: 20px;
  }

  .language-tags {
    justify-content: center;
    flex-wrap: wrap;
    /* volta pro comportamento original */
    overflow-x: visible;
    /* sem carrossel no desktop */
  }

  .language-tag {
    flex: 0 0 auto;
  }


}

/* HERO provisório */
.hero {
  text-align: center;
  padding: 40px 20px;
}

.hero-logo {
  width: 120px;
  height: auto;
  margin-bottom: 20px;
  opacity: 0.95;
  filter: drop-shadow(0 0 6px rgba(217, 115, 26, 0.25));
}

.hero h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  line-height: 1.2;
}

.hero h2 span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text {
  font-size: 1.05rem;
  max-width: 680px;
  margin: 0 auto 12px;
  opacity: 0.9;
}

/* HERO com vídeo background */
.hero-video-section {
  position: relative;
  width: 100%;
  height: 55vh;
  min-height: 360px;
  border-radius: 12px;
  overflow: hidden;
  margin: 40px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Vídeo cobrindo toda a área */
.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-video-bg iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  /* evita cliques no vídeo */
}

/* Overlay escuro para leitura */
.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(1px);
  z-index: 2;
}

/* Conteúdo do hero */
.hero-video-content {
  position: relative;
  z-index: 3;
  max-width: 900px;
  padding: 20px;
  text-align: center;
  color: #FFF;
}

.hero-video-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-video-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 12px;
  color: var(--text-primary);
}

/* MOBILE FIRST */
@media (max-width: 768px) {
  .hero-video-section {
    height: 45vh;
  }

  .hero-video-content h2 {
    font-size: 1.6rem;
  }

  .hero-video-content p {
    font-size: 1rem;
  }
}

/* ============================
   HERO "revista" CodeImag.in
   ============================ */

.hero-section {
  margin-top: 2rem;
  padding: 1.8rem 1.5rem;
  background: radial-gradient(circle at top left, #33341f 0%, #242614 45%, #18190e 100%);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

/* Container interno: mobile first (coluna) */
.hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

/* Bloco da imagem */
.hero-media {
  display: flex;
  justify-content: center;
}

/* Moldura da imagem com tilt */
.hero-image-frame {
  position: relative;
  max-width: 260px;
  width: 100%;
  transform: rotate(-8deg);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    filter 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Borda luminosa atrás da imagem */
.hero-image-frame::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  background: linear-gradient(135deg, #bf247a, #d9731a);
  opacity: 0.6;
  z-index: -1;
  filter: blur(4px);
}

/* Imagem em si */
.hero-image {
  display: block;
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
}

/* Efeito no hover (desktop) */
.hero-image-frame:hover {
  transform: rotate(-2deg) translateY(-6px) scale(1.03);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.75);
  filter: brightness(1.05);
}

/* Texto estilo revista */
.hero-copy {
  text-align: left;
}

/* Kicker (linha de cima, tipo subtítulo de revista) */
.hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #d9731a;
  margin-bottom: 0.75rem;
}

/* Título principal da seção */
.hero-copy h2 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Parágrafo de destaque */
.hero-lead {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 0.9rem;
}

/* Parágrafos gerais do hero */
.hero-copy p {
  font-size: 0.95rem;
  color: #eaeaea;
}

/* Área do vídeo logo abaixo do hero */
.hero-video-area {
  margin-top: 1.8rem;
}

/* Wrapper responsivo 16:9 para o YouTube */
.hero-video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #812b8c;
  background: radial-gradient(circle at center, #3a3b23 0%, #18190e 90%);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
}

/* Media query adjustments for hero-video-wrapper */
@media (min-width: 768px) {
  .hero-video-wrapper {
    flex: 1;
    max-width: 560px;
    padding: 0;
  }
}

/* iFrame em full dentro do wrapper */
.hero-video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================
   Ajustes para telas maiores
   ============================ */
@media (min-width: 768px) {
  .hero-section {
    padding: 2.2rem 2rem;
  }

  .hero-inner {
    flex-direction: row;
    align-items: center;
  }

  .hero-media {
    flex: 0 0 38%;
  }

  .hero-copy {
    flex: 1;
    padding-left: 2rem;
  }

  .hero-copy h2 {
    font-size: 2rem;
  }

  .hero-lead {
    font-size: 1.05rem;
  }

  .hero-copy p {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .hero-section {
    margin-top: 2.5rem;
    padding: 2.4rem;
  }

  .hero-copy h2 {
    font-size: 2.3rem;
  }

  .hero-lead {
    font-size: 1.1rem;
  }
}

/* ===== SUBSTACK CTA ===== */

.substack-cta {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(191, 36, 122, 0.1) 0%, rgba(217, 115, 26, 0.1) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.substack-cta::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(217, 115, 26, 0.15) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.5;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.substack-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(191, 36, 122, 0.3);
  border-color: var(--accent-primary);
}

.substack-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-secondary);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.substack-cta:hover .substack-icon {
  transform: scale(1.1) rotate(5deg);
  color: var(--accent-primary);
}

.substack-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 8px rgba(217, 115, 26, 0.4));
}

.substack-text {
  position: relative;
  z-index: 1;
}

.substack-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.substack-description {
  font-size: 0.9rem;
  color: var(--text-primary);
  opacity: 0.9;
  line-height: 1.5;
  margin: 0;
}

.substack-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(191, 36, 122, 0.3);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.substack-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.substack-button:hover::before {
  left: 100%;
}

.substack-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 115, 26, 0.5);
}

.substack-button .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.substack-button:hover .arrow {
  transform: translateX(4px);
}

/* Responsive Substack CTA */
@media (min-width: 768px) {
  .substack-cta {
    flex-direction: row;
    text-align: left;
    padding: 1.8rem 2rem;
    gap: 1.5rem;
  }

  .substack-icon {
    width: 56px;
    height: 56px;
  }

  .substack-text {
    flex: 1;
  }

  .substack-title {
    font-size: 1.2rem;
  }

  .substack-description {
    font-size: 0.95rem;
  }
}


/* ===== CODE EDITOR MODAL ===== */

/* Modal */
.code-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.code-editor-modal.hidden {
  display: none;
}

.code-editor-modal.active {
  opacity: 1;
}

.code-editor-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.code-editor-container {
  position: relative;
  width: 95%;
  max-width: 1400px;
  height: 85vh;
  max-height: 900px;
  background: #1e1e1e;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.code-editor-modal.active .code-editor-container {
  transform: scale(1);
}

/* Header */
.code-editor-header {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-editor-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #FFFFFF;
}

.code-editor-title .code-icon {
  width: 24px;
  height: 24px;
}

.code-editor-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
  background: none;
  -webkit-text-fill-color: #FFFFFF;
}

.code-editor-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #FFFFFF;
}

.code-editor-close svg {
  width: 20px;
  height: 20px;
}

.code-editor-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Split Panes */
.code-editor-panes {
  flex: 1;
  display: flex;
  gap: 1px;
  background: #2a2a2a;
  overflow: hidden;
}

.code-editor-pane {
  flex: 1;
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-pane {
  flex: 1.5;
}

.output-pane {
  flex: 1;
}

.pane-header {
  background: #2a2a2a;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #3a3a3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pane-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pane-hint {
  font-size: 0.75rem;
  color: #888;
  font-style: italic;
}

.clear-console-btn {
  background: transparent;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.clear-console-btn svg {
  width: 16px;
  height: 16px;
}

.clear-console-btn:hover {
  background: rgba(217, 115, 26, 0.1);
  color: var(--accent-secondary);
}

/* Code Editor */
.code-editor-wrapper {
  flex: 1;
  display: flex;
  overflow: auto;
  position: relative;
  background: #1e1e1e;
}

.line-numbers {
  padding: 1rem 0.5rem 1rem 1rem;
  background: #252525;
  color: #858585;
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: right;
  user-select: none;
  white-space: pre;
  overflow: hidden;
  border-right: 1px solid #3a3a3a;
  min-width: 50px;
}

.code-editor-textarea {
  flex: 1;
  padding: 1rem;
  background: #1e1e1e;
  color: #d4d4d4;
  border: none;
  outline: none;
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: none;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
  tab-size: 2;
}

.code-editor-textarea::placeholder {
  color: #555;
}

/* Output Console */
.code-editor-output {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  font-family: 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: #1a1a1a;
}

.output-welcome {
  color: #888;
  text-align: center;
  padding: 2rem 1rem;
}

.output-welcome p {
  margin: 0.5rem 0;
}

.output-line {
  display: flex;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  align-items: flex-start;
}

.output-time {
  color: #666;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.output-icon {
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.output-message {
  flex: 1;
  word-break: break-word;
  white-space: pre-wrap;
}

.output-log {
  color: #d4d4d4;
}

.output-log .output-icon {
  color: #4EC9B0;
}

/* Modern Clean Book List */
.books-section {
  margin: 4rem 0;
  text-align: center;
  padding: 0 1rem;
  position: relative;
}

.books-section .section-title {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.books-carousel {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.carousel-slides {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 20px 4rem;
  /* Space for shadow and buttons */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.carousel-slides::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  min-width: 280px;
  max-width: 280px;
  scroll-snap-align: center;
  background: rgba(45, 47, 30, 0.6);
  /* Subtle dark background */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
}

.carousel-slide:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border-color: rgba(217, 115, 26, 0.5);
}

.carousel-slide .book-cover {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.5s ease;
}

.carousel-slide:hover .book-cover {
  transform: scale(1.05);
}

.book-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.book-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.book-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.book-link:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #FFF;
  transform: translateY(-2px);
}

/* Navigation Buttons */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(36, 38, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFF;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-nav:hover {
  background: var(--accent-secondary);
  transform: translateY(-50%) scale(1.1);
  border-color: var(--accent-secondary);
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

@media (max-width: 768px) {
  .carousel-slides {
    padding: 20px 1rem;
    gap: 16px;
  }

  .carousel-slide {
    min-width: 240px;
    max-width: 240px;
  }

  .carousel-nav {
    display: none;
    /* Touch scroll on mobile */
  }
}

/* ===== MAP SECTION ===== */
.map-section {
  margin: 4rem 0;
  text-align: center;
  padding: 0 1rem;
}

.map-section .section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.map-section .section-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Map Container with Hero Glow Effect */
.map-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  height: 500px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 1;
}

.map-wrapper::before {
  content: "";
  position: absolute;
  inset: -4px;
  /* Subtle glow border */
  border-radius: 28px;
  background: linear-gradient(135deg, #bf247a, #d9731a);
  opacity: 0.6;
  z-index: -1;
  filter: blur(8px);
  transition: opacity 0.3s ease;
}

.map-wrapper:hover::before {
  opacity: 0.8;
  filter: blur(12px);
}

.universities-map {
  width: 100%;
  height: 100%;
  background-color: #242424;
  /* Fallback */
}

/* Custom Map Popup Styling (Professional Google Maps Style) */
.leaflet-popup-content-wrapper {
  background: #1a1a1a;
  /* Darker background */
  border: 1px solid #333;
  border-radius: 12px;
  color: #FFFFFF;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9);
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 100% !important;
}

.leaflet-popup-tip {
  background: #1a1a1a;
  border: 1px solid #333;
  border-top: none;
  border-left: none;
}

.leaflet-container a.leaflet-popup-close-button {
  color: #FFF;
  font-size: 20px;
  top: 10px;
  right: 10px;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
  color: var(--accent-secondary);
  background: rgba(0, 0, 0, 0.8);
}

/* Popup Card Layout */
.map-popup-card {
  display: flex;
  flex-direction: column;
  font-family: 'Roboto', sans-serif;
}

.map-popup-image-container {
  position: relative;
  width: 100%;
  height: 160px;
  /* Taller image */
  overflow: hidden;
}

.map-popup-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.map-popup-card:hover .map-popup-image {
  transform: scale(1.05);
}

.map-popup-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

.map-popup-title {
  position: absolute;
  bottom: 12px;
  left: 16px;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1.1;
}

.map-popup-info {
  padding: 16px;
  background: #1a1a1a;
}

.map-popup-info h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: #bf247a;
  /* Brand Pink */
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.map-popup-info p {
  margin: 0;
  font-size: 0.9rem;
  color: #ccc;
  line-height: 1.5;
}

/* Popup without image */
.map-popup-header {
  padding: 16px;
  background: linear-gradient(135deg, #bf247a, #d9731a);
}

.map-popup-title-no-image {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFF;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
}

/* Custom Marker Animation (Pin Style) */
.custom-map-pin {
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: currentColor;
  position: absolute;
  transform: rotate(-45deg);
  left: 50%;
  top: 50%;
  margin: -15px 0 0 -15px;
  box-shadow: -3px 3px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-map-pin::after {
  content: '';
  width: 14px;
  height: 14px;
  margin: 0;
  /* Center dot */
  background: #fff;
  position: absolute;
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.custom-map-pin:hover {
  transform: rotate(-45deg) scale(1.2) translateY(-5px);
  z-index: 1000 !important;
  filter: brightness(1.2);
  cursor: pointer;
}

@media (max-width: 768px) {
  .map-wrapper {
    height: 350px;
  }
}

.output-error {
  color: #f48771;
}

.output-error .output-icon {
  color: #f14c4c;
}

.output-warn {
  color: #dcdcaa;
}

.output-warn .output-icon {
  color: #cca700;
}

.output-success {
  color: #4EC9B0;
}

.output-success .output-icon {
  color: #4EC9B0;
}

.output-error-stack {
  color: #888;
  font-size: 0.8rem;
  padding-left: 1.5rem;
}

/* Footer */
.code-editor-footer {
  background: #2a2a2a;
  padding: 1rem 1.5rem;
  border-top: 1px solid #3a3a3a;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.code-editor-btn {
  padding: 0.65rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.code-editor-btn svg {
  width: 16px;
  height: 16px;
}

.run-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(191, 36, 122, 0.3);
}

.run-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(217, 115, 26, 0.4);
}

.run-btn:active {
  transform: translateY(0);
}

.clear-btn {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.clear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
  .code-editor-fab {
    left: 1rem;
    bottom: 1rem;
    width: 56px;
    height: 56px;
  }

  .code-editor-fab svg {
    width: 24px;
    height: 24px;
  }

  .code-editor-container {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .code-editor-panes {
    flex-direction: column;
  }

  .editor-pane,
  .output-pane {
    flex: 1;
  }

  .pane-hint {
    display: none;
  }

  .code-editor-footer {
    flex-wrap: wrap;
  }

  .code-editor-btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
  }
}

/* Scrollbar Styling */
.code-editor-textarea::-webkit-scrollbar,
.code-editor-output::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.code-editor-textarea::-webkit-scrollbar-track,
.code-editor-output::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.code-editor-textarea::-webkit-scrollbar-thumb,
.code-editor-output::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 6px;
}

.code-editor-textarea::-webkit-scrollbar-thumb:hover,
.code-editor-output::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}


/* ===== FLOATING ACTIONS GROUP (iPhone Style) ===== */

.floating-actions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(129, 43, 140, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 9998;
  transition: all 0.3s ease;
}

.floating-actions:hover {
  box-shadow: 0 12px 40px rgba(191, 36, 122, 0.4);
  border-color: rgba(191, 36, 122, 0.5);
}

.floating-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
}

.floating-btn svg {
  width: 22px;
  height: 22px;
}

.floating-btn:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 20px rgba(217, 115, 26, 0.5);
}

.floating-btn:active {
  transform: translateY(-2px) scale(1.05);
}

/* Tooltip on hover */
.floating-btn::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.floating-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-12px);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .floating-actions {
    bottom: 16px;
    gap: 10px;
    padding: 10px 14px;
  }

  .floating-btn {
    width: 44px;
    height: 44px;
  }

  .floating-btn svg {
    width: 20px;
    height: 20px;
  }
}



/* ===== CODE DOJO SIDEBAR ===== */

/* Sidebar */
.codedojo-sidebar {
  position: fixed;
  right: 0;
  top: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #1e1e1e;
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.codedojo-sidebar.active {
  transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #FFFFFF;
}

.sidebar-title .dojo-icon {
  width: 28px;
  height: 28px;
}

.sidebar-title h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFFFFF;
  background: none;
  -webkit-text-fill-color: #FFFFFF;
}

.sidebar-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #FFFFFF;
}

.sidebar-close svg {
  width: 20px;
  height: 20px;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Sidebar Content */
.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.dojo-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-subtitle {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 1rem;
}

.section-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* Link Card */
.dojo-link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(191, 36, 122, 0.1), rgba(217, 115, 26, 0.1));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
}

.dojo-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(191, 36, 122, 0.3);
  border-color: var(--accent-primary);
}

.link-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.link-content {
  flex: 1;
}

.link-content h5 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.link-content p {
  margin: 0;
  font-size: 0.8rem;
  color: #999;
}

.link-arrow {
  width: 20px;
  height: 20px;
  color: var(--accent-secondary);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.dojo-link-card:hover .link-arrow {
  transform: translateX(4px);
}

/* Kata List */
.kata-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kata-item {
  margin: 0;
}

.kata-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.kata-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-secondary);
  transform: translateX(4px);
}

.kata-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.kata-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kata-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.kata-desc {
  font-size: 0.75rem;
  color: #888;
}

.external-icon {
  width: 16px;
  height: 16px;
  color: #666;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.kata-link:hover .external-icon {
  color: var(--accent-secondary);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(217, 115, 26, 0.1);
  border: 1px solid rgba(217, 115, 26, 0.2);
  border-radius: 8px;
  text-align: center;
}

.sidebar-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--accent-secondary);
}

/* Scrollbar for Sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* Responsive */
@media (max-width: 768px) {
  .codedojo-toggle {
    right: 1rem;
    width: 56px;
    height: 56px;
  }

  .codedojo-toggle svg {
    width: 20px;
    height: 20px;
  }

  .codedojo-toggle .toggle-text {
    font-size: 0.6rem;
  }

  .codedojo-sidebar {
    width: 100%;
    max-width: 100vw;
  }

  .sidebar-content {
    padding: 1rem;
  }

  .dojo-section {
    margin-bottom: 1.5rem;
  }
}



/* ---- NOVAS CLASSES ADICIONADAS ---- */

/* deixa o hero em layout de duas colunas */
.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  width: 100%;
  /* Full width */
}

/* Ensure children share space correctly on desktop */
.hero-layout .hero-copy {
  flex: 1;
  min-width: 300px;
  /* Prevent squashing */
}

.hero-layout .hero-video-wrapper {
  flex: 1;
  width: 100%;
  /* Reset width to work with flex */
  max-width: 600px;
  /* Limit video size */
}

/* força a mídia ficar à direita */
.hero-media-right {
  order: 2;
}

/* imagem flutuante à direita, com efeito suave */
.hero-image-float {
  max-width: 320px;
  margin-left: auto;
  transition: transform 0.3s ease, filter 0.3s ease;
  margin-top: -200px;
  /* levanta a imagem */
}

/* efeito ao passar o mouse */
.hero-image-float:hover img {
  transform: scale(1.05) rotate(1deg);
  filter: brightness(1.15);
}

/* imagem responsiva */
.hero-image-float img {
  width: 100%;
  height: auto;
  display: block;
}

/* mobile first: imagem vai para baixo do texto */
@media (max-width: 768px) {
  .hero-layout {
    flex-direction: column;
    text-align: center;
  }

  .hero-media-right {
    order: 2;
    /* continua vindo depois do texto */
  }

  .hero-image-float {
    margin: 20px auto 0;
    max-width: 240px;
  }
}



/* Vídeo dentro do wrapper */
.hero-video {
  width: 100%;
  display: block;
  object-fit: cover;
  /* mantém proporção sem cortar errado */
  transition: opacity 0.8s ease;
}

.hero-video.fade-out {
  opacity: 0;
}

/* ===== BOTÃO FLUTUANTE ===== */
.chat-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #bf247a;
  /* cor da sua paleta */
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.chat-fab:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* ===== MODAL DE CHAT ===== */
.chat-modal {
  position: fixed;
  right: 1.5rem;
  bottom: 5rem;
  width: 340px;
  max-width: 95vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #1c1b2b;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 9999;
}

.chat-modal.hidden {
  display: none;
}

.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: #2a2359;
  color: #ffffff;
}

.chat-modal-subtitle {
  font-size: 0.75rem;
  opacity: 0.8;
  margin: 0;
}

.chat-modal-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Área de mensagens */
.chat-modal-messages {
  padding: 0.75rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: radial-gradient(circle at top left, #812b8c 0, #1c1b2b 40%, #000 100%);
}

/* Mensagens */
.chat-message {
  display: flex;
}

.chat-message.user {
  justify-content: flex-end;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-bubble {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 80%;
}

.chat-message.user .chat-bubble {
  background: #d9731a;
  color: #1c1b2b;
}

.chat-message.bot .chat-bubble {
  background: #2a2359;
  color: #ffffff;
}

/* Mensagem "digitando..." */
.chat-message.loading .chat-bubble {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d9731a;
  animation: typing 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Formulário do input */
.chat-modal-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #11101b;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-modal-form input {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1e1d2b;
  color: #ffffff;
  font-size: 0.85rem;
}

.chat-modal-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-modal-form button {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  background: #bf247a;
  color: #ffffff;
}

/* Mobile: sobe um pouco mais o modal */
@media (max-width: 600px) {
  .chat-modal {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 5.5rem;
    width: auto;
  }

  .chat-fab {
    right: 1rem;
    bottom: 1rem;
  }
}

/* ===== VISUAL EFFECTS (Added for effects.js) ===== */

/* Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for children if needed */
.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

/* Tilt Effect Base */
.tilt-card {
  transition: transform 0.1s ease-out;
  /* Fast transition for mouse movement */
  transform-style: preserve-3d;
}

/* Focus Ring Animation for Search */
.search-focus-ring {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
  background-size: 200% 200%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: gradientMove 3s ease infinite;
}

.search-bar:focus-within .search-focus-ring {
  opacity: 0.6;
  filter: blur(8px);
}

/* Cookie Consent Banner */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(36, 38, 20, 0.98);
  /* #242614 with opacity */
  color: var(--text-primary);
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
  animation: slideUp 0.5s ease-out forwards;
}

#cookie-banner.hidden {
  animation: slideDown 0.5s ease-in forwards;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.cookie-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-content p strong {
  color: var(--accent-secondary);
}

.cookie-actions {
  display: flex;
  gap: 1rem;
}

.cookie-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  transition: all 0.2s ease;
}

.cookie-btn.accept {
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(191, 36, 122, 0.3);
}

.cookie-btn.accept:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(217, 115, 26, 0.4);
}

.cookie-btn.decline {
  background-color: transparent;
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
}

.cookie-btn.decline:hover {
  background-color: rgba(191, 36, 122, 0.1);
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .cookie-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }

  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ===== CODE BLOCK ENHANCEMENTS ===== */

.code-block-wrapper {
  position: relative;
  margin-top: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #272822;
}

.code-block-wrapper .code-block {
  margin-top: 0;
  border-radius: 0;
  border: none;
  padding-top: 3rem;
  /* Space for toolbar */
}

/* Toolbar */
.code-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.5rem;
  gap: 0.5rem;
  z-index: 10;
}

.code-btn {
  background: transparent;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.code-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.code-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Fullscreen Mode */
.code-block-wrapper.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  border: none;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  animation: expandFlat 0.3s ease-out forwards;
}

.code-block-wrapper.fullscreen .code-block {
  flex: 1;
  overflow: auto;
  font-size: 1rem;
  /* Larger font in fullscreen */
  padding: 4rem 2rem 2rem;
}

.code-block-wrapper.fullscreen .code-toolbar {
  background: #18190e;
  height: 3.5rem;
  padding-right: 1.5rem;
}

@keyframes expandFlat {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tooltip for Copy */
.copy-tooltip {
  position: absolute;
  top: -30px;
  right: 0;
  background: #bf247a;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.copy-tooltip.visible {
  opacity: 1;
  top: -35px;
}

/* ===== CODE FEEDBACK ===== */

.code-feedback {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: -1px;
  /* Overlap border */
}

.feedback-btn {
  background: transparent;
  border: none;
  color: #777;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.feedback-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
}

.feedback-btn.active {
  color: var(--accent-secondary);
  /* Highlight color */
  background: rgba(217, 115, 26, 0.1);
}

.feedback-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.feedback-btn:active svg {
  transform: scale(0.8);
}

.feedback-btn.active svg {
  transform: scale(1.1);
}

.feedback-count {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.8;
}

/* Chatbot Styles */
#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10001;
  font-family: 'Roboto', sans-serif;
}

#chatbot-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chatbot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(217, 115, 26, 0.4);
}

#chatbot-toggle.hidden {
  display: none;
}

#chatbot-window {
  width: 350px;
  height: 500px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

#chatbot-window.hidden {
  display: none;
}

.chatbot-header {
  background: var(--gradient-primary);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  background: none;
  -webkit-text-fill-color: white;
}

#chatbot-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

#chatbot-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 80%;
  padding: 10px 15px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.message.bot {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.message.user {
  background: var(--gradient-primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.message.typing span {
  display: inline-block;
  animation: bounce 1.4s infinite ease-in-out both;
  margin: 0 1px;
  font-size: 1.2rem;
}

.message.typing span:nth-child(1) {
  animation-delay: -0.32s;
}

.message.typing span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
  }

  40% {
    transform: scale(1);
  }
}

.chatbot-input-area {
  padding: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
  background-color: rgba(0, 0, 0, 0.2);
}

#chatbot-input {
  flex: 1;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  outline: none;
}

#chatbot-input:focus {
  border-color: var(--accent-secondary);
}

#chatbot-send {
  background: var(--gradient-primary);
  border: none;
  border-radius: 20px;
  padding: 0 15px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

#chatbot-send:hover {
  opacity: 0.9;
}

@media (max-width: 480px) {
  #chatbot-window {
    width: calc(100% - 40px);
    height: 60vh;
    bottom: 90px;
  }
}

/* Video Transition Styles */
#youtube-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #000;
}

#youtube-wrapper.fade-in {
  opacity: 1;
}

/* ========================================
   THEME SWITCHER UI
   ======================================== */

.theme-switcher {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 9999;
}

.theme-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--shadow-color);
}

.theme-toggle svg {
  animation: rotate 20s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

.theme-dropdown {
  position: absolute;
  bottom: 60px;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-color);
  min-width: 250px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.theme-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.theme-dropdown-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.theme-options {
  padding: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.theme-option:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

.theme-option.active {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary) inset;
}

.theme-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.theme-name {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .theme-switcher {
    bottom: 80px;
    right: 16px;
  }

  .theme-toggle {
    width: 45px;
    height: 45px;
  }

  .theme-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 280px;
  }

  .theme-dropdown.show {
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(129, 43, 140, 0.2);
  border-left-color: #822B8C;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}