* {
  margin: 0;
}

html,
body {
  height: 100%;
  background: #f5f1ee;
  font-family: "Segoe UI", sans-serif;
}

#logoutDialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 5px;
  padding: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  font-family: "Segoe UI", sans-serif;
  text-align: center;
  background-color: white;
  z-index: 9999;
}

.logout-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(3px);
}

.logout-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

#confirmLogout,
#cancelLogout {
  background: #000;
  border: 1px solid #424244;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  padding: 5px 25px;
  opacity: 0.6;
  max-height: 47px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#confirmLogout:hover {
  background-color: #744ae2;
  border-color: #744ae2;
  transform: translateY(-1px);
}

#cancelLogout:hover {
  background-color: #744ae2;
  border-color: #744ae2;
  transform: translateY(-1px);
}

#confirmLogout #cancelLogout:active {
  transform: translateY(1px);
}
 
#confirmLogout:focus {
  outline: none;
  border-radius: 0;
  box-shadow: none; 
}

#login-apology-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 5rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  text-align: center;
  z-index: 9999;
}

#login-error-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 5rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  text-align: center;
  z-index: 9999;
}

.error-message {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.error-buttons {
  display: flex;
  justify-content: space-evenly;
  padding-top: 0.5cm;
}

.error-buttons button {
  background: #000;
  border: 1px solid #424244;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  padding: 5px 25px;
  opacity: 0.6;
  max-height: 47px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.error-buttons button:hover {
  background-color: #744ae2;
  border-color: #744ae2;
  transform: translateY(-1px);
}

.error-buttons button:active {
  transform: translateY(1px);
}

.hidden {
  display: none;
}

.spinner-overlay {
  position: fixed;
  inset: 0;
  background-color: #f5f1ee;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 6px solid #eee;
  border-top: 6px solid #895af3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#licenseDialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  overflow: hidden;
  width: 90vw;
  max-width: 900px;
  z-index: 10000;
}

.modal-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px;
  color: #000;
  background-color: #e6e6e6;
  border-radius: 5px;
  max-height: 80vh;
}

.modal-header h1 {
  font-size: 1.5em;
  font-weight: 700;
  text-align: center;
}

.modal-content {
  overflow-y: auto;
  flex-grow: 1;
  padding: 20px 40px;
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 5px;
  margin-top: 1rem;
}

.modal-text h1 {
  color: #001259;
  font-size: 1.3em;
  font-weight: 700;
}

.modal-text h2 {
  font-size: 1.2em;
  color: #000;
  font-family: Century Gothic;
  margin-bottom: 1.2rem;
}

.modal-text p,
.modal-text ul {
  font-size: 1em;
  color: #1c1c1c;
  line-height: 1.2em;
  margin-bottom: 1.2rem;
}

.modal-text ul {
  padding: 10px 0;
  margin-top: 30px;
}

.modal-text li {
  font-size: 1em;
  padding: 5px 0;
  color: #1c1c1c;
  list-style: none;
  line-height: 1.3em;
}

.modal-footer {
  padding: 20px 0 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin-top: 1rem;
}

.modal-footer button {
  background: #000;
  border: 1px solid #424244;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  padding: 5px 25px;
  opacity: 0.6;
  max-height: 47px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-footer button:hover {
  background-color: #744ae2;
  border-color: #744ae2;
  transform: translateY(-1px);
}

.modal-footer button:active {
  transform: translateY(1px);
}

@media (max-width: 768px) {
  .modal-box {
    padding: 1rem;
    margin: 0;
    height: auto;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .modal-header h1 {
    text-align: center;
    font-size: 1.25rem;
  }

  .modal-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 6px;
    background-color: #ffffff !important;
    color: #000;
  }

  .modal-content * {
    text-align: center;
  }

  .modal-footer {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .modal-footer button {
    width: 100%;
    max-width: 240px;
  }
  
  .dropdown {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
  }

  .dropdown img {
    padding: 5px 50px !important;
    margin: 0;
    flex-shrink: 0;
  }

  .dropdown-content {
    right: 2rem !important;
  }

  .menu {
    position: absolute;
    top: 10px;
    right: 16px;
    padding: 18px 50px !important; 
    margin: 0;
  }

  .dropdown-button {
    font-size: 14px;
    font-weight: bold;
    background: none;
    border: none;
    color: #87878a;
    cursor: pointer;
  }
}

@media (max-width: 480px) {
  .welcome-image {
    display: none !important;
  }

  #versionDialog {
    width: 85% !important;
    max-width: 300px !important;
    padding: 1.5rem 1rem !important;
  }

  #versionDialog h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  #versionDialog .version-list {
    font-size: 0.95rem;
  }

  #versionDialog button {
    font-size: 0.95rem;
    padding: 0.5rem 1.25rem;
  }
}

#welcome-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  padding: 0 2rem;
  gap: 3rem;
  overflow: hidden;
}

.main-text {
  flex: 1;
  max-width: 600px;
}

.welcome-text {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #222;
}

.welcome-paragraph {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #555;
}

.highlight {
  color: #895af3;
  font-weight: 600;
}

.welcome-image {
  flex: 1;
  max-width: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

#versionDialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  border-radius: 5px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  font-family: "Segoe UI", sans-serif;
  text-align: center;
  z-index: 9999;
}

.version-dialog::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(3px);
}

.version-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.version-list li {
  background: #f1f1f1;
  margin-bottom: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-weight: 500;
  color: #333;
}

.version-list li:hover {
  background-color: #e0dcff;
  color: #895af3;
}

#loadingMessage {
  display: none;
}

#openDialogButton {
  background: #000;
  border: 1px solid #424244;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  width: auto;
  max-height: 47px;
  border-radius: 0;
  outline: none;
  padding: 12px 25px;
  opacity: 0.6;
  margin-top: 5%;
}

#openDialogButton:hover {
  background-color: #744ae2;
  border: 1px solid #744ae2;
  transform: translateY(-1px);
}

#openDialogButton:active {
  transform: translateY(1px);
}

#closeDialog {
  background: #000;
  border: 1px solid #424244;
  font-size: 17px;
  font-weight: 500;
  color: #fff;
  width: auto;
  max-height: 47px;
  border-radius: 0;
  outline: none;
  padding: 5px 25px;
  opacity: 0.6;
}

#closeDialog:hover {
  background-color: #744ae2;
  border: 1px solid #744ae2;
  transform: translateY(-1px);
}

#closeDialog:active {
  transform: translateY(1px);
}

.dropdown img {
  padding: 5px 100px;
}

.loading-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: 2rem;
}

.spinner {
  margin: 0 auto 1rem auto;
  width: 48px;
  height: 48px;
  border: 6px solid #eee;
  border-top: 6px solid #744ae2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-container p {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
  font-weight: 500;
}

#containerDiv {
  display: flex;
  flex-direction: column;
  height: 100vh
}

.dropdown {
  position: relative;
  background-color: #fff;
  z-index: 10000; 
}

.dropdown::after {
  content: "";
  height: 13px;
  bottom: -12px;
  left: 0;
  background: transparent
    linear-gradient(
      180deg,
      #424244b9 0%,
      #26262746 24%,
      #20202121 43%,
      #0d0d0e00 100%
    )
    0% 0% no-repeat padding-box;
  opacity: 0.15;
  mix-blend-mode: multiply;
  width: 100%;
  position: absolute;
  z-index: 1;
}

.menu {
  padding: 18px 100px;
  cursor: pointer;
  float: right;
}

.menu:hover .dropdown-content {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

.dropdown-button {
  color: #87878a;
  font-size: 16px;
  font-weight: bold;
  background-color: #fff;
  font-family: sans-serif;
  border: none;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 2.8rem;
  right: 5rem;
  background-color: #ffffff;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  border-radius: 5px;
  font-family: sans-serif;
  font-size: 14px;
  width: max-content;
}

.dropdown-content a {
  color: #87878a;
  font-size: 16px;
  font-weight: bold;
  padding: 8px 11px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
}

#codeIframe {
  flex-grow: 1;
  border: none;
  width: 100%;
  height: 100vh;
  background: #f5f1ee;
  display: block;
}
