/* Excel Data Analitika — o‘qituvchi platformasi */

:root {
  --bg: #f6f4ef;
  --bg-card: #fffcf7;
  --bg-sidebar: #1a1d24;
  --text: #1c1e24;
  --text-muted: #5c5f6b;
  --border: #e4dfd4;
  --accent: #217346;
  --accent-soft: #d1fae5;
  --success: #0f766e;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --shadow: 0 4px 24px rgba(28, 30, 36, 0.08);
}

[data-theme="dark"] {
  --bg: #12141a;
  --bg-card: #1a1d26;
  --bg-sidebar: #0d0f14;
  --text: #ececf1;
  --text-muted: #9a9dad;
  --border: #2a2e3a;
  --accent: #34d399;
  --accent-soft: #064e3b;
  --success: #2dd4bf;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: #e8e9ed;
  display: flex;
  flex-direction: column;
  padding: 1rem 0 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 1rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #217346, #0d4d2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.brand strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.brand-sub {
  font-size: 11px;
  color: #9ca3af;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.14);
}

.search-wrap {
  padding: 0.75rem 1rem 0.5rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: #f3f4f6;
  font-family: inherit;
  font-size: 13px;
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

.progress-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 1rem;
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #34d399, #217346);
  border-radius: 2px;
  transition: width 0.35s ease;
}

.progress-text {
  font-size: 11px;
  color: #9ca3af;
  padding: 0.35rem 1rem 0.5rem;
  margin: 0;
}

/* Scrollbar ko‘rinmaydi, lekin sichqoncha/touch va klaviatura bilan scroll ishlaydi */
.nav-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.5rem 1rem;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Eski Edge / IE */
}

.nav-tree::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome, Safari, Chromium Edge */
}

.phase-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.75rem 0.75rem 0.35rem;
}

.week-block {
  margin-bottom: 0.25rem;
}

.week-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #d1d5db;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-align: left;
}

.week-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.week-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.week-badge.b-blue { background: #1e3a5f; color: #93c5fd; }
.week-badge.b-teal { background: #134e4a; color: #5eead4; }
.week-badge.b-purple { background: #3730a3; color: #c4b5fd; }
.week-badge.b-coral { background: #7c2d12; color: #fdba74; }
.week-badge.b-amber { background: #78350f; color: #fcd34d; }
.week-badge.b-pink { background: #831843; color: #f9a8d4; }
.week-badge.b-green { background: #14532d; color: #86efac; }
.week-badge.b-red { background: #7f1d1d; color: #fca5a5; }
.week-badge.b-gray { background: #374151; color: #d1d5db; }

.week-toggle-title {
  flex: 1;
  font-weight: 500;
}

.week-arrow {
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.week-block.open .week-arrow {
  transform: rotate(90deg);
}

.lesson-links {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.35rem 2.1rem;
  display: none;
}

.week-block.open .lesson-links {
  display: block;
}

.lesson-links a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  color: #9ca3af;
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.35;
}

.lesson-links a:hover {
  color: #f3f4f6;
  background: rgba(255, 255, 255, 0.06);
}

.lesson-links a.active {
  color: #fff;
  background: rgba(33, 115, 70, 0.35);
}

.lesson-links a.hidden-by-search {
  display: none;
}

.sidebar-foot {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.link-muted {
  color: #9ca3af;
  text-decoration: none;
}

.link-muted:hover {
  color: #e5e7eb;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 1.75rem 2rem 3rem;
  max-width: 900px;
}

.main-header {
  margin-bottom: 1.25rem;
}

.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.lesson-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.lesson-meta {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
}

.lead {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.welcome-list {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.welcome-list li {
  margin-bottom: 0.35rem;
}

.welcome-actions {
  margin-top: 1rem;
}

.btn-primary {
  padding: 0.65rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.tab {
  padding: 0.45rem 0.85rem;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tab.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.tab-panels {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.tab-panel {
  min-height: 200px;
}

.tab-panel[hidden] {
  display: none !important;
}

.tab-panel h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.tab-panel h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.5rem;
}

.tab-panel p {
  margin: 0 0 0.75rem;
  color: var(--text);
}

.tab-panel ul,
.tab-panel ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.tab-panel li {
  margin-bottom: 0.35rem;
}

.code-block-wrap {
  margin: 0.75rem 0 1rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f1419;
}

[data-theme="dark"] .code-block-wrap {
  background: #0a0d12;
}

.code-block-title {
  padding: 0.4rem 0.75rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

pre.code-block {
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: #e5e7eb;
}

.exercise-card {
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
}

.exercise-card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.exercise-card p {
  margin: 0;
  font-size: 14px;
}

.hint {
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.teacher-note {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success);
  background: rgba(15, 118, 110, 0.08);
  font-size: 14px;
}

[data-theme="dark"] .teacher-note {
  background: rgba(45, 212, 191, 0.1);
}

.lesson-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mobile-nav-toggle {
  display: none;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 50;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

@media (max-width: 960px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: min(300px, 88vw);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    padding: 1.25rem 1.25rem 5rem;
    max-width: none;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lesson-title {
    font-size: 1.4rem;
  }
}

body.sidebar-open::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 35;
}

@media (min-width: 961px) {
  body.sidebar-open::after {
    display: none;
  }
}
