/* === Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === Body === */
body {
  font-family: "Fira Sans", sans-serif;
  background: radial-gradient(circle at top left, #0f172a, #1e293b);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* === Navbar === */
.navbar {
  display: flex;
  align-items: center;
  justify-content: start;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  height: 55px;
}

.nav-title {
  font-size: 18px;
  color: #38bdf8;
  margin-left: 12px;
  font-weight: 600;
}

/* === Menu Toggle === */
.menu-toggle {
  background: transparent;
  border: none;
  color: #38bdf8;
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.menu-toggle.open {
  transform: rotate(90deg);
}

/* === Main Layout === */
.container {
  display: flex;
  flex: 1;
  overflow: hidden;
  margin-top: 55px; /* space for navbar */
}

/* === Sidebar === */
.sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  padding: 20px;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  z-index: 998;
}

.sidebar h2 {
  color: #38bdf8;
  margin-bottom: 15px;
  font-weight: 600;
  text-align: center;
}

.sidebar input {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  margin-bottom: 15px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
}

.sidebar li {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  transition: background 0.3s;
  list-style: none;
}

.sidebar li:hover,
.sidebar li.active {
  background: rgba(56, 189, 248, 0.25);
}

/* === Content === */
.content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

#practicalDetails {
  background: rgba(255, 255, 255, 0.05);
  padding: 25px;
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* === Buttons === */
.code-actions {
  margin: 15px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button {
  background: #0ea5e9;
  border: none;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 14px;
  width: auto;
  text-align: center;
}

/* === Code Block === */
pre {
  background: #0f172a;
  padding: 15px;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* === Explanation & Output === */
.explanation,
.output {
  background: rgba(255, 255, 255, 0.07);
  padding: 15px;
  border-radius: 10px;
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
}

/* === Footer === */
footer {
  text-align: center;
  padding: 10px;
  font-size: 14px;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
}

/* === Scrollbars === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.3);
  border-radius: 6px;
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: rgba(15, 23, 42, 0.9);
  color: #38bdf8;
  padding: 10px 18px;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  font-size: 14px;
  z-index: 2000;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* === Overlay for Mobile === */
body.sidebar-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 997;
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 55px;
    left: -100%;
    height: calc(100vh - 55px);
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    transition: left 0.3s ease-in-out;
    z-index: 998;
  }

  .sidebar.open {
    left: 0;
  }

  .content {
    padding: 15px;
  }

  #practicalDetails {
    padding: 15px;
    font-size: 14px;
  }

  .code-actions {
    flex-direction: column;
    gap: 10px;
  }

  pre {
    font-size: 13px;
  }

  footer {
    font-size: 13px;
    padding: 8px;
  }
}
