/* ── JustCode EduTech — Main Stylesheet ── */

:root {
  --gold: #F5B418;
  --gold-light: #FFD166;
  --dark: #0A0A0A;
  --dark-2: #111111;
  --dark-3: #181818;
  --dark-4: #222222;
  --dark-5: #2a2a2a;
  --text: #E8E8E8;
  --text-dim: #888;
  --text-muted: #555;
  --code-bg: #0f0f0f;
  --sidebar-w: 260px;
  --topbar-h: 58px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--dark);
  color: var(--text);
  overflow-x: hidden;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #222;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 0 0;
}

.topbar-logo {
  display: flex; align-items: center;
  text-decoration: none;
  height: var(--topbar-h);
  padding: 0 20px;
  border-right: 1px solid #222;
  min-width: var(--sidebar-w);
}

.logo-icon {
  width: 32px; height: 32px;
  background: var(--gold);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 14px;
  color: #000; margin-right: 10px;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 15px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.logo-text span { color: var(--gold); }

.topbar-nav {
  display: flex; align-items: center; gap: 4px;
  flex: 1; padding: 0 16px;
}

.topbar-nav a {
  font-size: 13px; font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}
.topbar-nav a:hover { color: var(--gold); background: rgba(245,180,24,0.08); }
.topbar-nav a.active { color: var(--gold); }

.topbar-right {
  display: flex; align-items: center; gap: 10px;
}

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--dark-3);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px; color: var(--text-dim);
  cursor: pointer; transition: all 0.2s;
}
.search-box:hover { border-color: var(--gold); color: var(--text); }
.search-box kbd {
  background: var(--dark-4); border: 1px solid #333;
  border-radius: 4px; padding: 1px 6px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
}

.btn-signin {
  background: transparent; border: 1px solid #333;
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; font-family: 'DM Sans', sans-serif;
}
.btn-signin:hover { border-color: var(--gold); color: var(--gold); }

.btn-start {
  background: var(--gold); border: none;
  color: #000; font-size: 13px; font-weight: 700;
  padding: 7px 18px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; font-family: 'Syne', sans-serif;
}
.btn-start:hover { background: var(--gold-light); transform: translateY(-1px); }

/* ── LAYOUT ── */
.layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: calc(100vh - var(--topbar-h));
  background: var(--dark-2);
  border-right: 1px solid #1e1e1e;
  position: fixed;
  top: var(--topbar-h); left: 0;
  overflow-y: auto;
  padding-bottom: 40px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

.sidebar-section { padding: 16px 0 4px; }

.sidebar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  color: var(--gold);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 18px 8px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, #2a2a2a, transparent);
}

.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  font-size: 13px; color: var(--text-dim);
  cursor: pointer; text-decoration: none;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-item:hover { color: var(--text); background: rgba(255,255,255,0.03); border-left-color: #333; }
.sidebar-item.active { color: var(--gold); background: rgba(245,180,24,0.06); border-left-color: var(--gold); font-weight: 500; }
.sidebar-item .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-muted); flex-shrink: 0; transition: background 0.15s; }
.sidebar-item.active .dot { background: var(--gold); }
.sidebar-item .badge {
  margin-left: auto;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  background: rgba(245,180,24,0.12);
  color: var(--gold); padding: 1px 6px; border-radius: 4px;
}

/* ── MAIN ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

/* ── HERO ── */
.hero {
  padding: 60px 60px 40px;
  background: var(--dark);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -100px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(245,180,24,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(245,180,24,0.1); border: 1px solid rgba(245,180,24,0.2);
  border-radius: 100px; padding: 5px 14px 5px 8px;
  font-size: 12px; font-weight: 500; color: var(--gold);
  margin-bottom: 24px; font-family: 'JetBrains Mono', monospace;
  animation: fadeUp 0.6s ease both;
}
.hero-tag-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -1.5px;
  animation: fadeUp 0.6s 0.1s ease both; max-width: 700px;
}
.hero h1 .gold { color: var(--gold); }
.hero h1 .outline { -webkit-text-stroke: 1px var(--gold); color: transparent; }

.hero p {
  font-size: 16px; color: var(--text-dim);
  max-width: 500px; line-height: 1.7; margin: 16px 0 32px;
  animation: fadeUp 0.6s 0.2s ease both;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; animation: fadeUp 0.6s 0.3s ease both; }

.btn-primary {
  background: var(--gold); color: #000; font-weight: 700;
  font-family: 'Syne', sans-serif; font-size: 14px; padding: 12px 28px;
  border: none; border-radius: 10px; cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,180,24,0.3); }

.btn-secondary {
  background: transparent; color: var(--text); font-weight: 500;
  font-size: 14px; padding: 12px 28px; border: 1px solid #333;
  border-radius: 10px; cursor: pointer; transition: all 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── STATS ── */
.stats-bar {
  display: flex; border-top: 1px solid #1a1a1a; border-bottom: 1px solid #1a1a1a;
  margin: 40px 0 0; animation: fadeUp 0.6s 0.4s ease both;
}
.stat { flex: 1; padding: 20px 30px; border-right: 1px solid #1a1a1a; text-align: center; }
.stat:last-child { border-right: none; }
.stat-num { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }

/* ── TOPICS ── */
.topics-section { padding: 48px 60px; animation: fadeUp 0.6s 0.5s ease both; }
.section-heading { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.section-sub { font-size: 13px; color: var(--text-dim); margin-bottom: 24px; }

.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }

.topic-card {
  background: var(--dark-3); border: 1px solid #1e1e1e;
  border-radius: 12px; padding: 20px; cursor: pointer;
  transition: all 0.2s; text-decoration: none; display: block;
  position: relative; overflow: hidden;
}
.topic-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(245,180,24,0.04), transparent);
  opacity: 0; transition: opacity 0.2s;
}
.topic-card:hover { border-color: rgba(245,180,24,0.3); transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.topic-card:hover::before { opacity: 1; }
.topic-icon { font-size: 28px; margin-bottom: 12px; display: block; }
.topic-name { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.topic-count { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.topic-bar { margin-top: 14px; height: 3px; background: #2a2a2a; border-radius: 2px; overflow: hidden; }
.topic-bar-fill { height: 100%; background: var(--gold); border-radius: 2px; }

/* ── TUTORIAL VIEW ── */
.tutorial-view { display: none; flex: 1; }
.tutorial-view.active { display: flex; flex-direction: column; }

.tutorial-header { padding: 28px 48px 20px; border-bottom: 1px solid #1a1a1a; }
.breadcrumb { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.breadcrumb span { color: var(--gold); }
.tutorial-title { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -0.8px; margin-bottom: 8px; }
.tutorial-meta { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.meta-tag { background: rgba(245,180,24,0.1); color: var(--gold); padding: 3px 10px; border-radius: 100px; font-size: 11px; }

.tutorial-body { padding: 36px 48px; max-width: 860px; line-height: 1.8; }
.tutorial-body h2 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin: 32px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #1e1e1e; }
.tutorial-body p { color: var(--text-dim); margin-bottom: 16px; font-size: 15px; }
.tutorial-body strong { color: var(--text); }
.tutorial-body .highlight { background: rgba(245,180,24,0.08); border-left: 3px solid var(--gold); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0; font-size: 14px; color: var(--text-dim); }

/* ── CODE BLOCK ── */
.code-block { background: var(--code-bg); border: 1px solid #222; border-radius: 10px; overflow: hidden; margin: 20px 0; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid #1a1a1a; background: #0d0d0d; }
.code-lang { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--gold); text-transform: uppercase; letter-spacing: 1px; }
.code-actions { display: flex; gap: 8px; }
.btn-tryit { background: var(--gold); color: #000; font-size: 11px; font-weight: 700; font-family: 'Syne', sans-serif; padding: 4px 12px; border-radius: 6px; border: none; cursor: pointer; transition: all 0.2s; }
.btn-tryit:hover { background: var(--gold-light); }
.btn-copy { background: var(--dark-4); color: var(--text-dim); font-size: 11px; padding: 4px 12px; border-radius: 6px; border: 1px solid #333; cursor: pointer; transition: all 0.2s; }
.btn-copy:hover { border-color: #555; color: var(--text); }
.code-content { padding: 20px; font-family: 'JetBrains Mono', monospace; font-size: 13.5px; line-height: 1.7; overflow-x: auto; color: #e8e8e8; }
.code-content .tag { color: #F97B8B; }
.code-content .attr { color: #79D4FF; }
.code-content .val { color: #B5CEA8; }
.code-content .cmt { color: #555; font-style: italic; }
.code-content .kw { color: var(--gold); }
.code-content .str { color: #CE9178; }
.code-content .fn { color: #DCDCAA; }
.code-content .num { color: #B5CEA8; }

/* ── TRY IT EDITOR ── */
.tryit-section { margin: 0 48px 32px; border: 1px solid #222; border-radius: 12px; overflow: hidden; }
.tryit-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #0d0d0d; border-bottom: 1px solid #1a1a1a; }
.tryit-title { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.tryit-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.btn-run { background: var(--gold); color: #000; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 12px; padding: 6px 18px; border-radius: 7px; border: none; cursor: pointer; transition: all 0.2s; }
.btn-run:hover { background: var(--gold-light); transform: scale(1.02); }
.tryit-body { display: grid; grid-template-columns: 1fr 1fr; height: 240px; }
.tryit-editor { padding: 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; background: #0a0a0a; color: #e0e0e0; border: none; outline: none; resize: none; border-right: 1px solid #1e1e1e; width: 100%; tab-size: 2; }
.tryit-output { background: #fff; overflow: hidden; }
.tryit-output iframe { width: 100%; height: 100%; border: none; background: #fff; }

/* ── NAV BUTTONS ── */
.nav-buttons { display: flex; justify-content: space-between; padding: 0 48px 48px; margin-top: 20px; }
.btn-nav { display: flex; align-items: center; gap: 10px; background: var(--dark-3); border: 1px solid #222; border-radius: 10px; padding: 12px 20px; cursor: pointer; text-decoration: none; color: var(--text-dim); font-size: 13px; transition: all 0.2s; }
.btn-nav:hover { border-color: var(--gold); color: var(--gold); }
.btn-nav .arrow { font-size: 16px; }
.btn-nav .nav-label { font-size: 11px; color: var(--text-muted); display: block; }
.btn-nav .nav-title { font-weight: 600; color: var(--text); font-size: 13px; }
.btn-nav:hover .nav-title { color: var(--gold); }

/* ── HOME VIEW ── */
.home-view { display: flex; flex-direction: column; }
.home-view.hidden { display: none; }

/* ── INTERNSHIP BANNER ── */
.internship-banner {
  margin: 0 60px 48px;
  background: linear-gradient(135deg, #111 0%, #161200 100%);
  border: 1px solid rgba(245,180,24,0.2);
  border-radius: 16px; padding: 32px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; position: relative; overflow: hidden;
  animation: fadeUp 0.6s 0.6s ease both;
}
.internship-banner::before {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(245,180,24,0.1), transparent 70%);
  pointer-events: none;
}
.banner-tag { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--gold); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; }
.banner-title { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.banner-sub { font-size: 13px; color: var(--text-dim); }
.banner-cta { background: var(--gold); color: #000; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; padding: 11px 24px; border-radius: 9px; border: none; cursor: pointer; transition: all 0.2s; white-space: nowrap; flex-shrink: 0; }
.banner-cta:hover { background: var(--gold-light); transform: translateY(-2px); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .hero { padding: 40px 24px 32px; }
  .topics-section { padding: 32px 24px; }
  .internship-banner { margin: 0 24px 32px; padding: 24px; flex-direction: column; }
  .tutorial-body { padding: 24px; }
  .tryit-section { margin: 0 0 24px; }
  .tutorial-header { padding: 20px 24px; }
  .nav-buttons { padding: 0 24px 32px; }
  .tryit-body { grid-template-columns: 1fr; height: auto; }
  .tryit-editor { height: 160px; border-right: none; border-bottom: 1px solid #1e1e1e; }
  .tryit-output { height: 160px; }
  .stats-bar { flex-wrap: wrap; }
  .stat { min-width: 50%; border-bottom: 1px solid #1a1a1a; }
}