/* style.css — Professional UI theme for Learn Python */

/* -----------------------
   Design tokens
   ----------------------- */
:root{
  --bg: #f6f8fb;
  --surface: #ffffff;
  --muted: #6b7280;
  --text: #0f1724;
  --accent: #2563eb;      /* primary accent (blue) */
  --accent-2: #06b6d4;    /* secondary (teal) */
  --success: #16a34a;
  --danger: #ef4444;
  --glass: rgba(255,255,255,0.8);
  --border: rgba(15,23,42,0.06);
  --soft-shadow: 0 8px 30px rgba(2,6,23,0.06);
  --card-shadow: 0 10px 30px rgba(2,6,23,0.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  --radius: 12px;
  --max-width: 1200px;
  --accent-gradient: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
}

/* -----------------------
   Base
   ----------------------- */
* { box-sizing: border-box; }
html,body { height: 100%; }
body{
  margin: 0;
  background: radial-gradient(1200px 400px at 10% 10%, rgba(37,99,235,0.03), transparent 8%),
              linear-gradient(180deg,#fbfdff 0%, #f6f8fb 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height: 1.48;
  -webkit-tap-highlight-color: transparent;
}

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* -----------------------
   Header
   ----------------------- */
.page-header {
  position: sticky;
  top: 0;
  z-index: 120;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display:flex;
  gap:20px;
  align-items:center;
  justify-content:space-between;
  padding: 14px 20px;
}
.brand {
  display:flex;
  gap:14px;
  align-items:center;
}
.brand .logo {
  display:inline-grid;
  place-items:center;
  width:46px;
  height:46px;
  border-radius:10px;
  background:var(--accent-gradient);
  color:white;
  font-weight:800;
  box-shadow: 0 8px 22px rgba(37,99,235,0.14);
}
.brand h1 { margin: 0; font-size:1.05rem; letter-spacing:-0.2px; }
.brand .lead { margin:0; font-size:0.88rem; color:var(--muted); }

/* Mini nav */
.mini-nav { display:flex; gap:6px; align-items:center; }
.mini-nav-link {
  font-weight:700;
  font-size:0.95rem;
  padding:8px 10px;
  border-radius:10px;
  text-decoration:none;
  color:var(--text);
}
.mini-nav-link[aria-current="page"], .mini-nav-link.active {
  background: var(--accent-gradient);
  color:white;
  box-shadow: 0 8px 20px rgba(37,99,235,0.12);
}

/* Profile widget placeholder (right side) */
#profileWidget { display:flex; align-items:center; gap:8px; }

/* -----------------------
   Profile widget & dropdown
   ----------------------- */
.profile-btn {
  display:inline-flex;
  gap:12px;
  align-items:center;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface);
  cursor:pointer;
  transition: box-shadow .12s ease, transform .06s ease;
}
.profile-btn:hover{ box-shadow: var(--soft-shadow); transform: translateY(-1px); }
.profile-avatar {
  width:36px;
  height:36px;
  border-radius:10px;
  display:inline-grid;
  place-items:center;
  font-weight:700;
  color:white;
  background: linear-gradient(180deg,#7c3aed 0%, #2563eb 100%);
  font-family: Inter, system-ui;
}
.profile-info { display:flex; flex-direction:column; align-items:flex-start; }
.profile-info .name { font-weight:700; font-size:0.95rem; margin:0; }
.profile-info .email { font-size:0.78rem; color:var(--muted); margin:0; }

/* dropdown menu */
.profile-menu {
  position:absolute;
  right:20px;
  top:64px;
  width:260px;
  background:var(--surface);
  border-radius:12px;
  box-shadow: 0 20px 60px rgba(2,6,23,0.12);
  padding:8px;
  border:1px solid var(--border);
  z-index:1500;
}
.profile-menu .menu-item {
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
  color:var(--text);
}
.profile-menu .menu-item:hover { background:#f6f8ff; }
.profile-menu .menu-item .hint { margin-left:auto; font-weight:600; color:var(--muted); font-size:0.85rem; }

/* small details */
.small { font-size:0.88rem; color:var(--muted); }

/* -----------------------
   Buttons
   ----------------------- */
.btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:9px 14px; border-radius:10px; border:none;
  background:var(--accent); color:white; font-weight:800; cursor:pointer;
  box-shadow: 0 10px 28px rgba(37,99,235,0.10);
}
.btn.secondary { background:var(--accent-2); box-shadow: 0 10px 28px rgba(6,182,212,0.08); }
.btn.ghost { background:var(--surface); color:var(--text); border:1px solid var(--border); box-shadow:none; }
.btn.small { padding:6px 8px; font-weight:700; }

/* -----------------------
   Cards, panels, layout
   ----------------------- */
.card {
  background:var(--surface);
  border-radius:12px;
  border:1px solid var(--border);
  padding:14px;
  box-shadow: var(--card-shadow);
}
.lesson { margin-bottom:16px; }

/* code blocks */
pre, code {
  font-family: var(--mono);
  background: #f4f7fb;
  padding:12px;
  border-radius:8px;
  overflow:auto;
  font-size:13px;
  color:#0b1220;
}

/* TOC aside */
#toc { width:260px; padding:14px; }
#toc h2 { margin:0 0 10px 0; font-size:1rem; }
#toc a { display:block; padding:8px; border-radius:8px; font-weight:700; text-decoration:none; color:var(--text); margin-bottom:6px; }
#toc a.active { background:var(--accent); color:#fff; }

/* layout helpers for lessons page */
#lessons-wrapper { display:flex; gap:20px; max-width: var(--max-width); margin:20px auto; padding:0 20px; align-items:flex-start; }
#lessons { flex:1; }

/* dashboard grid */
.dashboard-grid { max-width:var(--max-width); margin:28px auto; padding:0 20px; display:grid; grid-template-columns: 1fr 340px; gap:20px; }
@media (max-width: 980px) { .dashboard-grid { grid-template-columns: 1fr; } #toc { position:relative; width:100% } #lessons-wrapper{flex-direction:column;} }

/* quiz */
.quiz-panel { padding:16px; border-radius:12px; background:var(--surface); border:1px solid var(--border); box-shadow:var(--card-shadow); }

/* option buttons */
.option-btn { padding:10px 12px; border-radius:10px; border:1px solid rgba(0,0,0,0.04); background:transparent; text-align:left; font-weight:700; cursor:pointer; }
.option-btn:hover { background:#f6f8ff; }

/* progress bar */
.progress-bar { height:12px; background:#eef2ff; border-radius:999px; overflow:hidden; }
.progress-fill { height:100%; width:0; background:var(--accent); transition:width .35s ease; }

/* footer */
footer { text-align:center; color:var(--muted); padding:22px 10px; margin-top:40px; }

/* responsive tweaks */
@media (max-width:620px) {
  .header-inner { flex-direction:column; align-items:stretch; gap:10px; padding:12px; }
  .brand { gap:8px; }
  .profile-menu { right:10px; left:10px; top:72px; }
}
/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  background-color: #f4f6fb;
  color: #222;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header {
  background: linear-gradient(90deg, #0078d4, #00bfa6);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.main-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
}

.mini-nav {
  display: flex;
  gap: 1rem;
}

.mini-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.mini-nav a:hover {
  opacity: 0.8;
}

/* Playground Container */
.playground-container {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background-color: #1e1e1e;
  padding: 0;
  height: calc(100vh - 70px);
}

.playground-container iframe {
  border: none;
  width: 100%;
  height: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    text-align: center;
  }
  .mini-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}
