/* ----------------------------------------------------
   GLOBAL
-----------------------------------------------------*/
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: #f6f8ff;
  color: #1a1a1a;
  line-height: 1.6;
  overflow-y: scroll;
}

/* ----------------------------------------------------
   HEADER
-----------------------------------------------------*/
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 1rem 2rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  font-family: "Poppins", "Inter", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #0e1a4a;
  margin: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.username-label {
  background: #eef2ff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a237e;
}

.logout-btn {
  background: #eaf0ff;
  color: #1a3a8c;
  border: 1px solid #a5b8e0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.logout-btn:hover {
  background: #d4e3ff;
  transform: translateY(-1px);
}

/* ----------------------------------------------------
   LAYOUT
-----------------------------------------------------*/
main#training {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem 2rem 3rem;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* ----------------------------------------------------
   SIDEBAR
-----------------------------------------------------*/
.sidebar {
  position: sticky;
  top: 90px;
  align-self: flex-start;
  width: 250px;
  background: #ffffff;
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d0d7ff #f6f8ff;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: #cdd7ff;
  border-radius: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f6f8ff;
}

.menu-header {
  font-weight: 700;
  color: #1a237e;
  margin-bottom: 0.5rem;
}

.content-menu,
.content-menu li,
.content-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ----------------------------------------------------
   FOLDER BUTTONS
-----------------------------------------------------*/
.menu-item[data-path="undefined"] {
  width: 100%;
  background: #e9f0ff;
  color: #1a237e;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s ease;
}

/* Arrow indicator */
.menu-item[data-path="undefined"]::after {
  content: "▸";
  font-size: 1rem;
  color: #1a237e;
  transition: transform 0.25s ease;
}

/* Rotated arrow when open */
.menu-item.folder-open::after {
  transform: rotate(90deg);
}

/* Hover */
.menu-item[data-path="undefined"]:hover {
  background: #dce8ff;
}

/* ----------------------------------------------------
   SUBMENU CONTAINER
-----------------------------------------------------*/
.submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  margin-left: 6px;
  border-left: 2px solid #dbe2ff;
  padding-left: 6px;
}

.submenu.open {
  max-height: 800px; /* safe max height */
  opacity: 1;
}

/* ----------------------------------------------------
   FILE ITEMS
-----------------------------------------------------*/
.menu-item[data-path]:not([data-path="undefined"]) {
  display: block;
  width: 100%;
  background: #f7f9ff;
  color: #1a237e;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  margin-top: 4px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
}

.menu-item[data-path]:hover {
  background: #e9f0ff;
  border-color: #d0dcff;
}

/* Active Selected File */
.menu-item.active {
  background: linear-gradient(90deg, #dee5ff, #eaf0ff);
  border: 1px solid #a6b7ff !important;
  font-weight: 600;
  color: #1d3ecf;
  box-shadow: inset 0 0 0 1px #8b9cff;
}

/* ----------------------------------------------------
   CONTENT PANEL
-----------------------------------------------------*/
#content {
  flex: 1;
  background: #ffffff;
  border-radius: 12px;
  padding: 2.5rem 3rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  max-width: 850px;
  margin: 0 auto;
}

#content.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ----------------------------------------------------
   RESTORED CONTENT THEME (HEADINGS, TABLES, CODE, LISTS)
-----------------------------------------------------*/

/* Headings inside markdown */
#content h1, #content h2, #content h3, #content h4 {
  color: #0e1a4a;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  line-height: 1.3;
  font-weight: 700;
}

#content h1 {
  font-size: 2rem;
  border-bottom: 2px solid #e2e8ff;
  padding-bottom: 0.3em;
}

#content h2 {
  font-size: 1.5rem;
  color: #1c2f8a;
}

#content h3 {
  font-size: 1.25rem;
  color: #2a3a8c;
}

#content h4 {
  font-size: 1.1rem;
  color: #3b4aa3;
}

/* Paragraphs */
#content p {
  margin: 0.75em 0;
  color: #333;
}

/* Lists */
#content ul, #content ol {
  padding-left: 1.6em;
  margin: 0.6em 0;
}

#content li {
  margin: 0.4em 0;
}

/* Strong text */
#content strong {
  color: #101c5a;
}

/* ----------------- TABLE FIX ----------------- */
#content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
  border: 1px solid #d0d7ff;
  background: white;
}

#content th {
  background: #eef2ff;
  border: 1px solid #c6d0ff;
  padding: 0.6em 0.8em;
  font-weight: 600;
  color: #1a237e;
}

#content td {
  border: 1px solid #d0d7ff;
  padding: 0.6em 0.8em;
  color: #333;
}

/* ----------------- CODE BLOCK FIX ----------------- */
#content pre {
  background: #f0f3ff;
  border: 1px solid #d6dcff;
  border-radius: 6px;
  padding: 1rem;
  margin: 1.2em 0;
  overflow-x: auto;
}

#content code {
  background: #f0f3ff;
  border: 1px solid #d6dcff;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/* ----------------- BLOCKQUOTE FIX ----------------- */
#content blockquote {
  border-left: 4px solid #a6b7ff;
  background: #f5f7ff;
  padding: 0.9em 1.2em;
  margin: 1.2em 0;
  border-radius: 6px;
  font-style: italic;
  color: #334;
}


/* ------------------------------
   LOGIN PAGE RESTORE FIX
------------------------------ */

body.login-body {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  background: #f6f8ff !important;
  height: 100vh !important;
  margin: 0 !important;
}

.login-container {
  background: #fff;
  padding: 3rem 3.5rem;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  text-align: center;
  width: 380px;
}

.login-title {
  text-transform: uppercase;
  font-weight: 700;
  color: #0e1a4a;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.login-subtitle {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.github-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
  width: 100%;
}

.github-login-btn img {
  width: 20px;
  height: 20px;
  filter: invert(1);
}

.github-login-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

