@import url("https://fonts.googleapis.com/css2?family=Biryani:wght@200;300;400;600;700;800;900&display=swap");

@font-face {
    font-family: DSEG7Classic-Bold;
    src: url(/fonts/DSEG7Classic-Bold.woff);
}
@font-face {
    font-family: DSEG7 Classic;
    src: url(/fonts/DSEG7Classic-Regular.woff);
}

body {
  margin: 0;
  font-family: "Biryani", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

#sapper {
  overflow: hidden;
}

svg {
  cursor: move;
}

.wire-connection {
  cursor: pointer !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em 0;
  font-weight: 400;
  line-height: 1.2;
}

h1 {
  font-size: 2em;
}

a {
  color: inherit;
}

code {
  font-family: menlo, inconsolata, monospace;
  font-size: calc(1em - 2px);
  color: #555;
  background-color: #f0f0f0;
  padding: 0.2em 0.4em;
  border-radius: 2px;
}

@media (min-width: 400px) {
  body {
    font-size: 16px;
  }
}

button {
  float: right;
}
button:first-of-type {
  margin-left: 20px;
}
button:active {
  transform: scale(0.9);
}

.row {
  margin-top: 10px;
}

body {
  overflow: hidden;
}

/** This prevents the popup when a block is click on from showing the scroll bar. **/
.blocklyWidgetDiv .blocklyMenu {
    overflow-y: hidden; 
}

/** ===== MODERN TOOLBOX STYLING ===== **/

/* Main toolbox container */
.blocklyToolboxDiv {
  background: linear-gradient(135deg, #f5f7fa 0%, #f0f3f8 100%);
  border-right: 1px solid #e1e8ed;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.06);
}

/* Toolbox category/label styling */
.blocklyToolboxLabel {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: #2d3748;
  padding: 12px 14px !important;
  background: transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

/* Hover effect on category */
.blocklyToolboxLabel:hover {
  background: rgba(80, 91, 218, 0.08);
  color: #505bda;
  padding-left: 16px;
}

/* Selected/active category */
.blocklyToolboxLabel.blocklyToolboxLabelActive {
  background: rgba(80, 91, 218, 0.15);
  color: #505bda;
  border-left: 3px solid #505bda;
  padding-left: 13px !important;
  font-weight: 700;
}

/* Flyout (popup menu when category is selected) */
.blocklyFlyout {
  background: #ffffff;
  border-left: 1px solid #e1e8ed;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.1);
}

/* Block items in flyout */
.blocklyFlyoutBackground {
  fill: #ffffff;
}

/* Scrollbar styling for toolbox */
.blocklyToolboxDiv::-webkit-scrollbar {
  width: 8px;
}

.blocklyToolboxDiv::-webkit-scrollbar-track {
  background: transparent;
}

.blocklyToolboxDiv::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.blocklyToolboxDiv::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Flyout scrollbar */
.blocklyFlyout::-webkit-scrollbar {
  width: 8px;
}

.blocklyFlyout::-webkit-scrollbar-track {
  background: transparent;
}

.blocklyFlyout::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.blocklyFlyout::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Separator line between categories */
.blocklyToolboxSeparator {
  background-color: #e1e8ed;
  height: 1px;
  margin: 6px 8px;
  opacity: 0.5;
}

/* Text styling inside categories */
.blocklyTreeLabel {
  font-weight: 500;
  font-size: 12px;
  color: #4a5568;
}

/* Icons styling if present */
.blocklyTreeIcon {
  margin-right: 6px;
  opacity: 0.7;
}

/* Expand/collapse arrow */
.blocklyTreeRow {
  padding-left: 8px;
}

.blocklyTreeRow .blocklyTreeArrow {
  margin-right: 4px;
}

/* Emoji/Icon styling in toolbox labels */
.blocklyToolboxLabel {
  word-spacing: 2px;
  position: relative;
}

/* Better rendering for emoji */
.blocklyToolboxLabel span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Category icon sizing */
.blocklyTreeLabel {
  word-break: break-word;
  overflow-wrap: break-word;
}

/** Responsive adjustments for smaller screens **/
@media (max-width: 768px) {
  .blocklyToolboxLabel {
    font-size: 12px;
    padding: 10px 12px !important;
  }
  
  .blocklyToolboxDiv {
    min-width: 50px;
  }
}
