/* ===== RESET & NORMALIZATION ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/*  Root layout: always centered  */
body {
  min-height: 100vh !important;
  min-height: 100dvh;
  background-color: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pomo card */
.pomo {
  background: var(--bg-card);    
  border-radius: 24px;
  border: 1px solid var(--border);
  padding: 50px 24px 24px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: auto;
  position: relative;
}

/*  Mode tabs  */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-tabs);
  border-radius: 12px;
  padding: 4px;
  width: 100%;
}

.tab {
  flex: 1;
  padding: 7px 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab.active {
  background: var(--tab-active-bg); 
  color: var(--tab-active-c);
}

/*  Progress ring  */
.ring-wrap {
  position: relative;
  width: 210px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring-svg {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg); /* start arc from top */
}

.ring-bg {
  fill: none;
  stroke: var(--bg-track);    
  stroke-width: 7;
}

.ring-prog {
  fill: none;
  stroke: var(--accent, #FBC48F);
  stroke-width: 7;
  stroke-linecap: butt;
  transition: stroke-dashoffset 0.6s linear, stroke 0.4s;
}

/* Specific color for long break */
.theme-rose .ring-prog[data-mode="2"],
.theme-midnight .ring-prog[data-mode="2"] {
  stroke: #7D6FB3;
}

/* Dark mode default */
.theme-dark .ring-prog {
  stroke: #FBC48F;
}

.ring-prog.running {
  filter: url(#glow);
}
/* Session dots — v1 palette */
.dot {
  background: #0C0E1A;       /* deep midnight instead of #242A46 */
  border: 1.5px solid #7D6FB3;
}
.dot.done {
  background: #FBC48F;
  border-color: #FBC48F;
}


/* Glowing tip dot — shown only while running */
.ring-dot {
  fill: var(--accent, #FBC48F);
  filter: url(#glow);
  display: none;
  transition: fill 0.4s;
}

.ring-dot circle { fill: #FBC48F; }

.ring-svg.running .ring-prog {
  filter: drop-shadow(0 0 4px var(--accent, #FBC48F));
}

/*  Time display  */
.time-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 1;
}

.time {
  font-size: 62px;
  font-weight: 200;
  color: var(--text);
  letter-spacing: 3px;
  line-height: 1;
}

.mode-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/*  Session dots  */
.sessions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sessions span {
  font-size: 11px;
  color: var(--text-muted);
}

.dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--dot-empty);
  border-color: var(--text-muted);
  transition: all 0.3s;
}

.dot.done {
  background: var(--accent);
  border-color: var(--accent);
}

/*  Desktop controls  */
.controls-desktop {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

/* Small icon buttons (reset + skip) */
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid;
  border-color: var(--btn-icon-b);
  background: transparent;
  color: var(--btn-icon-b);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
}

.btn-icon:hover {
  background: var(--bg-track);
  color: var(--text);
  border-color: var(--text);
}

/* Main play / pause button */
.btn-play-main {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 0.5px solid;
  border-color: var(--btn-play-border);
  background: var(--btn-play);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  box-shadow: 0 4px 20px rgba(125, 111, 179, 0.35);
}

.btn-play-main:hover {
  background: var(--btn-play-h);
  transform: scale(1.05);
}

/* Active / paused state */
.btn-play-main.paused {
  background: var(--btn-pause); 
}

.btn-play-main.paused:hover {
  background: var(--btn-pause-h);
}

/*  Mobile / compact FAB  */
.controls-mobile {
  display: none;
}

.btn-fab {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--btn-play);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  box-shadow: 0 4px 20px rgba(125, 111, 179, 0.4);
}

.btn-fab:hover {
  background: var(--btn-play-h);
  transform: scale(1.05);
}

.btn-fab.paused {
  background: var(--btn-pause);
}

/*  Settings button — top left of card  */
.btn-settings {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--btn-icon-b);
  background: transparent;
  color: var(--btn-icon-b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  z-index: 20;
}
.btn-settings:hover { background: var(--bg-track); }
.btn-settings svg   { transition: transform 0.4s; }
.btn-settings.open svg { transform: rotate(60deg); } /* gear spin on open */

/*  Settings dropdown panel  */
.settings-panel {
  position: absolute;
  top: 56px; left: 12px;
  right: 12px;
  left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
  min-width: 190px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.settings-panel.open { display: flex; }


/* ============================================
   BREAKPOINT: Mobile (≤ 299px)

   Context: Ultra-compact displays like Galaxy Fold
   Behavior: Hide tabs, show only FAB button
   Testing: iPhone SE, Galaxy Fold, small widgets
============================================ */
@media (max-width: 299px) {
  .tabs { display: none; }
  .sessions { display: none; }
  .controls-desktop { display: none; }
  .controls-mobile { display: flex; }
  .pomo { gap: 14px; padding: 20px 16px; }
  .time { font-size: 58px; }
}

/* ============================================
   BREAKPOINT: Landscape Mode (height ≤ 480px)
   
   Context: Notion embeds in landscape orientation
   Behavior: Horizontal layout, smaller ring
   Use case: Widgets displayed in rows
============================================ */
@media (max-height: 410px) and (min-width: 500px) {
  body { padding: 8px; }

  .pomo {
    /* horizontal layout */
    flex-direction: row;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    gap: 16px;
    padding: 16px 24px;
  }

  /* Hide tabs — no vertical space */
  .tabs { display: none; }

  /* Sessions visible, below the ring */
 .sessions {
    display: flex;
    margin-top: 0;
  }

  /* Smaller ring */
  .ring-wrap { width: 130px; height: 130px; flex-shrink: 0; }
  .ring-svg  { width: 130px; height: 130px; }
  .time { font-size: 36px; letter-spacing: 1px; }
  .mode-label { font-size: 9px; }

  /* Controls stack vertically on the right */
  .controls-desktop {
    flex-direction: column;
    gap: 10px;
  }

  .btn-play-main { width: 52px; height: 52px; }
  .btn-icon { width: 38px; height: 38px; }
}

/* ============================================
   BREAKPOINT 3 — short height + narrow width
   
   Just the FAB and a smaller ring
============================================ */
@media (max-height: 410px) and (max-width: 499px) {
  .tabs             { display: none; }
  .sessions         { display: none; }
  .controls-desktop { display: none; }
  .controls-mobile  { display: flex; }
  .pomo  { gap: 10px; padding: 14px; }
  .time  { font-size: 48px; }
  .ring-wrap { width: 150px; height: 150px; }
  .ring-svg  { width: 150px; height: 150px; }
}