:root {
  --header-height: 78px;
  --footer-height: 56px;
  --output-height: calc(100vh - var(--header-height) - var(--footer-height));
  --message-blox-height: var(--output-height);
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
  min-height: 100vh;
  min-width: 100vw;
  box-sizing: border-box;
}

button {
  margin: 5px;
  padding: 8px 16px;
  font-size: 16px;
}

#input-box {
  padding: 8px;
  font-size: 16px;
}

#clear-btn, #savelog-btn ,#autoscroll-btn {
  position: absolute;
  top: 10px;
  z-index: 2;
  padding: 4px 12px;
  font-size: 0.9em;
  background: #001e54;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}


#clear-btn {
  right: 20px;
}

#savelog-btn {
  right: 100px;
}

#autoscroll-btn {
  right: 210px;
}



#clear-btn:hover, #autoscroll-btn:hover,#savelog-btn:hover  {
  background: #0d91dd;
}

.toggle-btn.active {
  background: #0d91dd;
}
.toggle-btn.inactive {
  background: #888;
}

.modal {
  display: none; 
  position: fixed; 
  z-index: 10; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgba(0,0,0,0.4); 
}

.modal-content {
  background-color: #fff;
  margin: 10% auto; 
  padding: 20px;
  border: 1px solid #888;
  width: 320px;
  border-radius: 10px;
  position: relative;
}

.close {
  color: #aaa;
  position: absolute;
  right: 16px;
  top: 8px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #001e54;
}

.ser_term_logo img {
  max-height: 60px;                /* Reduced logo size */
  max-width: 120px;
  height: auto;
  width: auto;
  margin-right: 12px;               /* Space between logo and title */
}

.ser_term_title {
  margin: 0;
  font-family: 'palatino linotype';
  font-size: 2em;
  font-weight: bold;
  letter-spacing: 1px;
  flex: 0.8;
  text-align: center;
}

.ser_term_container {
  background: #ffffff;
}

/* Dark mode background for ser_term_container */
body.dark-mode .ser_term_container {
  background: #181c24;
}

/* Hamburger menu styles */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  width: 36px;
  height: 36px;
  margin-right: 18px;
  margin-left: 0;
  z-index: 1001;
  transition: 0.3s;
}
.hamburger span {
  display: block;
  height: 4px;
  width: 28px;
  background: #001e54;
  margin: 4px 0;
  border-radius: 2px;
  transition: 0.3s;
}

/* Hamburger animation when active */
.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Side navigation styles */
.side-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100% - var(--header-height));
  width: 0;
  z-index: 1100;
  background-color: #fff;
  overflow-x: hidden;
  transition: 0.3s;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  border-top-left-radius: 0;
  border-bottom-left-radius: 12px;
}
.side-nav-content {
  padding: 32px 24px 24px 24px;
}
.side-nav ul {
  list-style: none;
  padding: 0;
  margin: 40px 0 0 0;
}
.side-nav ul li {
  margin: 18px 0;
}
.side-nav ul li a {
  color: #001e54;
  text-decoration: none;
  font-size: 1.2em;
  transition: color 0.2s;
}
.side-nav ul li a:hover {
  color: #0d91dd;
}
.close-side-nav {
  background: none;
  border: none;
  font-size: 2em;
  color: #001e54;
  position: absolute;
  top: 10px;
  right: 18px;
  cursor: pointer;
}

/* Adjust header for hamburger */
.ser_term_header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 32px 10px 32px;
  background: #fff;
  color: #001e54;
  border-radius: 0px 0px 18px 18px;
  margin-bottom: 0;
  border: none; /* Remove all borders */
  border-bottom: 6px solid #001e54; /* Add thick underline */
  box-sizing: border-box;
  margin-bottom: 36px;
}

/* User profile icon styles */
.user-profile {
  margin-left: auto;
  margin-right: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.user-profile img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #001e54;
  background: #fff;
  object-fit: cover;
}

/* Profile slider styles */
.profile-nav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1101;
  top: 0;
  right: 0;
  background-color: #fff;
  overflow-x: hidden;
  transition: 0.3s;
  box-shadow: -2px 0 8px rgba(0,0,0,0.08);
}
.profile-nav-content {
  padding: 32px 24px 24px 24px;
}
.profile-nav ul {
  list-style: none;
  padding: 0;
  margin: 40px 0 0 0;
}
.profile-nav ul li {
  margin: 18px 0;
}
.profile-nav ul li a {
  color: #001e54;
  text-decoration: none;
  font-size: 1.2em;
  transition: color 0.2s;
}
.profile-nav ul li a:hover {
  color: #0d91dd;
}
.close-profile-nav {
  background: none;
  border: none;
  font-size: 2em;
  color: #001e54;
  position: absolute;
  top: 10px;
  left: 18px;
  cursor: pointer;
}

/* Theme toggle styles */
.theme-toggle {
  margin-left: 18px;
  margin-right: 0;
  display: flex;
  align-items: center;
  cursor: pointer;
  width: 36px;
  height: 36px;
}
.theme-toggle img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eee;
  border: 1.5px solid #001e54;
  transition: background 0.2s;
}

footer {
  background-color: rgb(255, 255, 255);
  height: var(--footer-height, 56px)
  color: #001e54;
  font-family: palatino linotype;
  font-weight: bold;
  padding: 10px;
  text-align: center;
  width: 100%;
  position: fixed;
  bottom: 0;
  box-sizing: border-box;
  border-top-style: solid;
  border-top-width: 6px;
  border-radius: 18px 18px 0px 0px;
  border-color: #001e54;
}


/* dark mode support */
body.dark-mode {
  background: #181c24;
  color: #e0e6ef;
}

body.dark-mode .ser_term_header ,
body.dark-mode .ser_term_footer{
  background: #222b3a;
  color: #e0e6ef;
  border-color: #0d91dd;
}

body.dark-mode .ser_term_title,
body.dark-mode .ser_term_logo,
body.dark-mode .hamburger span,
body.dark-mode .theme-toggle img,
body.dark-mode .user-profile img {
  color: #e0e6ef;
}

body.dark-mode .side-nav,
body.dark-mode .profile-nav {
  background: #232b3a;
  color: #e0e6ef;
}

body.dark-mode .side-nav ul li a,
body.dark-mode .profile-nav ul li a {
  color: #e0e6ef;
}

body.dark-mode .side-nav ul li a:hover,
body.dark-mode .profile-nav ul li a:hover {
  color: #0d91dd;
}

body.dark-mode .modal-content {
  background: #232b3a;
  color: #e0e6ef;
}

body.dark-mode .output-wrapper {
  background: #232b3a;
  color: #e0e6ef;
}

body.dark-mode .theme-toggle img {
  background: #222b3a;
  border-color: #0d91dd;
}

/* Hamburger and close button color for dark mode */
body.dark-mode .hamburger span {
  background: #e0e6ef;
}

body.dark-mode .close-side-nav,
body.dark-mode .close-profile-nav {
  color: #e0e6ef;
}

body.dark-mode .hamburger {
  background: transparent;
}

.main-content {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  gap: 16px;
}

.output-wrapper {
  flex: 1 1 60%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  width: 100%;
  height:75vh;
  background: #d0e0f0;
  color: #001e54;
  border-radius: 10px;
  box-sizing: border-box;
  white-space: pre;
  margin-left: 10px;
}

.message-blox {
  margin-right: 10px;
  flex: 1 1 40%;
  background: #d0e0f0;
  color: #001e54;
  border-radius: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  min-width: 220px;
  max-width: 40vw;
  font-family: 'palatino linotype', Arial, sans-serif;
  max-height: calc(100vh - var(--header-height, 78px) - var(--footer-height, 56px) - 40px); /* Ensures it fits and scrolls */
}

body.dark-mode .message-blox {
  background: #232b3a;
  color: #e0e6ef;
}

.output-console-header {
  display: flex;
  align-items: center;
  justify-content: center;   /* Center all content horizontally */
  position: relative;
  min-height: unset;
  height: auto;
  margin-bottom: 0;
  padding: 0;
  gap: 12px; /* Optional: space between title and buttons */
}

.output-console-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  height: 100%;
}

#output {
  margin: 0;
  padding: 0 8px;
  min-height: 0;
  background: transparent;
}

.output-line {
  user-select: all;
  cursor: pointer;
  white-space: pre;
  padding: 0 2px;
}

.output-title{
  font-family: 'palatino linotype', Arial, sans-serif;
  font-weight: bold;
  font-size: 1.2em;
  color: #001e54;
  margin-top: 5px;
  padding: 8px;
  align-content: center;
  flex: 0 1 auto;
  text-align: center;
  text-decoration: underline; /* Add underline */
}