/* ============================================================
   SHARED SIDEBAR — math.yolnoma.uz
   Barcha sahifalar uchun bir xil sidebar CSS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ── Base reset ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'JetBrains Mono', monospace;
  background-color: #f8fafc;
  color: #0f172a;
  margin: 0;
  overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  width: 280px;
  background: #ffffff;
  border-right: 2px solid #000;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

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

/* ── Sidebar header ── */
.sidebar-header {
  font-family: 'Orbitron', sans-serif;
  clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
  border-bottom: 2px solid #000;
  padding: 22px 20px 18px;
  background: #f8fafc;
  flex-shrink: 0;
}

.sidebar-logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #0f172a;
}

.sidebar-subtitle {
  margin-top: 4px;
  font-size: 0.68rem;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  letter-spacing: 0.05em;
}

/* ── Nav label ── */
.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #94a3b8;
  text-transform: uppercase;
  padding: 14px 20px 6px;
}

/* ── Menu ── */
.sidebar-menu {
  padding: 12px 16px;
  flex: 1;
}

/* ── Items ── */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 6px;
  background: #f1f5f9;
  border: 1.5px solid #000;
  clip-path: polygon(0 0, 100% 0, 96% 100%, 0 100%);
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  transition: background 0.18s, transform 0.18s, color 0.18s;
  position: relative;
}

.sidebar-item .si-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: #00f2ff;
  transform: translateX(5px);
  color: #000;
}

/* Active page highlight */
.sidebar-item.active {
  background: #ff00ea;
  color: #fff;
  border-color: #000;
}

.sidebar-item.active:hover {
  background: #e000d3;
  transform: translateX(5px);
  color: #fff;
}

/* ── Sidebar footer ── */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1.5px solid #e2e8f0;
  font-size: 0.62rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* ── Overlay (mobile) ── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ── Hamburger button ── */
.sidebar-toggle-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #00f2ff;
  cursor: pointer;
  padding: 10px;
  transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
  background: #00f2ff;
  box-shadow: 4px 4px 0 #000;
}

.sidebar-toggle-btn span {
  display: block;
  height: 2px;
  background: #000;
  border-radius: 2px;
  transition: all 0.25s;
}

/* ── Main content shift ── */
.main-content {
  transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 100vh;
}

/* ── Desktop: sidebar always visible ── */
@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0) !important;
  }

  .main-content {
    margin-left: 280px;
  }

  .sidebar-overlay {
    display: none !important;
  }

  .sidebar-toggle-btn {
    display: none;
  }
}

/* ── Mobile: push content when open ── */
@media (max-width: 1023px) {
  .main-content.shifted {
    margin-left: 0;
  }
}

/* ── Shared cyber components ── */
.cyber-header {
  font-family: 'Orbitron', sans-serif;
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
  border-bottom: 5px solid #00f2ff;
  background: white;
}

.cyber-card {
  background: white;
  border: 2px solid #000;
  box-shadow: 6px 6px 0px #00f2ff;
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%);
}

.cyber-button {
  font-family: 'Orbitron', sans-serif;
  clip-path: polygon(15% 0, 100% 0, 85% 100%, 0 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #00f2ff;
  color: #000;
  border: 1px solid #000;
  cursor: pointer;
  font-weight: 900;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.cyber-button:hover {
  background: #ff00ea;
  color: white;
  box-shadow: 0 0 20px rgba(255, 0, 234, 0.4);
  transform: translateY(-2px);
}

/* ── Back to top ── */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  width: 44px;
  height: 44px;
  background: #000;
  color: #00f2ff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  transition: background 0.2s, transform 0.2s;
}

#back-to-top:hover {
  background: #ff00ea;
  color: #fff;
  transform: translateY(-3px);
}

#back-to-top.visible {
  display: flex;
}
