body {
    margin: 0;
    font-family: Arial, sans-serif;
  }
  
  .menu-container {
    position: fixed;
    top: 50%;
    right: 0;
    height: 400px; /* Set height to 60% of the viewport */
    width: 250px;
    background-color: #f4f4f4;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    transform: translateX(100%) translateY(-50%); /* Translate to center vertically and move off-screen */
    transition: transform 0.3s ease;
    border-radius: 10px 0 0 10px; /* Rounded corners for a polished look */
    font-family: Rubik;
    font-size: 1vw;
    font-style: normal;
    font-weight: 400;
    z-index: 102;
}
  
  .menu-container.open {
    transform: translateX(0) translateY(-50%); /* Slide in and remain vertically centered */
  }
  
  .menu-toggle {
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);

    font-size: 16px;
    position: absolute;
    top: 50%;
    right: 100%;
    width: fit-content;
    padding: 0 10px;
    height: 40px;
    background-color: #f4f4f4;
    color: #293144;
    font-weight: 600;
    display: flex;
    justify-content: center;
    border-top-left-radius: 10%;
    border-bottom-left-radius: 10%;
    align-items: center;
    cursor: pointer;
    transform: translateY(-50%);
    user-select: none;
  }
  
  .menu-content {
    height: calc(100% - 40px);
    overflow-y: auto;
    padding: 20px;
    background-color: #f4f4f4;
    user-select: none;
  
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  
  .menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .menu-button {
    padding: 10px;
    font-size: 16px;
    width:100px;
    height: 60px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 5px;
    background-color: #212F52;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}
  
  .menu-button:hover {
    background-color: #454c5c;
    scale: 0.94;
  }
  
  .menu-button.active {
    background-color: #454c5c; /* Darker color for active state */
    color: #ffffff; /* Ensure text remains visible */
  }
  

  .timer {
    position: absolute;
    background-color: #212F52;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    height: 10px;
    width: 58px;
    cursor: move;
    display: inline-flex; /* Inline layout for colon and fields */
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    user-select: none;
    z-index: 1;
  }
  .timer:hover{
    cursor: grab;
  }
  
  .timer input {
    position: relative;
    left: -0px;
    margin: 0 1px;
    color: white;
    font-family: Rubik;
    font-size: 20px;
    font-weight: 800;
    width: 28px;
    border: none;
    text-align: center;
    outline: none;
    background: transparent;
    user-select: none;
  }
  
  .timer span {
    color: white;
    position: relative;
    top: -2px;
    left: 0px;
    margin: 0 -2px;
    font-family: Rubik;
    font-size: 25px;
    font-weight: 800;
  }
  
  .bubble {
    position: absolute;
    padding: 5px;
    margin-bottom: 1px;
    border-radius: 8px;
    background-color: #fff;
    cursor: move;
    resize: none;
    display: flex;
    max-width: 200;
    overflow: hidden;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 1;
    width: 100px;
  }
  .bubble:hover{
    cursor: grab;
  }
  .bubble textarea {
    margin: 3% auto;
    margin-top: 1%;
    margin-bottom: 1%;
    width: 90%;
    height: 95%;
    border: none;
    color: #212F52;
    background: none;
    outline: none;
    resize: none; /* Prevent manual resizing */
    font-family: Rubik;
    font-size: 15px;
    font-weight: 500;
    overflow: hidden;
    box-sizing: border-box;
  }
  body {
    user-select: none; /* Disable text selection globally */
  }
  
  .context-menu {
    position: absolute;
    background-color: white;
    filter: drop-shadow(0px 8px 4px rgba(0, 0, 0, 0.12));
    border-radius: 5px;
    padding: 10px 10px;
    display: none;
    z-index: 1000;
    user-select: none;
  }
  
  .context-menu button {
    font-family: Rubik;
    font-size: 14px;
    font-weight: 700;
    background: #212F52;
    color: white;
    border: none;
    height: 30px;
    border-radius: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.14);

  }
  
  .context-menu button:hover {
    background-color: #3c4149;
  }

  .custom-bubble {
    position: absolute;
    width: 150px;
    height: 150px;
    background-color: #cfe5e962;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    font-size: 18px;
    line-height: 150px;
    user-select: none;
    top: 50%;
    left: 50%;
    transform-origin: center;
      z-index: 1;
  }

  .custom-bubble:hover{
      cursor: grab;
  }
  
  .arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #088fce67;
    transform-origin: center;
    border-radius: 3px;
  }
  
  .arrow-top {
    top: 20%;
  }
  
  .arrow-right {
    top: 60%;
  }
  
  .arrow-bottom {
    bottom: 20%;
    left: 22%;
  }
  
  .arrow-left {
    bottom: 20%;
    right: 22%;
  }
  
  .arrow-top-right {
    top: 28%;
    left: 24%;
  }
  
  .arrow-top-left {
    top: 28%;
    right: 24%;
  }

  
  .context-menu2 button:hover {
    background-color: #3c4149;
  }
  .context-menu2 {
    position: absolute;
    background-color: white;
    filter: drop-shadow(0px 8px 4px rgba(0, 0, 0, 0.12));
    border-radius: 5px;
    padding: 10px 10px;
    display: none;
    z-index: 1000;
    user-select: none;
    font-family: Rubik;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
  }


  .context-menu2 label {
    display: block;
    margin-top: 5px;
  }
  
  .context-menu2 input[type="range"] {
    width: 100%;
  }
  
  .context-menu2 button {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 5px;
    font-family: Rubik;
    font-size: 14px;
    font-weight: 700;
    background: #212F52;
    border-radius: 5px;
    padding: 5px 10px;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.14);

  }
  .image-box {
    position: absolute;
    width: 300px;
    height: 200px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    overflow: hidden;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    z-index: 1;
  }
  .image-box:hover {
    cursor: grab;
  }
  .image-input {
    position: absolute;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    border: none;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    font-family: Rubik;
    font-size: 10px;
    font-weight: 500;
    color: #29314473;
    z-index: 5; /* must be higher than .image-box */


  }
  
  .image-content {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
  .video-box {
    width: 300px;
    height: 205px;
    background: white;
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;
  }
  
  .video-box:hover {
    cursor: grab;
  }
  
  .video-frame {
    width: 100%;
    height: 100%;

    border: none;
    border-radius: 8px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);
    flex-shrink: 1;
  }
  
  .video-input {
    border-radius: 6px;
    border: 1px solid #293144;
    color: #293144;
    width: 100%;
    padding: 5px;
    font-family: Rubik;
    font-size: 10px;
    font-weight: 500;
    margin-top: 5px;
    box-sizing: border-box;
  }
  
  html, body {
    overflow: hidden;
    position: fixed;
  }

  .resize-handle {
  width: 15px;
  height: 15px;
  border-radius: 2px;
  position: absolute;
  background: #c7c7c73d;
  z-index: 10;
  touch-action: none; /* Allow touch resizing */
}

.resize-handle.top-left     { top: -5px; left: -5px; cursor: nwse-resize; }
.resize-handle.top-right    { top: -5px; right: -5px; cursor: nesw-resize; }
.resize-handle.bottom-left  { bottom: -5px; left: -5px; cursor: nesw-resize; }
.resize-handle.bottom-right { bottom: -5px; right: -5px; cursor: nwse-resize; }

.boatTypeSelector-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #888;
  padding: 16px;
  z-index: 5000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.boatTypeSelector-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.boatTypeSelector-option {
  padding: 10px 16px;
  background-color: #eee;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  font-weight: bold;
}

.boatTypeSelector-option:hover {
  background-color: #ddd;
}
.quiz-box {
  position: absolute;
  padding: 10px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  width: 240px;
  z-index: 2;
  font-family: Rubik;
  overflow: hidden;
}

.quiz-label,
.answer-label {
  font-weight: bold;
}

.quiz-question,
.quiz-answer{
  width: 100%;
  height: auto;
  overflow: hidden; /* Hide overflow text */
  white-space: pre-wrap; /* Preserve whitespace and allow line breaks */
  word-wrap: break-word; /* Break long words to fit */
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px;
  box-sizing: border-box;
  resize: none;
  font-family: Rubik;
  margin-top: 10px;
}

.quiz-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 10px;
}

.btn-name {
  flex: 1;
  margin: 0 2px;
  padding: 5px;
  font-size: 14px;
  background-color: #212F52;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  resize: none;
  height: 16px;
  font-family: Rubik;
  text-align: center;
}
.btn-name:hover{
  background-color: #454c5c;
  scale: 0.94;
}
.btn-name::placeholder {
  color: rgb(204, 201, 201);
  font-style: italic;

}
.btn-name:focus {
  outline: none; /* Removes the outline on focus */
  border: none;  /* Removes any border if applied */
}


.quiz-edit-toggle {
  background: #eee;
  border: none;
  font-size: 11px;
  padding: 5px;
  border-radius: 4px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: Rubik;
  font-weight: 500;
  position:absolute;
  right: 20px;
}

.quiz-toggle-answer{
  background: #eee;
  border: none;
  font-size: 9px;
  padding: 5px;
  border-radius: 3px;
  cursor: pointer;
  font-family: Rubik;
  font-weight: 500;
  position: relative;
  transform: translateX(-50%);

  left: 50%;
}

/* Rule bubble in chat */
.rule-bubble {
  background: white;
  border: 2px solid #212F52;
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  max-width: 85%;
  position: relative;
}

.rule-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #212F52;
}

.rule-bubble-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.rule-bubble-number {
  font-weight: 700;
  font-size: 14px;
  color: #212F52;
  background: #e8eef5;
  padding: 4px 8px;
  border-radius: 4px;
}

.rule-bubble-title {
  font-weight: 600;
  font-size: 13px;
  color: #293144;
  flex: 1;
}

.rule-insert-btn {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.rule-insert-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  transform: scale(1.05);
}

.rule-insert-btn:active {
  transform: scale(0.95);
}

.rule-bubble-content {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
}

/* Rule box on whiteboard */
.rule-box {
  position: absolute;
  padding: 10px;
  border-radius: 8px;
  background: white;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  width: 280px;
  z-index: 2;
  font-family: Rubik;
  overflow: visible;
}

.rule-box:hover {
  cursor: grab;
}

.rule-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #212F52;
}

.rule-number {
  font-weight: 700;
  font-size: 14px;
  color: white;
  background: #212F52;
  padding: 4px 8px;
  border-radius: 4px;
  width: fit-content;
}

.rule-title {
  font-weight: 600;
  font-size: 14px;
  color: #212F52;
  line-height: 1.3;
}

.rule-content {
  font-size: 13px;
  color: #293144;
  line-height: 1.5;
  padding: 4px 0;
  max-height: 250px;
  overflow-y: auto;
  font-weight: 500;
}
