/* ===== LANGSTEPS PYTHON MASTERY STYLESHEET ===== */
/* Styled to match HTML/CSS Mastery modules with Python Blue/Yellow Brand */

:root {
  --bg: #0a0e17;
  --bg2: #111827;
  --bg3: #1f2937;
  --bg4: #374151;
  --text: #f8fafc;
  --text2: #cbd5e1;
  --text3: #94a3b8;
  --accent: #3776ab;     /* Python Iconic Blue */
  --accent2: #ffd43b;    /* Python Iconic Yellow */
  --accent3: #4ade80;
  --border: rgba(55, 118, 171, 0.25);
  --card: #111827;
  --codeBg: #060913;
  --sbBg: #0f172a;
  --hdrBg: linear-gradient(135deg, #0b1120, #111827, #1e293b);
  --font-base: 'Plus Jakarta Sans', sans-serif;
  --font-code: 'Fira Code', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-base);
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Splash Screen */
#splash-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#splash-screen.hide { opacity: 0; visibility: hidden; }
.splash-logo { width: 96px; height: 96px; animation: pulseLogo 2s infinite ease-in-out; margin-bottom: 16px; }
.splash-title { font-size: 2.5rem; font-weight: 800; color: var(--accent2); margin-bottom: 8px; }
.splash-subtitle { font-size: 1rem; color: var(--text3); }

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 212, 59, 0.3)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(55, 118, 171, 0.6)); }
}

/* Floating Home & Back Navigation */
.floating-home-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 999;
  transition: transform 0.25s, box-shadow 0.25s;
}
.floating-home-btn:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 12px 30px rgba(55, 118, 171, 0.5);
}

/* Cross-Module Navigation Bar */
.cross-nav-bar {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
  width: 100%;
  flex-shrink: 0;
}
.cross-nav-links { display: flex; gap: 6px; overflow-x: auto; white-space: nowrap; padding-bottom: 2px; }
.cross-nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.cross-nav-links a:hover, .cross-nav-links a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.cross-nav-links a.quiz-pill {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 700;
  border: none;
}

/* SIDEBAR */
#sidebar {
  width: 340px;
  background: var(--sbBg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 45px;
  bottom: 0;
  left: 0;
  z-index: 950;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#sidebar.collapsed { transform: translateX(-100%); }

.sb-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.sb-logo-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); }
.sb-close {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sb-close:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.1) rotate(90deg);
  border-color: var(--accent);
}

.sb-search-wrap { padding: 12px 16px 8px; }
#sbSearch {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
#sbSearch:focus { border-color: var(--accent); }

#sbFilter {
  margin: 0 16px 12px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  width: calc(100% - 32px);
}

#sbNav {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#sbNav::-webkit-scrollbar { width: 5px; }
#sbNav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sb-item {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.sb-item:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--border); transform: translateX(3px); }
.sb-item.active { background: rgba(55, 118, 171, 0.2); border-color: var(--accent); }
.sb-item.mastered { border-left: 3px solid var(--accent3); }
.sb-item-emoji { font-size: 1.1rem; }
.sb-item-info { flex: 1; min-width: 0; }
.sb-item-title { font-size: 0.82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item-badge { font-size: 0.65rem; color: var(--text3); font-weight: 700; text-transform: uppercase; }
.sb-check { color: var(--accent3); font-weight: bold; font-size: 0.9rem; }

.sb-progress-card {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}
.sb-progress-header { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.sb-progress-bar { width: 100%; height: 6px; background: var(--bg3); border-radius: 4px; overflow: hidden; }
.sb-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); width: 0%; transition: width 0.3s; }

.sb-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sb-btn-row { display: flex; gap: 8px; justify-content: space-between; }
.sb-action-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}
.sb-action-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* MAIN CONTENT WRAPPER */
#mainWrap {
  flex: 1;
  margin-left: 340px;
  min-height: calc(100vh - 45px);
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: calc(100% - 340px);
}
#mainWrap.fullwidth {
  margin-left: 0;
  width: 100%;
}

.content-inner {
  padding: 24px 36px 60px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* HERO HEADER */
header.module-header {
  background: var(--hdrBg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
header.module-header::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 212, 59, 0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hdr-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.hdr-brand { display: flex; align-items: center; gap: 16px; }
.hdr-brand-icon { font-size: 2.8rem; }
.hdr-titles h1 { margin: 0 0 6px 0; font-size: 2.2rem; font-weight: 800; letter-spacing: -0.5px; }
.hdr-titles p { margin: 0; color: var(--text3); font-size: 0.95rem; }

.hdr-social-links { display: flex; gap: 10px; align-items: center; }
.hdr-social-links a { color: var(--text3); transition: color 0.2s; display: flex; align-items: center; }
.hdr-social-links a:hover { color: var(--text); }

.hdr-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.stat-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}
.stat-box-val { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.stat-box-lbl { font-size: 0.72rem; color: var(--text3); font-weight: 600; text-transform: uppercase; margin-top: 2px; }

/* Concept of the Day Card */
#totDayCard {
  background: linear-gradient(135deg, rgba(55, 118, 171, 0.15), rgba(255, 212, 59, 0.08));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tot-day-title { font-size: 0.82rem; font-weight: 700; color: var(--accent2); text-transform: uppercase; margin-bottom: 4px; }
.tot-day-name { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.tot-day-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.2s;
}
.tot-day-btn:hover { transform: scale(1.05); }

/* Quick Action Buttons */
.action-pills-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.action-pill {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.action-pill:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--accent); }
.action-pill.primary { background: linear-gradient(135deg, var(--accent), #2b5b84); color: #fff; border: none; }
.action-pill.gold { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; border: none; }

/* CONCEPT DETAIL CARD */
#conceptDetailCard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.concept-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.concept-heading { display: flex; align-items: center; gap: 12px; }
.concept-heading-emoji { font-size: 2rem; }
.concept-heading-text h2 { margin: 0; font-size: 1.8rem; font-weight: 800; }
.concept-heading-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; background: rgba(55, 118, 171, 0.25); color: #93c5fd; text-transform: uppercase; margin-top: 4px; }

.concept-actions { display: flex; gap: 8px; align-items: center; }
.btn-fav {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--accent2);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-quiz-shortcut {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Callout Box */
.cb {
  background: rgba(55, 118, 171, 0.1);
  border-left: 4px solid var(--accent2);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  margin: 20px 0;
}
.cb-h { font-weight: 800; font-size: 0.95rem; color: var(--accent2); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.cb-b p { margin: 0; font-size: 0.9rem; color: var(--text2); line-height: 1.5; }

/* Code Blocks */
pre {
  background: var(--codeBg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.88rem;
  line-height: 1.55;
  position: relative;
}
code { font-family: var(--font-code); color: #38bdf8; }

/* PLAYGROUND PANEL */
#playground {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-top: 32px;
}
.pg-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.pg-header h3 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.pg-controls { display: flex; gap: 8px; }
.pg-btn {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: all 0.2s;
}
.pg-btn:hover { background: rgba(255, 255, 255, 0.08); }
.pg-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.pg-btn.primary:hover { background: #2f6390; }

#codeEditor {
  width: 100%;
  height: 180px;
  background: var(--codeBg);
  color: #4ade80;
  font-family: var(--font-code);
  font-size: 0.92rem;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  outline: none;
  resize: vertical;
}
#codeEditor:focus { border-color: var(--accent); }

.console-box {
  margin-top: 14px;
  background: #020408;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.console-box-hdr {
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.5px;
}
#consoleOutput {
  margin: 0;
  padding: 12px 16px;
  background: transparent;
  border: none;
  font-size: 0.82rem;
  color: var(--text2);
  min-height: 80px;
}

/* THEME MODAL */
dialog#themeModal {
  margin: auto;
  padding: 28px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(20px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 820px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
dialog#themeModal::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 18px; }
.theme-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.theme-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.theme-card-preview { height: 36px; border-radius: 6px; margin-bottom: 8px; display: flex; overflow: hidden; }
.theme-card-name { font-size: 0.82rem; font-weight: 700; }

/* FOOTER */
footer {
  margin-top: auto;
  padding: 32px 20px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text3);
}
footer a { color: var(--accent2); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p { margin: 6px 0; }

@media (max-width: 960px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #mainWrap { margin-left: 0; width: 100%; }
  .content-inner { padding: 16px; }
}
