 * {
  box-sizing: border-box
 }
 

body {
  margin: 0;
  overflow: auto;
  background-color: #e6daf4;
  background-image:
    radial-gradient(circle, rgba(86, 72, 116, 0.26) 1.1px, transparent 1.2px),
    radial-gradient(circle, rgba(86, 72, 116, 0.14) 0.9px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  background-position: 0 0, 12px 12px;
  font-family: 'Segoe UI', sans-serif
 }

 canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0
 }

.bubble {
  padding: 30px;
  border-radius: 40%;
  background: black;
  color: white;
  font-size: 16px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  z-index: 200;
  max-width: 300px;
}


.bubble:hover {
  transform: scale(1.07) rotateX(4deg) rotateY(-6deg); /* Adds slight perspective twist */
  box-shadow:
    inset -4px -4px 12px rgba(255, 255, 255, 0.15),
    inset 4px 4px 14px rgba(0, 0, 0, 0.5),
    0 12px 25px rgba(0, 0, 0, 0.75);
}

 @keyframes fadeIn {
  from {
   opacity: 0;
   transform: scale(.8)
  }

  to {
   opacity: 1;
   transform: scale(1)
  }
 }

 .status {
  width: 100%;
  background: linear-gradient(165deg, #12004e, #340066);
  color: #ff4fe5;
  font-size: 12px;
  padding: 8px;
  border-radius: 9px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(224, 130, 255, 0.55), 0 6px 14px rgba(0, 0, 0, 0.45)
 }

 .bubble.locked {
  border: 2px solid #4f0000;
  box-shadow: 0 0 15px #f24e1e, 0 0 30px rgba(242, 78, 30, .3);
  cursor: not-allowed;
 }

 .bubble.locked-highlight {
  box-shadow: 0 0 20px #0c0057, 0 0 40px rgba(255, 240, 0, .4);
  border: 2px dashed #00f7ff;
 }

 .bubble.idea    { background-color: #680596; border-left: 4px solid #ffffff; }
.bubble.task    { background-color: #9634b3; border-left: 4px solid #ffffff; }
.bubble.question{ background-color: #4f00b0; border-left: 4px solid #ffffff; }
.bubble.blocker { background-color: #860368; border-left: 4px solid #ffffff; }
.bubble.note    { background-color: #230058; border-left: 4px solid #ffffff; }
.bubble.active {
  outline: 3px solid #1e68f2;
  z-index: 900;
}

.bubble-id-label {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 6px;
  pointer-events: none;
  margin: 3px;
}
#sidebar {
  --sidebar-expanded-width: 460px;
  --sidebar-collapsed-width: 98px;
  position: fixed;
  top: 0;
  left: 0;
  width: min(var(--sidebar-expanded-width), 100vw);
  max-width: 100vw;
  height: 100vh;
  background: #000000;
  color: white;
  z-index: 20000;
  overflow: hidden;
  border-right: 2px solid rgb(255, 255, 255);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.logo {
  width: 100%;
  display: block;
  max-height: 96px;
  object-fit: contain;
  object-position: top;
}

.logo-compact {
  max-height: 56px;
}

#sidebar.collapsed {
  width: min(var(--sidebar-collapsed-width), 100vw);
}

#sidebar.collapsed .logo-full {
  display: none !important;
}

#sidebar.collapsed .logo-compact {
  display: block !important;
}

#floatingMapName {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 21000;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 14px;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebarHeader {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 8px;
  padding: 2px 8px 4px 8px;
  border-bottom: 1px solid #2b2b2b;
}

#newMapBtn,
#mapHistoryBtn,
#exportMapIconBtn,
#importMapIconBtn,
#toggleBubbleColumn {
  width: 100%;
  min-height: 38px;
  padding: 8px 0;
  text-align: center;
  font-size: 17px;
  line-height: 1;
}

#sidebarHeader button {
  justify-content: center;
}

#sidebarColumns {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px 6px 8px;
  align-items: start;
  overflow: hidden;
  align-content: start;
}

#bubbleColumn {
  min-width: 0;
  overflow-y: auto;
  max-height: calc(100vh - 250px);
}

#bubbleColumn h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  padding-left: 4px;
}

#sidebarColumns.collapsed {
  grid-template-columns: 1fr 0;
}

#sidebarColumns.collapsed #bubbleColumn {
  width: 0;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

#controlPanel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

#controlPanel button,
#controlPanel input[type="text"] {
  width: 100%;
  margin: 0;
}

#controlPanel input[type="text"] {
  padding: 6px;
  border: 1px solid #4d4d4d;
  border-radius: 6px;
  background: #141414;
  color: #fff;
}

#controlPanel button,
#audioControlsBar button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

#sidebar:not(.collapsed) #controlPanel .btn-icon {
  display: none;
}

.btn-icon {
  font-size: 19px;
  line-height: 1;
}

.btn-label {
  white-space: nowrap;
}

.bubble-type-input {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  color: #fff;
  background: #111;
}

.bubble-type-input::placeholder {
  color: rgba(255, 255, 255, 0.92);
}

.bubble-type-input:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

#saveBubbleTypes:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.bubble-type-input.type-idea { background-color: #680596; }
.bubble-type-input.type-task { background-color: #9634b3; }
.bubble-type-input.type-question { background-color: #4f00b0; }
.bubble-type-input.type-blocker { background-color: #860368; }
.bubble-type-input.type-note { background-color: #230058; }

#audioControlsBar {
  border-top: 1px solid #2b2b2b;
  padding: 8px;
}

#audioExpandedControls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#audioSingleToggle {
  width: 100%;
}

#sidebar.collapsed #sidebarHeader {
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 4px 6px;
}

#sidebar.collapsed #sidebarColumns {
  padding: 6px 6px;
}

#sidebar.collapsed #controlPanel {
  gap: 5px;
}

#sidebar.collapsed #controlPanel button,
#sidebar.collapsed #audioControlsBar button {
  justify-content: center;
  min-height: 46px;
  padding: 10px 0;
}

#sidebar.collapsed .btn-label,
#sidebar.collapsed .status-label {
  display: none;
}

#sidebar.collapsed .btn-icon {
  font-size: 23px;
}

#sidebar.collapsed #controlPanel input[type="text"] {
  display: none;
}

#sidebar.collapsed .status {
  display: flex;
  justify-content: center;
  align-items: center;
}

#sidebar.collapsed .voice-transcript {
  display: none;
}

#sidebar.collapsed .voice-hint {
  display: none;
}

#bubbleList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#bubbleList li {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #222;
  border-left: 4px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
}

#bubbleList li:hover {
  filter: brightness(1.12);
}

#bubbleList li.active {
  outline: 2px solid #f2d91e;
  outline-offset: 0;
}

#bubbleList li.type-idea { background-color: #680596; }
#bubbleList li.type-task { background-color: #9634b3; }
#bubbleList li.type-question { background-color: #4f00b0; }
#bubbleList li.type-blocker { background-color: #860368; }
#bubbleList li.type-note { background-color: #230058; }

button {
  background: linear-gradient(165deg, #e7cfff 0%, #c695f3 52%, #9f5cd9 100%);
  border: 1px solid #e4c1ff;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  color: #240a3f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -2px 0 rgba(77, 25, 132, 0.35),
    0 3px 0 #6f34ae,
    0 8px 16px rgba(14, 0, 29, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

button:hover {
  filter: brightness(1.03);
}

button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -2px 0 rgba(77, 25, 132, 0.32),
    0 1px 0 #6f34ae,
    0 4px 9px rgba(14, 0, 29, 0.38);
}

#audioControlsBar .status {
  margin-bottom: 8px;
}

.voice-transcript {
  margin-bottom: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(173, 200, 255, 0.4);
  background: rgba(25, 40, 88, 0.55);
  display: grid;
  gap: 3px;
}

.voice-transcript-label {
  font-size: 11px;
  opacity: 0.9;
}

.voice-transcript-text {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-hint {
  margin-bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(220, 222, 255, 0.35);
  background: rgba(43, 49, 101, 0.45);
  color: #d8deff;
  font-size: 11px;
}

.voice-error {
  margin-bottom: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 130, 130, 0.45);
  background: rgba(95, 18, 18, 0.72);
  color: #ffd6d6;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(7, 5, 15, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: min(420px, 100%);
  background: #0f0f13;
  color: #fff;
  border: 1px solid #3a2d4f;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5);
  padding: 14px;
}

.modal-card h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
}

.modal-subtitle {
  margin: 0 0 10px 0;
  color: #cbc4dc;
  font-size: 12px;
}

#bubbleEditorMeta {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #cbc4dc;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-actions button,
.modal-footer button {
  text-align: center;
}

#bubbleEditorInputArea label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #d7d0e6;
}

#bubbleEditorInputArea input,
#bubbleEditorInputArea select,
#mapSetupModal input,
#voiceSettingsModal input,
#voiceSettingsModal select {
  width: 100%;
  padding: 8px;
  border-radius: 7px;
  border: 1px solid #4f4861;
  background: #18131f;
  color: #fff;
  margin-bottom: 8px;
}

.voice-setting-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 12px;
}

#voiceSettingsModal label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: #d7d0e6;
}

#mapTypeInputs {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

#mapSetupModal .bubble-type-input.type-idea { background-color: #680596; }
#mapSetupModal .bubble-type-input.type-task { background-color: #9634b3; }
#mapSetupModal .bubble-type-input.type-question { background-color: #4f00b0; }
#mapSetupModal .bubble-type-input.type-blocker { background-color: #860368; }
#mapSetupModal .bubble-type-input.type-note { background-color: #230058; }

#mapHistoryList {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 8px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  background: #171324;
  border: 1px solid #3a2d4f;
  border-radius: 8px;
  padding: 8px;
}

.history-name {
  font-size: 13px;
  color: #fff;
}

.history-meta {
  font-size: 11px;
  color: #c8c0da;
}

.modal-error {
  margin: 2px 0 10px 0;
  color: #ff8484;
  font-size: 12px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
