
/* ===== Layout ===== */
.page-container {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.note {
  display: inline-block;
  padding: 6px 12px;
  margin-top: 8px;

  background: rgba(252, 186, 3, 0.15); /* soft highlight */
  color: #FCBA03;

  border: 1px dashed #FCBA03;
  border-radius: 6px;

  font-size: 14px;
  font-family: system-ui, sans-serif;
}

/* Row 1 */
.toolbar-row {
  width: 100%;
  margin-bottom: 10px;
  background: #000000;
}

/* Row 2 */
.main-grid {
  display: grid;
  grid-template-columns: 60% 40%;
  background: #000000;
}

textarea {
  width: 100%;
  min-height: 120px;
}

#status {
  display: inline-block;
  min-height: 120px;
  padding: 8px;
  margin-top: 10px;
  background: #000000;
  color: #00FF00;
  border: 1px dashed #FCBA03;
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Toolbar container */
#symbolToolbar {
  display: flex;           /* row layout */
  flex-wrap: wrap;         /* wrap to next line if too many buttons */
  gap: 6px;                /* space between buttons */
  padding: 8px;
  border-bottom: 2px solid #FCBA03;
}

/* Toolbar buttons */
.symbol-toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;                /* icon + title spacing */
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;      /* prevent text from breaking */
  flex-shrink: 0;           /* prevent buttons from shrinking */
}
/* ================== Modal ================== */
.symbol-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;
}

.symbol-modal-close {
    position: absolute;       /* position relative to modal content */
    top: 8px;                 /* small margin from top */
    right: 12px;              /* small margin from right */
    font-size: 20px;          /* larger for visibility */
    font-weight: bold;
    cursor: pointer;
    color: #333;
    z-index: 10;              /* ensure it's above content */
}

.symbol-modal-content {
  background: white;
  padding: 12px;           /* slightly larger padding */
  border-radius: 6px;
  max-width: 700px;         /* increased width */
  width: 90%;               /* responsive width */
  max-height: 70vh;         /* reasonable height */
  overflow-y: auto;         /* scroll if content exceeds height */
}

/* ================== Symbol Grid ================== */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 columns */
  gap: 6px;                             /* slightly larger gap */
}

.symbol-item {
  border: 1px solid #ccc;
  padding: 6px;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  background: #fefefe;
  transition: 0.2s;
}

.symbol-item:hover {
  background: #fcf3d6;
}

/* LaTeX above symbol */
.symbol-latex {
  display: block;
  font-weight: bold;
  font-size: 13px;
}

.symbol-char {
  display: block;
  font-size: 18px;
  margin-top: 2px;
}
/**** Modal End ****/

.align-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.align-controls button {
  padding: 6px 14px;
  font-size: 14px;
  background-color: #ff7b00;
  color: #FEFEFE;
  border: 1px solid #FCBA03;
  border-radius: 6px;
  cursor: pointer;
}

.align-controls button:hover {
  background-color: #FCBA03;
  color: #000;
}



#menuBtn {
  position: fixed;
  top: 15px;
  right: 20px;
  font-size: 26px;
  cursor: pointer;
  z-index: 1000;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.modal-content {
  background: #fff;
  width: 60%;
  margin: 8% auto;
  padding: 20px;
  border-radius: 8px;
  max-height: 70vh;
  overflow-y: auto;
}

.close {
  float: right;
  cursor: pointer;
  font-size: 22px;
}

#Symbols li {
  cursor: pointer;
  padding: 6px;
}

#Symbols li:hover {
  background: #f0f0f0;
}
/*****************************************/
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 10px;
  font-size: 14px;
}

.symbol-group {
  grid-column: 1 / -1;
  font-weight: bold;
  margin-top: 8px;
  border-bottom: 1px solid #ddd;
}

.symbol-item {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.symbol-item:hover {
  background: #f2f2f2;
}

.symbol-latex {
  color: #555;
  font-family: monospace;
}

.symbol-char {
  font-size: 18px;
  margin-left: 4px;
}
/*****************************************/

#urlInput {
  width: 90%;
  padding: 10px;
  font-size: 16px;
  border: 2px solid #FCBA03;
  border-radius: 6px;
  margin-top: 10px;
  background-color: #222;
  color: #fff;
}

#urlInput:focus {
  outline: none;
  box-shadow: 0 0 8px rgba(252,186,3,0.2);
}

button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  margin-top: 10px;
}

button:hover {
  background-color: #0056b3;
}

canvas {
  border: 2px solid #FCBA03;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  margin: 20px auto;
  cursor: zoom-in;
}

/* Modal overlay */
#qrModal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

#qrModal img {
  width: 340px;
  height: 340px;
  background: #fff;
  border: 3px solid #FCBA03;
  border-radius: 12px;
  padding: 20px;
}

/* Terminal-style URL */
#modalUrl {
  color: #00FF66;
  background-color: #000;
  margin-top: 25px;
  text-align: center;
  word-break: break-all;
  font-family: "Courier New", monospace;
  font-size: 20px;
  font-weight: bold;
  padding: 15px 25px;
  border-radius: 8px;
  border: 2px solid #00FF66;
  max-width: 85%;
}

/* Fullwidth container */
.keep-container.fullwidth {
  max-width: 100%;
  width: 100%;
  border-radius: 0;
  margin: 0;
  border-left: none;
  border-right: none;
}

.keep-container.fullwidth .course-note {
  align-items: center;
  justify-content: center;
  text-align: center;
}

#urlInput, button, canvas, #status {
  margin-left: auto;
  margin-right: auto;
  display: block;
}

/* Modal fade animation only */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@media (max-width: 768px) {
  #qrModal img {
    width: 260px;
    height: 260px;
  }
  #modalUrl {
    font-size: 16px;
    padding: 10px 20px;
  }
}
