/* Customizing scrollbar for the whole website */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 15px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
  cursor: default;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-track:hover {
  background: #ccc;
  cursor: default;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f0f0f0;
}

header {
  background-color: #3f51b5;
  color: #fff;
  padding: 20px;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  margin: 0;
  display: inline-block;
}

main {
  padding: 20px;
}

.menu-item {
  font-size: 20px;
  cursor: pointer;
}

.content-wrapper {
  background-color: #fff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
}

label {
  display: block;
  margin-bottom: 15px;
  color: #555;
  font-weight: 600;
  font-size: 18px;
  user-select: none;
  display: inline-block;
  position: relative;
}

.info-label::after {
  content: "";
  background-image: url("../icon/info1.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 5px;
  cursor: pointer;
}

textarea,
input,
button,
.overlay {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  color: #333;
  font-size: 16px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

textarea:focus,
input:focus,
button:focus {
  outline: none;
  border-color: #3f51b5;
  background-color: #fff;
}

textarea,
.overlay {
  overflow: auto;
  white-space: pre;
  max-width: 100%;
  min-width: 100%;
  min-height: 300px;
  max-height: 500px;
}

#queryName {
  color: #555;
  font-weight: bold;
  font-size: 30px;
  border: none;
  border-bottom: 3px solid #ccc;
}

/* Highlighting Query */
.query-parent {
  text-rendering: optimizeLegibility;
  position: relative;
  max-width: 100%;
  min-width: 100%;
  min-height: 300px;
  max-height: 500px;
  margin-bottom: 20px;
  overflow: hidden;
}

.overlay {
  color: transparent;
  font-family: monospace;
}

#query {
  background-color: transparent;
  z-index: 2;
}

#query,
.overlay {
  position: absolute;
  top: 0;
  left: 0;
}

.highlight {
  background-color: yellow;
  color: #333;
  font-weight: 600;
  border-radius: 3px;
}

.options {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.options .option {
  margin-right: 50px;
  margin-bottom: 10px;
}

.options input[type="checkbox"] {
  width: auto;
  transform: scale(1.5);
  margin: 0;
  margin-right: 10px;
}

.options input[type="text"] {
  width: 45px;
  height: 40px;
  margin: 0;
  margin-left: 10px;
}

.options label {
  margin: 0;
  color: #555;
  font-weight: 600;
  font-size: 18px;
}

@media only screen and (max-width: 600px) {
  .options {
    flex-direction: column;
    align-items: flex-start;
  }

  .options .option {
    margin-right: 0;
  }
}

#placeholder-div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#placeholder-div label {
  /* min-width: 50%;
  max-width: 100%; */
  margin: 10px auto;
}

table {
  min-width: 50%;
  max-width: 100%;
  margin: auto;
  border-collapse: collapse;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background-color: #3f51b5;
  color: #fff;
  font-size: 13px;
}

th,
td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
  font-weight: bold;
}

table tr td input {
  margin: 0;
  padding: 10px;
  font-size: 100%;
}

table tr td input:placeholder-shown {
  border-color: red;
}

tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

tbody tr:hover {
  background-color: #e6e6e6;
}

th:first-child,
td:first-child,
th:last-child,
td:last-child {
  border-left: none;
}

th,
td:first-child {
  padding-left: 20px;
}

th,
td:last-child {
  padding-right: 20px;
}

.text-center {
  text-align: center;
}

.btn-list {
  display: flex;
  justify-content: center;
}

.btn-list .btn {
  width: fit-content;
  background-color: #4caf50;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  margin: 10px 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-list .btn:hover {
  background-color: #388e3c;
}

.btn-list .btn:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
}

.output {
  background-color: #fff;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toolbar label {
  display: flex;
  align-items: center;
  margin: 0 10px 0 0;
}

.toolbar img {
  margin-left: 10px;
}

.img-btn {
  width: 30px;
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.img-btn:hover {
  background-color: #aaa;
}

#filename {
  width: 200px;
  margin: 0;
  margin-left: auto;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #f9f9f9;
  color: #333;
  font-size: 16px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

#filename:focus {
  outline: none;
  border-color: #3f51b5;
  background-color: #fff;
}

/* Media query for mobile devices */
@media screen and (max-width: 768px) {
  #filename {
    width: 100%;
  }
}

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.toast {
  background-color: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  margin-bottom: 10px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.toast.show {
  opacity: 1;
}

/* Custom Alert Style */
.custom-alert-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* semi-transparent background */
  z-index: 9998; /* place the overlay below the alert */
}

.custom-alert {
  max-width: 70%;
  max-height: 90%;
  overflow: auto;
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  min-width: 20%;
  transform: translate(-50%, -50%);
  background-color: #fff; /* background color */
  color: #333; /* text color */
  padding: 10px 20px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

.alert-content {
  position: relative;
  word-wrap: break-word;
  font-size: 15px;
  display: flex;
  flex-direction: column;
}

#alertMessage {
  overflow: auto;
}

#closeAlert {
  width: fit-content;
  margin: auto;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

#closeAlert:hover {
  color: #fff;
  background-color: #0069d9;
  border-color: #0062cc;
}

footer {
  background-color: #3f51b5;
  color: #fff;
  padding: 10px;
  text-align: center;
}

/* Loading animation overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  z-index: 9996;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loading {
  display: flex !important;
}

/* Loader animation */
.loader {
  border: 6px solid #3f51b5;
  border-radius: 50%;
  border-top: 6px solid transparent;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin-top: 20px;
  font-size: 18px;
  color: #333;
}

/* Sidebar Style */
.sidebar {
  position: fixed;
  top: 0;
  left: -105%;
  width: 97.5%;
  height: 100%;
  background-color: white;
  color: black;
  margin-top: 76px;
  padding: 20px;
  transition: left 0.3s;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar #queryNameSearch {
  width: 300px;
  height: 40px;
  flex-basis: 5%;
}
.sidebar #queryNameSearch:focus {
  box-shadow: 0 4px 8px rgba(63, 81, 181, 0.3);
}

.sidebar #queryNameListDiv {
  width: 100%;
  flex-basis: 76%;
  overflow: auto;
}

/* Style for the list */
#queryNameList {
  list-style-type: none;
  width: 60%;
  padding: 0;
  margin: auto;
}

/* Style for the list items (cards) */
#queryNameList .query-item {
  background-color: #f4f4f4;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#queryNameList .query-name-content {
  width: 88%;
  overflow-wrap: break-word;
}

#queryNameList .query-item:hover {
  box-shadow: 0 4px 8px rgba(63, 81, 181, 0.7);
}

#queryNameList .img-btn {
  width: 25px;
}

/* Modal Styles */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  align-items: center;
  justify-content: center;
}
.custom-modal[style*="flex"] {
  display: flex !important;
}
.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  min-width: 300px;
  max-width: 90vw;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.sub-menu-item {
  cursor: pointer;
  margin: 0 10px;
}
