/* BASE PAGE LAYOUT -------------------------------------------- */
body {
  margin: 0;
  padding: 0;

  /* This ensures sidebar + viewer sit side-by-side on desktop */
  display: flex;
  flex-direction: row;

  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR ------------------------------------------------------ */
.sidebar {
  width: 250px;
  background: #003366;
  color: white;
  display: flex;
  flex-direction: column;
  padding: 10px;
  box-sizing: border-box;

  transition: transform 0.3s ease;
  z-index: 200;
}

/* Sidebar Buttons */
.sidebar button {
  padding: 12px;
  margin: 6px 0;
  background: #34495e;
  border: none;
  color: white;
  cursor: pointer;
  border-radius: 2rem;
}

.sidebar button:hover {
  background: #3d5a73;
}

.sidebar button:active {
  background-color: green;

}

/* Close button (mobile only) */
.close-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 26px;
  margin-left: auto;
  cursor: pointer;
}

/* VIEWER ------------------------------------------------------- */
.viewer {
  flex: 1;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

iframe {
  flex: 1;          /* Ensures full height */
  width: 100%;
  border: none;
}

/* HAMBURGER BUTTON -------------------------------------------- */
.toggle-btn {
  display: none;    /* Hidden on desktop */
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 300;

  background: #2c3e50;
  color: white;
  font-size: 22px;
  padding: 7px 10px;
  border: none;
  cursor: pointer;
}

/* OVERLAY ------------------------------------------------------ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  z-index: 150;
}

.overlay.show {
  display: block;
}

/* MOBILE RULES ------------------------------------------------ */
@media (max-width: 720px) {

  /* Hamburger visible */
  .toggle-btn {
    display: block;
  }

  /* Close button visible inside sidebar */
  .close-btn {
    display: block;
  }

  /* Sidebar moves off-screen by default */
  .sidebar {
    position: absolute;
    top: 0;
    left: 0;
    height: 200%;
    transform: translateX(-200%);
  }

  /* Sidebar visible when NOT collapsed */
  .sidebar:not(.collapsed) {
    transform: translateX(0);
  }
}

/* DESKTOP RULES ------------------------------------------------ */
@media (min-width: 721px) {

  /* Sidebar always visible on desktop */
  .sidebar {
    position: relative;
    transform: translateX(0);
  }
}
