/* hAIlab (Coding page) theme for the ML for Kids Scratch build.
   Styles only; behaviour tweaks live in haippy-gui.js. */
@import url("/haippy/fonts.css");   /* served by hAIlab itself, nothing is asked from Google */

/* ML for Kids' help boxes are emptied at build time; never show them */
.mlforkidsHelpBanner { display: none !important; }

:root {
  --hp-cobalt: #2F46F0;
  --hp-cobalt-light: #4A63FF;
  --hp-violet: #6A3BE2;
  --hp-ink: #141A8F;
  --hp-yellow: #FFC21A;
  --hp-lilac: #C9CDF7;
  --hp-bg: #EEF0FF;
  --hp-panel-line: #D3D8FF;
  --hp-radius: 16px;
}

/* ---------- type ---------- */
[class*="menu-bar_"], [class*="react-tabs_"], [class*="sprite-info_"], [class*="target-pane_"],
[class*="sprite-selector"], [class*="stage-selector"], [class*="stage-header_"], [class*="action-menu_"],
[class*="library_"], [class*="modal_"], [class*="category-menu"], [class*="label_"], button, input {
  font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* ---------- page ---------- */
[class*="gui_page-wrapper"], [class*="gui_body-wrapper"] {
  background: linear-gradient(180deg, #E8EBFF 0%, var(--hp-bg) 40%, #F4F5FF 100%) !important;
}

/* ---------- menu bar ---------- */
[class*="menu-bar_menu-bar_"] {
  background: linear-gradient(90deg, var(--hp-cobalt) 0%, #4B3FE6 55%, var(--hp-violet) 100%) !important;
  box-shadow: 0 3px 0 var(--hp-ink);
  position: relative;
}
[class*="menu-bar_menu-bar-item"] { border-radius: 10px; font-weight: 700 !important; }
[class*="menu-bar_menu-bar-item"]:hover, [class*="menu-bar_active"] { background-color: rgba(255,255,255,.16) !important; }
[class*="menu-bar_divider"] { opacity: .25; }
[class*="menu-bar_title-field"] {
  border-radius: 10px !important; border: 1.5px solid rgba(255,255,255,.45) !important;
  background: rgba(255,255,255,.14) !important; font-weight: 700 !important;
}
img[class*="menu-bar_scratch-logo"] { display: none !important; }
/* hAIlab logo (white version for the blue bar), same as the Lab page */
.brandmark { display: block; line-height: 0; cursor: pointer; margin: 0 4px; }
.brandmark img { height: 36px; width: auto; display: block; }
.hailab-tabs { display: flex; gap: 4px; align-self: center; background: rgba(255,255,255,.14); border: 1.5px solid rgba(255,255,255,.4);
               border-radius: 12px; padding: 3px; margin: 0 10px 0 4px; }
.hailab-tabs a { color: #fff; text-decoration: none; font: 800 14px Montserrat, sans-serif; padding: 6px 14px; border-radius: 9px; opacity: .85; white-space: nowrap; }
.hailab-tabs a:hover { background: rgba(255,255,255,.16); opacity: 1; }
.hailab-tabs a.on { background: #fff; color: var(--hp-cobalt); opacity: 1; cursor: default; }
/* dropdown menus */
[class*="menu_menu_"] { border-radius: 0 0 12px 12px !important; overflow: hidden; background: var(--hp-cobalt) !important; }
[class*="menu_menu-item"]:hover { background: var(--hp-violet) !important; }

/* ---------- tabs (Code / Costumes / Sounds) ---------- */
[class*="gui_tab_"] {
  background: #DDE2FF !important; border: 1.5px solid var(--hp-panel-line) !important;
  border-radius: 14px 14px 0 0 !important; font-weight: 700 !important; color: #5A61A8 !important;
}
[class*="gui_tab_"][class*="react-tabs__tab--selected"] { background: #fff !important; color: var(--hp-cobalt) !important; border-bottom-color: #fff !important; }

/* ---------- panels: rounded, hairline, hAIppy hard shadow ---------- */
[class*="gui_blocks-wrapper"], [class*="gui_tabs_"] [class*="react-tabs__tab-panel--selected"] {
  border-radius: 0 var(--hp-radius) var(--hp-radius) var(--hp-radius) !important;
}
[class*="gui_blocks-wrapper"] {
  border: 1.5px solid var(--hp-panel-line) !important; overflow: hidden;
  box-shadow: 0 4px 0 var(--hp-lilac);
}
[class*="stage_stage_"], [class*="stage-wrapper_stage-canvas-wrapper"] { border-radius: var(--hp-radius) !important; }
[class*="stage_stage_"] { border: 1.5px solid var(--hp-panel-line) !important; box-shadow: 0 4px 0 var(--hp-lilac); overflow: hidden; }
[class*="sprite-selector_sprite-selector_"], [class*="stage-selector_stage-selector_"] {
  border: 1.5px solid var(--hp-panel-line) !important; border-radius: var(--hp-radius) !important;
  box-shadow: 0 4px 0 var(--hp-lilac); background: #fff !important;
}
[class*="sprite-info_sprite-info_"] {
  border: 1.5px solid var(--hp-panel-line) !important; border-radius: var(--hp-radius) var(--hp-radius) 0 0 !important;
  background: #fff !important;
}
[class*="sprite-selector_scroll-wrapper"] { background: #F7F8FF !important; }
[class*="stage-selector_header"], [class*="sprite-selector_header"] { background: #F2F4FF !important; }

/* ---------- block palette and workspace ---------- */
[class*="blocklyToolboxDiv"], .blocklyToolboxDiv { background: #FBFBFF !important; }
.blocklyFlyoutBackground { fill: #F6F7FF !important; fill-opacity: 1 !important; }
.blocklyMainBackground { fill: #FFFFFF !important; }
.scratchCategoryMenu { background: #FBFBFF !important; }
.scratchCategoryMenuItem.categorySelected { background: #E3E7FF !important; border-radius: 10px; }
.scratchCategoryMenuItemLabel, .blocklyToolboxCategoryLabel { font-family: "Montserrat", sans-serif !important; font-weight: 600; color: #3C4282 !important;
  font-size: 10.5px !important; line-height: 1.15 !important; white-space: normal !important; overflow-wrap: normal; hyphens: manual; text-overflow: clip !important;
  overflow: visible !important; letter-spacing: -.01em; text-align: center; }
/* the category column never scrolls sideways (long names wrap instead of being cut) */
.scratchCategoryMenu, .blocklyToolbox, .blocklyToolboxCategoryGroup { overflow-x: hidden !important; }
/* no visible scrollbar there either: browsers that always show one (Firefox, Windows, "always show scrollbars" on
   Mac) would take ~10px of this narrow column and cut the names; it still scrolls with the wheel or trackpad */
.scratchCategoryMenu, .blocklyToolbox, .blocklyToolboxCategoryGroup { scrollbar-width: none !important; }
.scratchCategoryMenu::-webkit-scrollbar, .blocklyToolbox::-webkit-scrollbar, .blocklyToolboxCategoryGroup::-webkit-scrollbar { display: none; }

/* ---------- inputs ---------- */
[class*="sprite-info_"] input, [class*="buffered-input"], input[class*="input_input-form"] {
  border-radius: 999px !important; border-color: var(--hp-panel-line) !important;
}
[class*="sprite-info_"] input:focus, input[class*="input_input-form"]:focus { border-color: var(--hp-cobalt) !important; box-shadow: 0 0 0 3px rgba(47,70,240,.18) !important; }

/* ---------- buttons ---------- */
[class*="action-menu_button"], [class*="action-menu_more-buttons"] {
  background: var(--hp-cobalt) !important; box-shadow: 0 4px 0 var(--hp-ink) !important;
}
[class*="action-menu_button"]:hover { background: var(--hp-cobalt-light) !important; box-shadow: 0 4px 0 var(--hp-ink), 0 0 0 .5rem rgba(47,70,240,.22) !important; }
[class*="action-menu_more-buttons"] { box-shadow: 0 0 0 .25rem rgba(47,70,240,.18) !important; }
[class*="extension-button_extension-button-container"] {
  background: var(--hp-cobalt) !important; border-color: var(--hp-cobalt) !important; border-radius: 0 0 0 var(--hp-radius);
}
[class*="toggle-buttons_button"] { border-color: var(--hp-panel-line) !important; }
[class*="toggle-buttons_button"][aria-pressed="true"] { background: rgba(47,70,240,.16) !important; }
[class*="stage-header_stage-button"] { border-radius: 10px !important; border-color: var(--hp-panel-line) !important; }
[class*="stage-header_stage-button-toggled-off"] { background: #E3E7FF !important; }

/* sprite tiles */
[class*="sprite-selector-item_sprite-selector-item"] { border-radius: 14px !important; border-color: var(--hp-panel-line) !important; }
[class*="sprite-selector-item_is-selected"] { border-color: var(--hp-cobalt) !important; box-shadow: 0 0 0 4px rgba(47,70,240,.22) !important; }
[class*="sprite-selector-item_sprite-info"] { background: var(--hp-cobalt) !important; border-radius: 0 0 11px 11px; }
[class*="delete-button_delete-button-visible"] { background: var(--hp-violet) !important; }

/* green flag: the one yellow moment */
[class*="green-flag_green-flag"]:hover, [class*="green-flag_is-active"] { background: rgba(255,194,26,.35) !important; border-radius: 10px; }

/* library and modal headers */
[class*="modal_header"] { background: linear-gradient(90deg, var(--hp-cobalt), var(--hp-violet)) !important; }

/* "choose a sprite" button: robot instead of the Scratch cat */
[class*="sprite-selector_add-button"] img[class*="action-menu_main-icon"],
[class*="sprite-selector_"] [class*="action-menu_main-button"] img[class*="action-menu_main-icon"] { content: url(/haippy/sprite-icon.svg); }

/* ---------- haippy-gui.js pieces ---------- */
.haippy-saved {
  margin-left: auto; margin-right: 14px; align-self: center; padding: 4px 12px; border-radius: 999px; font: 700 12px Montserrat, sans-serif;
  color: var(--hp-ink); background: #fff; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; pointer-events: none; white-space: nowrap;
}
.haippy-saved.show { opacity: .95; transform: none; }

/* menu bar layout: [menus][title] Lab · Contoh · Rekam ............ (Tersimpan) */
[class*="menu-bar_main-menu"] > [class*="menu-bar_menu-bar-item"]:empty,
[class*="menu-bar_main-menu"] > [class*="divider_divider"],
[class*="menu-bar_main-menu"] > div:has(> [data-haippy-samples]) > [class*="divider_divider"] { display: none !important; }
[class*="menu-bar_main-menu"] { flex: 1; }
[class*="menu-bar_main-menu"] > div:has(> [data-haippy-samples]) { flex: 1; margin-left: 6px; }
[data-haippy-samples], [data-haippy-record] { gap: 8px; cursor: pointer; white-space: nowrap; }
[data-haippy-samples]::before, [data-haippy-record]::before {
  content: ""; width: 20px; height: 20px; flex: none; background: center/contain no-repeat;
}
[data-haippy-samples]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linejoin='round'><rect x='3' y='3' width='7.5' height='7.5' rx='2'/><rect x='13.5' y='3' width='7.5' height='7.5' rx='2'/><rect x='3' y='13.5' width='7.5' height='7.5' rx='2'/><rect x='13.5' y='13.5' width='7.5' height='7.5' rx='2'/></svg>"); }
[data-haippy-record]::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linejoin='round'><rect x='2.5' y='6' width='13' height='12' rx='2.5'/><path d='M15.5 10.5l6-3.5v10l-6-3.5z'/></svg>"); }

.haippy-resume {
  position: fixed; z-index: 600; top: 62px; left: 50%; transform: translate(-50%, -12px); opacity: 0; transition: opacity .3s, transform .3s;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 16px;
  background: #fff; color: #1F233A; border: 2px solid var(--hp-panel-line); box-shadow: 0 6px 0 var(--hp-lilac), 0 12px 30px rgba(20,26,143,.18);
  font: 600 14px Montserrat, sans-serif;
}
.haippy-resume.show { opacity: 1; transform: translate(-50%, 0); }
.haippy-resume .ic { font-size: 22px; }
.haippy-resume .msg b { margin-left: 6px; color: var(--hp-ink); }
.haippy-resume .msg small { margin-left: 8px; color: #5F6488; font-weight: 600; }
.haippy-resume button { font: 800 14px Montserrat, sans-serif; border: 0; border-radius: 10px; cursor: pointer; padding: 8px 14px; }
.haippy-resume .go { background: var(--hp-yellow); color: var(--hp-ink); box-shadow: 0 3px 0 #D9A000; }
.haippy-resume .no { background: transparent; color: #5F6488; font-size: 20px; padding: 4px 8px; }

.haippy-modal { position: fixed; inset: 0; z-index: 700; background: rgba(20,26,143,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.haippy-modal .box {
  width: min(820px, 100%); max-height: 90vh; overflow: auto; background: #fff; border-radius: 22px; padding: 22px 24px 26px;
  box-shadow: 0 20px 50px rgba(20,26,143,.3); font-family: Montserrat, sans-serif; color: #1F233A;
}
.haippy-modal header { display: flex; align-items: center; justify-content: space-between; }
.haippy-modal h2 { margin: 0; font-family: "Bricolage Grotesque", Montserrat, sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--hp-ink); }
.haippy-modal .x { border: 0; background: var(--hp-bg); color: var(--hp-ink); width: 36px; height: 36px; border-radius: 12px; font-size: 22px; cursor: pointer; }
.haippy-modal p { margin: 6px 0 18px; color: #5F6488; font-size: 14px; font-weight: 600; }
.haippy-modal .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
/* each example: a picture of its stage, its name and its AI type */
.haippy-modal .card {
  display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 8px 8px 12px; cursor: pointer; text-align: left;
  background: #fff; border: 2px solid var(--hp-panel-line); border-radius: 16px; font-family: Montserrat, sans-serif; transition: border-color .12s;
}
.haippy-modal .card:hover, .haippy-modal .card:focus-visible { border-color: var(--hp-cobalt); outline: none; }
.haippy-modal .card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #F3F4FF; margin-bottom: 8px; display: block; }
.haippy-modal .card b { font-size: 15px; color: var(--hp-ink); padding: 0 4px; }
.haippy-modal .card small { font-size: 13px; color: #5F6488; font-weight: 600; padding: 0 4px; }

/* menu bar, right side: AI for Kids class (free mode) and powered by hAIppy */
.haippy-invite { align-self: center; margin-right: 14px; padding: 6px 12px; border-radius: 10px; white-space: nowrap; text-decoration: none;
  color: #fff; font: 700 13px Montserrat, sans-serif; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.haippy-invite::after { content: " \2197"; }
.haippy-invite:hover { background: rgba(255,255,255,.14); }
.haippy-invite.hidden { display: none; }
.haippy-powered { align-self: center; display: flex; align-items: center; gap: 7px; margin-right: 14px; padding-left: 14px;
  border-left: 1.5px solid rgba(255,255,255,.35); color: #fff; text-decoration: none; font: 700 12px Montserrat, sans-serif; white-space: nowrap; }
.haippy-powered img { height: 22px; display: block; }
/* "powered by" when there is room; small laptops show the logo only */
@media (max-width: 1340px) { .haippy-powered span { display: none; } }
[class*="menu-bar_title-field"] { min-width: 150px; }
@media (max-width: 1420px) { .haippy-invite { display: none; } }

/* project area: editing a project's template or answer key */
.haippy-editbar { margin-left: auto; margin-right: 14px; align-self: center; display: flex; align-items: center; gap: 12px; font: 700 14px Montserrat, sans-serif; color: #fff; white-space: nowrap; }
.haippy-editbar .what { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.16); border: 1.5px solid rgba(255,255,255,.4); max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.haippy-editbar .state { opacity: .9; font-weight: 600; }
.haippy-editbar .state.bad { color: #FFD3D3; opacity: 1; }
.haippy-editbar .back { color: #fff; text-decoration: none; padding: 7px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.haippy-editbar .back:hover { background: rgba(255,255,255,.14); }
.haippy-editbar .save { border: 0; cursor: pointer; background: var(--hp-yellow); color: var(--hp-ink); font: 800 14px Montserrat, sans-serif;
  padding: 8px 16px 11px; border-radius: 999px; box-shadow: inset 0 -4px 0 #E39B00, 0 3px 0 var(--hp-ink); }
.haippy-editbar .save:disabled { opacity: .6; cursor: default; }

/* undo message after deleting a sprite, costume or sound */
.haippy-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 14px;
  background: var(--hp-ink); color: #fff; padding: 10px 12px 10px 18px; border-radius: 14px; font: 700 14px Montserrat, sans-serif; }
.haippy-toast button { border: 0; border-radius: 10px; padding: 7px 14px; background: var(--hp-yellow); color: var(--hp-ink); font: 800 14px Montserrat, sans-serif; cursor: pointer; }

/* class task: hand-in button in the menu bar (yellow = the one main action) */
.haippy-handin { align-self: center; margin-left: 10px; padding: 7px 14px; border-radius: 12px; cursor: pointer; white-space: nowrap;
  background: var(--hp-yellow); color: var(--hp-ink); font: 800 13px Montserrat, sans-serif; box-shadow: 0 3px 0 #D9A000; }
.haippy-handin:hover { filter: brightness(1.05); }
.haippy-handin.view { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; cursor: default; font-weight: 700; }

/* sign-in corner (account.js) in the menu bar */
.haippy-acct { align-self: center; margin-right: 12px; }
.haippy-acct .signin { padding: 7px 15px; font-size: 13.5px; }
.haippy-acct .mebtn i { width: 30px; height: 30px; }
@media (max-width: 1100px) { .haippy-acct .mebtn span { display: none; } }
/* narrow windows: Contoh and Rekam as icons only (their names stay as tooltips) */
@media (max-width: 1150px) { [data-haippy-samples], [data-haippy-record] { font-size: 0 !important; gap: 0; } }

/* hAIppy mascots: Nesy in the add-sprite menu, and the picker */
.haippy-mascot-btn { position: relative; }
.haippy-mascot-img { width: 30px !important; height: 30px !important; object-fit: contain; }
.haippy-mascot-btn:hover::after { content: attr(data-tip); position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: #141A8F; color: #fff; font: 700 13px Montserrat, sans-serif; padding: 5px 10px; border-radius: 8px; pointer-events: none; }
.haippy-modal .grid.mascots { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.haippy-modal .grid.mascots img { aspect-ratio: 1; object-fit: contain; background: #F3F4FF; padding: 10px; box-sizing: border-box; }
/* the Nesy button shows only while the add-sprite menu is open (like Scratch's own buttons) */
[class*="sprite-selector_add-button"]:not([class*="action-menu_expanded"]) li:has(> .haippy-mascot-btn) { display: none; }

/* ---------- loading screen: hAIppy sky + Nesy instead of Scratch's blue blocks ---------- */
[class*="loader_background"] {
  background: radial-gradient(ellipse 90% 120% at 28% 0%, var(--hp-cobalt-light) 0%, var(--hp-cobalt) 45%, #3A3AE0 72%, var(--hp-violet) 100%) !important;
}
[class*="loader_block-animation"] {
  width: 150px !important; height: 150px !important; margin: 0 auto 18px !important;
  background: url("/haippy/nesy/mikir.png") center / contain no-repeat;
  animation: hp-nesy-bob 1.4s ease-in-out infinite;
}
[class*="loader_block-animation"] > * { display: none !important; }
[class*="loader_title"] {
  font-family: "Bricolage Grotesque", "Montserrat", sans-serif !important; font-weight: 800 !important;
  letter-spacing: -.01em; color: #fff !important;
}
[class*="loader_message"] { font-family: "Montserrat", sans-serif !important; font-weight: 600; color: rgba(255,255,255,.85) !important; }
@keyframes hp-nesy-bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { [class*="loader_block-animation"] { animation: none; } }
