/* ---------- PAGE LAYOUT / GEOMETRY (Page Scroll Enabled) ---------- */


/* UI overlay now in normal flow */
.ui-layer {
  position: relative;
  width: 100%;
  pointer-events: auto;
  z-index: 10;
}

/* Logo in upper left corner */
.logo-container {
  position: absolute;
  top: 10px;
  left: 3vw;
  z-index: 15;
  pointer-events: auto;
  display: flex;
  align-items: center;
  height: 80px;
}

.logo {
  height: 100%;
  max-height: 80px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Topbar — full-width bar, positioned in topbar.css */
.top-chips {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* -----------------------------
   TASKS: flow container + stack
   ----------------------------- */

.tasks-wrap {
  position: relative;
  margin: max(70px, 12vh) 3vw 0 auto;
  width: clamp(260px, 28vw, 420px);
  z-index: 10;
  pointer-events: auto;
  display: block;
}

/* Holds up to 5 task panels in flow, scrolls internally */
.tasks-stack {
  display: grid;
  gap: 20px;
  max-height: 65vh;
  overflow-y: auto;
}

/* New task button placement & click fix */
.tasks-chip-row {
  position: relative;
  z-index: 6;
  margin-top: 16px;
}

.tasks-chip-row.is-hidden {
  display: none;
}

.tasks-chip-row.is-timer-active #aiPlanBtn,
.tasks-chip-row.is-timer-active #timerChip {
  display: none;
}

#addTasksPanel {
  pointer-events: auto;
  position: relative;
  z-index: 7;
}

/* Right column with timer + controls */
.right-ui {
  position: relative;
  margin: max(70px, 14vh) 3vw 0 auto;
  width: clamp(260px, 28vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}

.focus-panel-slot {
  width: min(calc(90vw - 56px), 364px);
  margin: 16px 0 0 auto;
  box-sizing: border-box;
}

.focus-panel-slot .tasks-panel {
  margin: 0;
}

.focus-panel-slot .tasks-list {
  max-height: 52vh;
}

/* Timer card box */
.timer-card {
  width: clamp(170px, 22vw, 260px);
  aspect-ratio: 1;
  position: relative;
  padding-bottom: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Timer menu trigger */
.timer-menu-trigger.btn-primary {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  min-width: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Timer dropdown panel */
.timer-menu-panel {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  display: none;
  flex-direction: column;
  gap: 12px;
  min-width: 220px;
  pointer-events: auto;
  z-index: 5;
}

.timer-menu-panel.is-open {
  display: flex;
}

/* Store dialog/backdrop */
.backdrop {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 30;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Store panel scrolls internally */
.store-panel {
  position: relative;
  margin: 30vh auto 0 auto;
  /* top spacing & horizontal centering */
  width: min(980px, 92vw);
  max-height: 78vh;
  overflow-y: auto;
  z-index: 31;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Store two-column layout */
.store-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
}

/* Inventory column geometry */
.inventory-column {
  padding-left: 14px;
  border-left-width: 2px;
  border-left-style: solid;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {

  .right-ui {
    margin: 8vh 4vw 0 4vw;
    width: 88vw;
  }

  .tasks-wrap {
    margin: 8vh 4vw 0 4vw;
    width: 88vw;
  }

  .mode-chips {
    flex-wrap: wrap;
    justify-content: center;
  }

  .top-chips {
    flex-wrap: wrap;
    gap: 10px;
  }

  .store-panel {
    margin: 4vh auto 0 auto;
    width: 94vw;
  }

  .store-content {
    grid-template-columns: 1fr;
  }

  .inventory-column {
    border-left: none;
    padding-left: 0;
  }
}