@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

.background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 85px;
  height: 100vh;
  background-color: rgb(23, 23, 23);
  border-right: 1px solid rgb(87, 87, 87);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.sidebar-top {
  position: absolute;
  top: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.sidebar-bottom {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ---------- NAVBAR ---------- */
.top-navbar {
  position: fixed;
  top: 0;
  left: 85px;
  width: calc(100% - 85px);
  height: 70px;
  background-color: rgb(23, 23, 23);
  border-bottom: 1px solid rgb(87, 87, 87);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  z-index: 150;
}

/* ---------- LEFT SIDE (logo + search) ---------- */
.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1 auto;
  min-width: 0; /* allows the search bar to shrink */
}

/* logo */
.logo {
  height: 40px;
  width: auto;
  margin-left: 5px;
  margin-top: 5px;
}

.logo-mobile {
  display: none;
}

/* search form */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 480px;
  max-width: clamp(260px, 40vw, 850px);
  margin-right: 20px;
}

.search-input {
  width: 100%;
  height: 34px;
  border-radius: 100px;
  padding-left: 20px;
  padding-right: 40px;
  font-size: 15px;
  box-shadow: 0 0 0 4px rgb(58, 58, 58);
  border: 2px solid rgb(77, 220, 211);
  background-color: rgb(36, 36, 36);
  color: white;
  font-family: 'Outfit', sans-serif;
  transition: max-width 0.2s ease, width 0.2s ease;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Outfit', sans-serif;
}

.search-submit {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgb(77, 220, 211);
  background-color: rgb(77, 220, 211);
  cursor: pointer;
}

/* ---------- RIGHT SIDE (dashboard + user + notif) ---------- */
.nav-right {
  display: flex;
  align-items: center;
  gap: 25px;
  flex: 0 0 auto;
}

.dashboard-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 35px;
  padding: 0 14px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 13px;
  border: 1px solid rgb(67, 186, 176);
  color: rgb(67, 186, 176);
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  margin-right: -10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  color: rgb(82, 235, 223);
  font-size: 16px;
  margin-right: 0px;
}

.user-info img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgb(67, 186, 176);
  object-fit: cover;
}

.notification img {
  display: block;
  margin-right: 45px;
}

/* ---------- SUBJECT NAV PANEL (slider) ---------- */
.subject-nav-panel {
  position: fixed;
  top: 70px;
  left: 85px;
  bottom: -10px;
  width: 241px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0px 15px 30px 15px;
  background: rgba(0, 0, 0, 0.3);
  scroll-behavior: smooth;
  box-sizing: border-box;
  justify-content: flex-start;
  z-index: 120;
}

/* wraps the top-level (layer 0) cards so they can be shown/hidden as a group */
.subject-layer0 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/*#first-card {*/
/*    margin-top: 50px;*/
/*}*/

/* the "← Back" card pinned at the top of each group/subgroup */
.back-card {
  height: 56px;
  font-size: 16px;
  font-weight: 400;
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.35);
}

.back-card:hover {
  opacity: 1;
}

.subject-card {
  text-align: center;
  flex: 0 0 auto;
  width: 100%;
  max-width: 200px;
  height: 200px;
  margin-bottom: 30px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgb(140, 140, 140);
  border-radius: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Outfit', sans-serif;
  font-size: 25px;
  font-weight: 300;
  color: rgb(82, 235, 223);
  cursor: pointer;
  transition: background-color 0.4s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.subject-card:last-child {
  margin-bottom: 0;
}

.subject-card:first-child {
  margin-top: 20px;
}

.subject-card:hover {
  background-color: rgba(0, 0, 0, 0.7);
  transform: scale(1.01);
  box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.3);
}

.subject-group {            /* LAYER 1 */
  display: none;             /* hidden by default */
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.subject-subgroup {          /* LAYER 2 */
  display: none;              /* hidden by default */
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.subject-nav-panel::-webkit-scrollbar {
  width: 10px;
}

.subject-nav-panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  margin-top: 10px;
  margin-bottom: 20px;
}

.subject-nav-panel::-webkit-scrollbar-thumb {
  background: #9adad1;
  border-radius: 10000px;
}

.subject-nav-panel::-webkit-scrollbar-thumb:hover {
  background: #83b9b2;
}

/* ---------- ICON FLIP EFFECT ---------- */
.sidebar-icon {
  width: 60px;
  height: 60px;
  perspective: 1000px;
}

.flip-box {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
  border-radius: 20%;
}

.flip-front,
.flip-back {
  cursor: pointer;
  position: absolute;
  inset: 0;
  border-radius: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  backface-visibility: hidden;
  background-color: rgb(59, 59, 59);
}

.flip-front img {
  width: 30px;
  height: auto;
}

.flip-back {
  transform: rotateY(180deg);
  color: rgb(82, 235, 223);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  text-align: center;
}

.sidebar-icon:hover .flip-box {
  transform: rotateY(180deg);
}

/* highlight whichever sidebar icon corresponds to the current page
   (matches the same treatment used on the practice page) */
.sidebar-icon.active .flip-front {
  background-color: rgb(77, 220, 211);
}
.sidebar-icon.active .flip-front img {
  filter: brightness(0) saturate(100%);
}

/* shared offset for icons whose image needs nudging left inside the frame */
.icon-offset-left { position: absolute; left: 18px; }

/* shared smaller label size (used to be duplicated per-id) */
.icon-label-small { font-size: 10px; }

/* ---------- Z-INDEX ORDER ---------- */
.background-image { z-index: 0; }
.subject-nav-panel { z-index: 120; }
.top-navbar { z-index: 150; }
.sidebar { z-index: 200; }


/* Fills everything not covered by navbar (70) + sidebar (85) + slider (241) */
.main-content-area {
  position: fixed;
  top: 70px;                          /* below navbar */
  left: calc(85px + 241px);           /* to the right of sidebar + slider */
  right: 0;                           /* reach the right edge */
  bottom: 0;                          /* reach the bottom */
  overflow: auto;                     /* scroll this area independently */
  z-index: 110;                       /* under navbar & sidebar, over bg */
  padding: 24px;
  box-sizing: border-box;
}

/* THIS is your dark rounded box */
.content-box {
  min-height: 100%;                   /* fill to bottom, expand if needed */
  background: rgba(0,0,0,0.35);       /* same brightness as before */
  border: 1px solid rgb(87, 87, 87);
  border-radius: 16px;
  backdrop-filter: blur(2px);
  color: white;
  box-sizing: border-box;
  padding: 24px 40px;                 /* inner spacing */
}

/* Just a normal container for injected HTML */
.content-panel {
  position: static;
  width: 100%;
}


.welcome-title {
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 42px;
  color: rgb(82, 235, 223);
  margin: 20px 0 40px;
}

.welcome-image-frame {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 16 / 9;
  margin: 0 auto 40px;
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgb(87, 87, 87);
  border-radius: 24px;
  overflow: hidden;
}

.welcome-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.welcome-text {
  text-align: center;
  /* max-width: 700px; */
  margin: 0 auto;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.8;
  color: rgb(82, 235, 223);
}

.welcome-text-box {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1.8;
  color: rgb(82, 235, 223);
}

/* Explicitly pin real note paragraphs to left-align, independent of the welcome screen */
.content-panel p {
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  color: white;
  margin: 0 0 14px;
}

/* ---------- NOTE CONTENT STYLING ---------- */

.note-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  margin: 12px 0 24px 0;
}

.note-status {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  color: rgb(82, 235, 223);
  text-align: center;
}

.content-panel h2 {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 26px;
  color: rgb(82, 235, 223);
  margin: 32px 0 14px;
}

.content-panel h2:first-child {
  margin-top: 0;
}

.content-panel h3 {
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 19px;
  color: rgb(200, 240, 237);
  margin: 20px 0 10px;
}

.content-panel p {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.75;
  color: white;
  margin: 0 0 14px;
}

.content-panel strong {
  font-weight: 600;
  color: rgb(82, 235, 223);
}

.content-panel ul,
.content-panel ol {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 15.5px;
  line-height: 1.7;
  color: white;
  margin: 0 0 16px;
  padding-left: 26px;
}

.content-panel li {
  margin-bottom: 6px;
}

.content-panel li ul,
.content-panel li ol {
  margin-top: 6px;
  margin-bottom: 6px;
}

.content-panel code {
  background: rgba(255, 255, 255, 0.08);
  color: rgb(140, 235, 223);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Code', monospace;
  font-size: 0.9em;
}

.content-panel img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  margin: 10px 0 20px;
}

.content-panel {
  font-family: 'Outfit', sans-serif;
}

.note-header {
  margin-bottom: 4px;
}

.note-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 30px;
  color: rgb(82, 235, 223);
  margin: 0 0 6px;
}

.note-breadcrumb {
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}

@media (max-width: 1000px) {

  /* ---------- SIDEBAR → bottom bar ---------- */
  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0;
    border-right: none;
    border-top: 1px solid rgb(87, 87, 87);
  }

  .sidebar-top,
  .sidebar-bottom {
    display: contents;
  }

  .sidebar-icon {
    width: 42px;
    height: 42px;
  }

  .flip-front img {
    width: 22px;
  }

  .icon-offset-left {
    position: static;
    left: auto;
  }

  #long-flip {
    font-size: 6px;
  }
  
  .flip-back {
     transform: rotateY(180deg);
     color: rgb(82, 235, 223);
     font-family: 'Outfit', sans-serif;
     font-size: 10px;
     text-align: center;
  }
  /*.sidebar-icon:hover .flip-box {*/
  /*  transform: none;*/
  /*}*/

  /*.flip-back {*/
  /*  display: none;*/
  /*}*/

  /* ---------- NAVBAR ---------- */
  .top-navbar {
    left: 0;
    width: 100%;
    height: 60px;
    padding: 0 12px;
  }

  .nav-left {
    gap: 10px;
  }

  .logo-desktop {
    display: none;
  }

  .logo-mobile {
    display: block;
    height: 40px;
    width: auto;
  }

  .search-form {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    margin-right: 10px;
  }

  .search-input {
    font-size: 13px;
    padding-left: 14px;
    padding-right: 34px;
  }

  /* shrink avatar + bell so the search bar keeps its width */
  .nav-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .dashboard-link {
    display: none;
  }

  .user-info {
    gap: 0;
  }

  .user-info span {
    display: none;
  }

  .user-info img {
    width: 30px;
    height: 30px;
  }

  .notification {
    margin-right: 10px;
  }

  .notification img {
    width: 22px;
    height: auto;
    margin-right: 10px;
  }

  /* ---------- SUBJECT NAV PANEL → horizontal strip ---------- */
  .subject-nav-panel {
    position: fixed;
    top: 60px;
    left: 0;
    bottom: auto;
    width: 100vw;
    height: 130px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 15px;
  }

  .subject-layer0,
  .subject-group,
  .subject-subgroup {
    flex-direction: row;
    width: max-content;
  }

  .subject-card {
    width: 110px;
    max-width: 110px;
    height: 100px;
    margin-bottom: 0;
    margin-right: 12px;
    font-size: 15px;
    border-radius: 22px;
  }

  .subject-card:first-child {
    margin-top: 0;
  }

  .subject-card:last-child {
    margin-right: 0;
    margin-bottom: 0;
  }

  .back-card {
    height: 100px;
    font-size: 13px;
  }

  /* ---------- MAIN CONTENT ---------- */
  .main-content-area {
    top: 190px;
    left: 0;
    right: 0;
    bottom: 60px;
    padding: 16px;
  }

  .content-box {
    padding: 16px 20px;
  }

  .welcome-title {
    font-size: 28px;
    margin: 10px 0 24px;
  }

  .welcome-image-frame {
    border-radius: 16px;
  }

  .welcome-text {
    font-size: 15px;
    line-height: 1.6;
  }
}

@media (max-width: 420px) {
  .subject-card {
    width: 95px;
    max-width: 95px;
    height: 90px;
    font-size: 13px;
  }

  .sidebar-icon {
    width: 36px;
    height: 36px;
  }

  .search-form {
    flex: 1 1 auto;
  }
}