@font-face {
  font-family: 'Wix Made For Display';
  src: url(/static/fonts/WixMadeforDisplay-ExtraBold.ttf);
  font-weight: 800; /* ExtraBold */
  font-style: normal;
}
@font-face {
  font-family: 'Wix Made For Display';
  src: url(/static/fonts/WixMadeforDisplay-Bold.ttf);
  font-weight: 700; /* Bold */
  font-style: normal;
}
@font-face {
  font-family: 'Wix Made For Display';
  src: url(/static/fonts/WixMadeforDisplay-SemiBold.ttf);
  font-weight: 600; /* SemiBold */
  font-style: normal;
}
:root{
  --dialog-width: 90%;
  --dialog-max-width: 700px;
  --dialog-padding: 28px 36px;
  --dialog-radius: 10px;
  --dialog-bg: #f9f7ef;
  --dialog-font-size: 18px;
  --dialog-font-weight: 600;

  --cd-gruen: #c7ff7a;
  --cd-duenkel-gruen: #33c270;
  --cd-orange: #ff8568;
  --cd-pink: #f28ade;
  --cd-lila: #9f88ff;
}

button, a {transition: all 500ms; -webkit-transition: all 500ms; -moz-transition: all 500ms; -o-transition: all 500ms;}
#sidebar, #editorCanvas { transition: all 250ms; --webkit-transition: all 250ms; -moz-transition: all 250ms; -o-transition: all 250ms; }
html, body{
  margin: 0;
  padding: 0;
  font-family: 'Wix Made For Display';
}
body {
    font-family: 'Wix Made For Display';
    background: #f3f3f3;
    padding: 20px;
}

#canvas-container { display: flex; position: relative; gap: 12px; }
#sidebar { width: 260px; padding: 14px; border-left: 1px solid #ececec; background: #fafafa; margin-left: 0; }
#stage-container {
  position: relative;
  border: 1px solid #ff000000;
  overflow: hidden; /* safety */
  margin: auto;
}

/* -------------------------
   Overlay 
   ------------------------- */
#overlay, #picto-overlay, #autopilot-overlay, #settings-overlay {
  position: fixed;           /* stays on screen when scrolling */
  inset: 0;                  /* top:0; left:0; right:0; bottom:0 */
  display: none;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.5);
  z-index: 9999;
  padding: 20px;      
  overflow: auto;
}

#modalbox,
#picto-select-screen,
#autopilot-screen,
#settings-screen {
  width: var(--dialog-width);
  max-width: var(--dialog-max-width);
  background: var(--dialog-bg);
  border-radius: var(--dialog-radius);
  padding: var(--dialog-padding);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  text-align: center;
  font-size: var(--dialog-font-size);
  font-weight: var(--dialog-font-weight);
  color: #222;
  box-sizing: border-box;
}

#picto-select-screen,
#autopilot-screen,
#settings-screen {
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cfcfcf transparent;
}

#autopilot-screen {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#pictoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.picto-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  cursor: pointer;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e6e6e6;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.picto-item:hover {
  transform: translateY(-4px) scale(1.03);
  border-color: var(--cd-duenkel-gruen);
  box-shadow: 0 8px 18px rgba(46,164,79,0.08);
}
.picto-item img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-bottom: 6px;
}

#autopilot-content textarea {
  width: 100%;
  max-width: 420px;
  height: 130px;
  padding: 12px 14px;
  box-sizing: border-box;
  border: 2px solid #e6e6e6;
  border-radius: 8px;
  background-color: #fff;
  resize: none;
  margin: 6px auto;
  display: block;
  font-family: inherit;
  font-size: 15px;
}
#autopilot-content input[type=text] {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  margin: 10px auto;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  display: block;
}
#settings-screen input[type=range] {
  width: 100%;
  max-width: 420px;
  margin: 20px auto;
  display: block;

  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
}
#settings-screen input[type=range]::-webkit-slider-runnable-track{
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--cd-gruen) 0%,
    var(--cd-orange) 30%,
    var(--cd-pink) 60%,
    var(--cd-lila) 100%
  );
}
#settings-screen input[type=range]::-moz-range-track{
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--cd-gruen) 0%,
    var(--cd-orange) 30%,
    var(--cd-pink) 60%,
    var(--cd-lila) 100%
  );
}
#settings-screen input[type=range]::-ms-track{
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--cd-gruen) 0%,
    var(--cd-orange) 30%,
    var(--cd-pink) 60%,
    var(--cd-lila) 100%
  );
  border-color: transparent;
  color: transparent;
}

#settings-screen input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;

  height: 20px;
  width: 20px;
  /*background: var(--cd-duenkel-gruen); */
  background: var(--thumb-bg);

  transform: translateY(-8px);

  cursor: grab;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.25);
}

#settings-screen input[type=range]::-webkit-slider-thumb:active {
  cursor: grabbing;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.35);
}
#settings-screen input[type=range]::-moz-range-thumb {
  height: 20px;
  width: 20px;

  background: var(--thumb-bg);
  
  cursor: grab;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.25);
}

#settings-screen input[type=range]::-moz-range-thumb:active {
  cursor: grabbing;
}

#settings-screen input[type=range]::-ms-thumb {
  height: 20px;
  width: 20px;

  background: var(--thumb-bg);

  cursor: grab;
}


/* -------------------------
   Responsive 
   ------------------------- */
@media (min-width: 900px) {
  #modalbox,
  #picto-select-screen,
  #autopilot-screen,
  #settings-screen {
    --dialog-width: 70%;
    --dialog-max-width: 820px;
    --dialog-padding: 36px 48px;
    --dialog-font-size: 20px;
  }
  #sidebar { width: 300px; }
}

@media (max-width: 520px) {
  #modalbox,
  #picto-select-screen,
  #autopilot-screen,
  #settings-screen {
    --dialog-padding: 18px 16px;
    font-size: 16px;
  }
  .autopilot-buttons { flex-direction: column; }
  .autopilot-buttons button { width: 100%; max-width: none; }
}

/* --- Mobile Drawer styles --- */
#mobilePropertiesDrawer { display: none; }
.mobile-sidebar {
  height: 100%;
  width: 0;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #101010;
  color: #fff;
  overflow-x: hidden;
  transition: width 280ms cubic-bezier(.2,.9,.3,1);
  padding-top: 64px;
  z-index: 1350;
  box-shadow: 4px 0 18px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
}

.mobile-sidebar .drawer-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 10;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), transparent);
}

.drawer-main { flex: 0 0 auto; }
.drawer-sub {
  flex: 1 1 auto;               
  overflow-y: auto;               
  -webkit-overflow-scrolling: touch;
  max-height: calc(100vh - 64px); 
  padding-bottom: 24px;
}
.drawer-sub .sub-item { word-break: break-word; } /* safe for long labels */
.drawer-main, .drawer-sub {
  padding: 12px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-main a.category-link {
  display: block;
  padding: 12px 16px;
  margin-bottom: 6px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  background: rgba(255,255,255,0.02);
  font-weight: 600;
}

.drawer-sub .sub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
}
.sub-item-spacer{ 
  height: calc(100vh / 17);
}

.drawer-sub .sub-item img.thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
}

.drawer-sub .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  width: fit-content;
  color: #fff;
  font-weight: 700;
}


.top-buttons {
  position: fixed;
  top: 10px;
  right: 12px;
  z-index: 1500;
  display: flex;
  gap: 8px;
  align-items: center;
}

#mobilePropertiesDrawer{
  display: none;
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 10px;
  height: 84px; /* collapsed */
  max-height: 72vh;
  background: #ffffff;
  border-radius: 12px 12px 8px 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  overflow: hidden;
  transition: height 220ms cubic-bezier(.2,.9,.3,1), transform 200ms ease;
  z-index: 3000;
  touch-action: none; 
}
#mobilePropertiesDrawer.expanded{
  height: 45vh;
}
#mobilePropertiesDrawer .drawer-handle {
  height: 6px;
  width: 42px;
  background: #d6d6d6;
  border-radius: 6px;
  margin: 8px auto;
  cursor: grab;
}

#mobilePropertiesDrawer .drawer-content {
  padding: 6px 12px 16px 12px;
  overflow-y: auto;
  height: calc(100% - 36px);
  -webkit-overflow-scrolling: touch;
}

/* Table styles for monthly overview */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  margin-top: 20px;
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

th {
  background-color: #33c270;
  color: #ffffff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
}

td {
  padding: 12px 6px;
  border-bottom: 1px solid #e1e1e1;
  width: 12px;
}
td input[type=text] { font-size: 14px; }

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: #f8f9fa;
}

.overviewTable td:nth-child(2),
.overviewTable th:nth-child(2) {
  width: auto; /* content column grows */
}

.overviewTable td:nth-child(3),
.overviewTable th:nth-child(3) {
  width: 1%;        /* shrink to content */
  white-space: nowrap;
  text-align: center;
}

.monthOverviewInput{
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #e1e1e1;
  border-radius: 6px;
  font-size: 16px;
  background-color: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.monthOverviewInput:focus {
  outline: none;
  border-color: #33c270;
  box-shadow: 0 0 0 3px rgba(51, 194, 112, 0.1);
}
.dateInput{
  width: 100px;
}

/* Overview Toggle Styles */
.overview-toggle, .overview-mobile-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  background: #f0f0f0;
  transition: all 200ms ease;
  user-select: none;
  margin-top: 8px;
}

.overview-toggle:hover, .overview-mobile-toggle:hover {
  background: #e0e0e0;
}

.toggle-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.toggle-arrow {
  display: inline-block;
  transition: transform 250ms ease;
  font-size: 12px;
  color: #666;
}

.overview-toggle.expanded .toggle-arrow, .overview-mobile-toggle.expanded .toggle-arrow {
  transform: rotate(90deg);
}

.overview-form-container {
  margin-top: 12px;
  padding: 12px;
  background: #fefefe;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  animation: slideDown 250ms ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
  }
  to {
    opacity: 1;
    max-height: 1000px;
    overflow: visible;
  }
}

@media screen and (max-width: 768px) {
  html, body{
    overflow-y: hidden;
    overflow-x: scroll;
  }
  #sidebar{ display: none; }
  .mobile-top-bar {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;

      display: flex;
      justify-content: space-between;
      align-items: center;

      padding: 10px 14px;
      background: rgba(250,250,250,0.9);
      backdrop-filter: blur(8px);

      z-index: 2000;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }

  /* Buttons NICHT mehr fixed positionieren */
  .mobile-menu-icon {
      position: relative !important;
      display: grid;
      place-items: center;
      width: 44px;
      height: 44px;
      background: rgba(0, 0, 0, 0.185);
      border-radius: 6px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.3);
      z-index: 1;
  }

  #mobileAutopilotBtn {
      position: relative !important;
      font-size: 18px;
      padding: 8px 14px;
      background: #33c270;
      border-radius: 8px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.2);
      z-index: 1;
  }

  /* Platz unter der Top-Bar schaffen */
  #canvas-container {
      margin-top: 70px;
  }

  .drawer-handle {
    width: 42px;
    height: 5px;
    background: #ccc;
    border-radius: 5px;
    margin: 0 auto 10px auto;
  }
}
@media screen and (max-width: 768px) {
  .mobile-menu-icon { display: grid; }
  .toolbar { display: none !important; } 
  .canvas-container { max-height: 70vh; }

  #mobilePropertiesDrawer { display: block; }
  #sidebar { display: none !important; }
}
@media screen and (min-width: 769px) {
  .mobile-top-bar{
    display: none !important;
  }
}