/* ==========================
   DEVFLIX - Estilo dark moderno
   ========================== */
:root {
  --bg: #0b0b10;
  --bg-2: #14141c;
  --bg-3: #1c1c28;
  --txt: #f5f5f7;
  --txt-dim: #a8a8b3;
  --primary: #e50914;
  --primary-d: #b30710;
  --html-c: #e34c26;
  --css-c: #2965f1;
  --js-c: #f7df1e;
  --pg-c: #8e2de2;
  --border: rgba(255,255,255,.08);
  --shadow: 0 10px 40px rgba(0,0,0,.5);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--txt); }
body {
  font-family: 'Inter', system-ui, sans-serif;
  margin: 0;
  padding-top: 70px;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 90% -10%, rgba(229,9,20,.12), transparent 60%),
    radial-gradient(800px 500px at -10% 30%, rgba(142,45,226,.08), transparent 60%),
    var(--bg);
}

/* ====== NAVBAR ====== */
.navbar-glass {
  background: rgba(11, 11, 16, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.brand-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  letter-spacing: 2px;
  color: var(--txt);
  line-height: 1;
}
.brand-flix { color: var(--primary); }
.small-brand { font-size: 1.4rem !important; }
.brand-tag {
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--txt-dim);
  font-weight: 700;
}
.navbar-nav .nav-link.tab {
  color: var(--txt-dim) !important;
  font-weight: 600;
  padding: .5rem 1rem !important;
  border-radius: 8px;
  cursor: pointer;
  transition: .25s;
  font-size: .95rem;
}
.navbar-nav .nav-link.tab:hover { color: var(--txt) !important; background: rgba(255,255,255,.06); }
.navbar-nav .nav-link.tab.active {
  color: var(--txt) !important;
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(229,9,20,.4);
}

/* ====== TABS ====== */
.tab-content { display: none; animation: fadeIn .4s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ====== HERO ====== */
.hero {
  position: relative;
  padding: 5rem 0 3rem;
  overflow: hidden;
  margin-bottom: 1rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, var(--bg) 90%),
    radial-gradient(circle at 20% 30%, rgba(229,9,20,.4), transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(142,45,226,.3), transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(41,101,241,.25), transparent 50%);
  z-index: -1;
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 7vw, 6rem);
  letter-spacing: 2px;
  line-height: 1.05;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, #e0e0e0 50%, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 1.15rem;
  max-width: 720px;
  color: var(--txt-dim);
  margin-bottom: 2rem;
  line-height: 1.6;
}
.hero-stats { color: var(--txt-dim); }
.hero-stats strong {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  color: var(--primary);
  line-height: 1;
}
.hero-stats span { font-size: .85rem; text-transform: uppercase; letter-spacing: 2px; }

/* ====== ROWS / CARROSSEL ====== */
.row-title {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  font-size: 2rem;
  color: var(--txt);
  margin-bottom: 1.25rem;
}
.trilhas-row { position: relative; }
.trilhas-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0 1.25rem;
  scroll-behavior: smooth;
}
.trilhas-track::-webkit-scrollbar { height: 6px; }
.trilhas-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
.trilha-card {
  flex: 0 0 280px;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: .35s;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.trilha-card:hover { transform: translateY(-6px) scale(1.02); border-color: rgba(255,255,255,.2); box-shadow: var(--shadow); }
.trilha-card .card-img {
  height: 130px;
  background: var(--bg);
  background-image: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  color: white;
}
.trilha-card .card-body-c { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.trilha-card h3 { font-family: 'Bebas Neue', sans-serif; letter-spacing: 1.5px; margin: 0 0 .25rem; font-size: 1.5rem; }
.trilha-card .meta { font-size: .75rem; color: var(--txt-dim); text-transform: uppercase; letter-spacing: 2px; margin-bottom: .6rem; }
.trilha-card p:not(.meta) { font-size: .9rem; color: var(--txt-dim); flex: 1; line-height: 1.5; }
.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-60%);
  background: rgba(0,0,0,.7);
  color: white;
  border: none;
  width: 45px; height: 45px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 5;
  display: flex; align-items: center; justify-content: center;
  transition: .2s;
}
.car-btn:hover { background: var(--primary); transform: translateY(-60%) scale(1.1); }
.car-btn.left { left: -10px; }
.car-btn.right { right: -10px; }

/* ====== TRIO ====== */
.trio-card {
  background: var(--bg-2);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top: 4px solid;
  transition: .3s;
  height: 100%;
}
.trio-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.trio-card.border-html { border-top-color: var(--html-c); color: var(--html-c); }
.trio-card.border-css  { border-top-color: var(--css-c); color: var(--css-c); }
.trio-card.border-js   { border-top-color: var(--js-c); color: var(--js-c); }
.trio-card h3 { font-family: 'Bebas Neue', sans-serif; letter-spacing: 2px; font-size: 2rem; color: var(--txt); margin: .8rem 0 .6rem; }
.trio-card p { color: var(--txt-dim); margin: 0; line-height: 1.6; }

/* ====== CTA BANNER ====== */
.cta-banner {
  background: linear-gradient(135deg, var(--primary), var(--pg-c));
  border-radius: var(--radius);
  padding: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.cta-banner h2 { font-family: 'Bebas Neue', sans-serif; letter-spacing: 2px; font-size: 2.5rem; margin: 0 0 .25rem; }

/* ====== PAGE HEADER ====== */
.page-header {
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.06));
  pointer-events: none;
}
.page-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  letter-spacing: 3px;
  margin: 0;
  color: white;
}
.page-header p { color: rgba(255,255,255,.85); font-size: 1.05rem; margin: .25rem 0 0; }
.bg-html { background: linear-gradient(135deg, #e34c26, #f06529); }
.bg-css  { background: linear-gradient(135deg, #264de4, #2965f1); }
.bg-js   { background: linear-gradient(135deg, #c8a800, #f7df1e); color: #222; }
.bg-js h1, .bg-js p { color: #222 !important; }
.bg-pg   { background: linear-gradient(135deg, #4a00e0, #8e2de2); }

/* ====== CARDS DE CONTEÚDO ====== */
.theory-card, .lab-card {
  background: var(--bg-2);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 2px;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--txt);
}

/* ====== ACCORDION ====== */
.accordion-flush .accordion-item {
  background: var(--bg-3);
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  margin-bottom: .5rem;
  overflow: hidden;
}
.accordion-button {
  background: var(--bg-3) !important;
  color: var(--txt) !important;
  font-weight: 600;
  padding: 1rem 1.25rem;
}
.accordion-button:not(.collapsed) {
  background: rgba(229,9,20,.1) !important;
  color: var(--primary) !important;
  box-shadow: none;
}
.accordion-button:focus { box-shadow: none; }
.accordion-button::after { filter: invert(1) brightness(2); }
.accordion-body { background: var(--bg-2); color: var(--txt-dim); padding: 1.25rem; line-height: 1.7; }
.accordion-body code {
  background: rgba(229,9,20,.15);
  color: #ff6b78;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .9em;
  font-family: 'JetBrains Mono', monospace;
}
.accordion-body strong, .accordion-body b { color: var(--txt); }

/* ====== TAG CARDS (mini cards de referência) ====== */
.tag-card {
  background: var(--bg-2);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--border);
  height: 100%;
}
.tag-card code {
  display: block;
  font-size: .9rem;
  margin-bottom: .35rem;
  background: rgba(229,9,20,.1) !important;
  color: var(--primary) !important;
  font-weight: 700;
}
.tag-card p { margin: 0; font-size: .85rem; color: var(--txt-dim); }

/* ====== CODE BLOCKS ====== */
.code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: .88rem;
  color: #e6edf3;
  margin: 1rem 0;
  line-height: 1.6;
}
.code-block code { background: transparent !important; color: inherit !important; padding: 0 !important; }

/* ====== EDITORS ====== */
.editor-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--txt-dim);
  margin-bottom: .5rem;
  font-weight: 700;
}
.editor-label i { color: var(--primary); }
.CodeMirror {
  height: 300px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 13.5px !important;
  border: 1px solid var(--border);
}
.lab-card .CodeMirror { background: #1e1e2e !important; }
.lab-out {
  width: 100%;
  height: 300px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
}
.lab-tall { height: 450px; }

/* ====== INTERATIVO BOX MODEL ====== */
.bm-stage {
  background: repeating-linear-gradient(45deg, #14141c, #14141c 10px, #1a1a26 10px, #1a1a26 20px);
  border-radius: 10px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
.bm-demo {
  background: linear-gradient(135deg, var(--primary), #ff5e69);
  color: white;
  padding: 16px;
  border: 3px solid var(--js-c);
  border-radius: 12px;
  margin: 20px;
  font-weight: 700;
  font-size: 1.2rem;
  transition: .25s;
  text-align: center;
}
.output-code {
  background: #0d1117;
  border-radius: 10px;
  padding: 1rem;
}
.output-code pre {
  margin: 0;
  color: #79c0ff;
  font-family: 'JetBrains Mono', monospace;
  font-size: .85rem;
}

/* ====== MIXER DE COR ====== */
.cor-demo {
  background: rgb(120,80,200);
  height: 160px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  border: 1px solid var(--border);
}
.slider-r::-webkit-slider-thumb { background: #ff4444 !important; }
.slider-g::-webkit-slider-thumb { background: #44ff44 !important; }
.slider-b::-webkit-slider-thumb { background: #4488ff !important; }

/* ====== FLEX DEMO ====== */
.flex-demo {
  background: var(--bg-3);
  border: 2px dashed var(--border);
  border-radius: 10px;
  min-height: 220px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  transition: .3s;
}
.flex-item {
  background: linear-gradient(135deg, var(--primary), var(--pg-c));
  width: 60px; height: 60px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.3rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

/* ====== DESAFIOS ====== */
.challenge {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  height: 100%;
  transition: .3s;
}
.challenge:hover { border-color: var(--primary); transform: translateY(-3px); }
.challenge h4 { font-size: 1rem; margin-bottom: .6rem; color: var(--txt); font-weight: 700; }
.challenge p { font-size: .85rem; color: var(--txt-dim); margin-bottom: 1rem; line-height: 1.5; }
.challenge code { background: rgba(229,9,20,.15); color: #ff6b78; padding: 1px 5px; border-radius: 3px; font-size: .8em; }

/* ====== CONSOLE ====== */
.console-wrap {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
}
.console-out {
  padding: 1rem;
  min-height: 180px;
  max-height: 300px;
  overflow-y: auto;
  font-size: .9rem;
  color: #e6edf3;
  line-height: 1.6;
}
.console-out .input-line { color: #79c0ff; }
.console-out .output-line { color: #7ee787; padding-left: 1.5rem; }
.console-out .error-line { color: #ff7b72; padding-left: 1.5rem; }
.console-input-row {
  display: flex;
  align-items: center;
  background: #161b22;
  border-top: 1px solid var(--border);
  padding: .5rem 1rem;
  gap: .5rem;
}
.console-prompt { color: var(--primary); font-weight: 700; }
.console-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e6edf3;
  font-family: 'JetBrains Mono', monospace;
  font-size: .9rem;
  outline: none;
}

/* ====== FOOTER ====== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  color: var(--txt-dim);
  font-size: .85rem;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-info { flex: 1; min-width: 280px; }
.footer-credits { color: var(--txt-dim); }
.footer-credits a { color: var(--txt); text-decoration: none; font-weight: 600; }
.footer-credits a:hover { color: var(--primary); }
.footer-credits .bi-whatsapp { color: #25d366; }
.footer-credits .bi-spotify { color: #1db954; }
.artist-link {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #1db954, #1ed760);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  transition: .2s;
}
.artist-link:hover { filter: brightness(1.3); }
.footer-player iframe { display: block; }
@media (max-width: 768px) {
  .footer-row { justify-content: center; text-align: center; }
}

/* ====== BOOTSTRAP OVERRIDES ====== */
.btn-danger { background: var(--primary); border-color: var(--primary); }
.btn-danger:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-outline-light:hover { color: #111; }
.form-range::-webkit-slider-thumb { background: var(--primary); }
.form-range::-moz-range-thumb { background: var(--primary); }
.form-control, .form-select {
  background: var(--bg-3);
  border-color: var(--border);
  color: var(--txt);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-3);
  border-color: var(--primary);
  color: var(--txt);
  box-shadow: 0 0 0 .2rem rgba(229,9,20,.2);
}

/* ====== PG FULLSCREEN ====== */
body.pg-full .tab-content:not(#tab-playground),
body.pg-full nav,
body.pg-full .footer { display: none; }
body.pg-full #tab-playground { padding-top: 1rem; }

/* ====== RESPONSIVO ====== */
@media (max-width: 768px) {
  .hero-title { font-size: 3rem; }
  .page-header { padding: 1.5rem; }
  .page-header h1 { font-size: 2.2rem; }
  .car-btn { display: none; }
  .CodeMirror, .lab-out { height: 220px; }
}
