:root {
    --bg-color: #fff;
    --text-color: #000;
    --highlight: #1793ff;
    --border-color: #eee;
    --outline-color: #ccc;
    --button-color: #08f;
    --hover-color: rgba(240, 240, 240, .8);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --highlight: #4a90e2;
        --outline-color: #444;
        --border-color: #222;
        --hover-color: rgba(40, 40, 40, .8);
    }
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    background-color: var(--bg-color);
    color: var(--text-color);
}

canvas {
    cursor: text;
    min-width: 0;
    flex: 1;
    height: 100%;
}

.canvas-wrapper {
    cursor: text;
    min-width: 0;
    position: relative;
    flex: 1;
    height: 100%;
}

.sidebar {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: 100%;
    flex-direction: column;
    z-index: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    width: 0px;
    scrollbar-width: thin;
    scrollbar-color: #aaa transparent;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.sidebar.click {
    width: 320px;
    border-right: 1px solid var(--outline-color);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar::-webkit-scrollbar-thumb {
    background-color: #aaa;
    border-radius: 10px;
}

.modal-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.state-modal {
    display: none;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: IBM Plex Mono;
    box-shadow: 0 0 5px var(--border-color);
    font-size: 14px;
    transition: all 0.3s ease;
    user-select: none;
    margin-top: 5px;
}

.note-list {
    display: none;
    flex: 1;
    padding-top: 40px;
}

.note-element {
    height: 25px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin: 0;
    padding: 6px 6px;
    font-family: IBM Plex Mono;
    text-align: left;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    max-width: 300px;
    width: 100%;
    color: inherit;
    border: 1px solid transparent;
}

.note-element:hover {
    background-color: var(--hover-color);
    border: 1px solid var(--border-color);
}

.trigger-sidebar {
    position: fixed;
    top: 5px;
    left: 5px;
    width: 30px;
    height: 30px;
    background-color: var(--hover-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.1s ease;
    display: flex;
    z-index: 4;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.trigger-sidebar:hover {
    background-color: var(--outline-color);
}

.ball {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-color);
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    max-width: 400px;
    table-layout: fixed;
    border-color: #ccc;
}

td {
    padding: 0px 15px;
    text-align: center;
    font-family: 'IBM Plex Mono';
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    color: inherit;
}

td.bold {
    font-weight: bold;
}

.time-hours {
    font-size: 14px;
}

.time-minutes {
    font-size: 12px;
    position: relative;
    top: -6px;
    left: 5px;
}

.new-note {
    text-align: center;
}

.selected-note-row {
    color: var(--bg-color);
    background-color: var(--button-color);
}

.selected-note-row:hover {
    color: var(--bg-color);
    background-color: var(--button-color);
}

#canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* The invisible scrolling overlay */
#zoomScroller {
  position: absolute;
  top: 0;
  left: 0;
  inset: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;           /* Firefox hide scrollbar */
  overscroll-behavior: contain;
  z-index: 3;                     /* Above canvas; adjust if needed */
  background: transparent;
}

/* Hide scrollbar (WebKit) */
#zoomScroller::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Each full-height snap section */
#zoomScroller .zoom-step {
  scroll-snap-align: start;
  height: 100%;
  width: 100%;
  flex: 0 0 100%;
  position: relative;
  /* For debugging you can momentarily enable a background:
     background: rgba(0,0,0,0.05); */
  pointer-events: none; /* So clicks pass through to the scroller only */
}

/* Container uses flex to stack full pages */
#zoomScroller {
  display: flex;
  flex-direction: column;
}

@media (max-width: 500px) {
    .sidebar.click {
        width: 100%;
        border-right: none;
    }
}
