/* ===== Pomodoro Timer Styles =====
   Reuses style.css (hero, content, footer). This file holds Pomodoro-specific
   pieces: card wrapper, mode tabs, time display, cycle dots, action row,
   settings modal, and fullscreen overlay. */

/* ===== Hero spacing ===== */
.hero:has(.pomo-card) {
  padding-top: 15vh;
}

/* ===== Card wrapper =====
   Dark rounded card that holds everything (tabs, time, dots, actions). */
.pomo-card {
  width: 480px;
  max-width: calc(100vw - 40px);
  min-height: 360px;
  background-color: var(--bg-secondary);
  border-radius: 14px;
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

[data-theme="red"] .pomo-card,
[data-theme="teal"] .pomo-card,
[data-theme="blue"] .pomo-card,
[data-theme="purple"] .pomo-card,
[data-theme="green"] .pomo-card,
[data-theme="slate"] .pomo-card {
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

/* ===== Mode tabs (Pomodoro / Short Break / Long Break) ===== */
.pomo-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  user-select: none;
  -webkit-user-select: none;
}

[data-theme="light"] .pomo-tabs {
  background-color: rgba(0, 0, 0, 0.06);
}

[data-theme="red"] .pomo-tabs,
[data-theme="teal"] .pomo-tabs,
[data-theme="blue"] .pomo-tabs,
[data-theme="purple"] .pomo-tabs,
[data-theme="green"] .pomo-tabs,
[data-theme="slate"] .pomo-tabs {
  background-color: rgba(255, 255, 255, 0.14);
}

.pomo-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.pomo-tab:hover {
  color: var(--text-primary);
}

.pomo-tab.active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

/* Active tab filled with mode color (dark + light themes only) */
html:not([data-theme]) .pomo-tab.active[data-mode="pomodoro"],
[data-theme="light"] .pomo-tab.active[data-mode="pomodoro"] {
  background-color: #306A96;
  color: #ffffff;
}
html:not([data-theme]) .pomo-tab.active[data-mode="short"],
[data-theme="light"] .pomo-tab.active[data-mode="short"] {
  background-color: #49794F;
  color: #ffffff;
}
html:not([data-theme]) .pomo-tab.active[data-mode="long"],
[data-theme="light"] .pomo-tab.active[data-mode="long"] {
  background-color: #6D4D89;
  color: #ffffff;
}

[data-theme="red"] .pomo-tab.active,
[data-theme="teal"] .pomo-tab.active,
[data-theme="blue"] .pomo-tab.active,
[data-theme="purple"] .pomo-tab.active,
[data-theme="green"] .pomo-tab.active,
[data-theme="slate"] .pomo-tab.active {
  background-color: #ffffff;
  color: var(--accent);
}

/* ===== Time ===== */
.pomo-time {
  font-size: 110px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -3px;
  user-select: none;
  text-align: center;
}

/* ===== Cycle dots (4 per long-break cycle) ===== */
.pomo-dots {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 10px;
}

.pomo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
  transition: background-color 0.3s, transform 0.3s;
}

[data-theme="light"] .pomo-dot {
  background-color: rgba(0, 0, 0, 0.2);
}

.pomo-dot.filled {
  background-color: var(--btn-start-from);
  transform: scale(1.15);
}

[data-theme="red"] .pomo-dot,
[data-theme="teal"] .pomo-dot,
[data-theme="blue"] .pomo-dot,
[data-theme="purple"] .pomo-dot,
[data-theme="green"] .pomo-dot,
[data-theme="slate"] .pomo-dot {
  background-color: rgba(255, 255, 255, 0.3);
}

[data-theme="red"] .pomo-dot.filled,
[data-theme="teal"] .pomo-dot.filled,
[data-theme="blue"] .pomo-dot.filled,
[data-theme="purple"] .pomo-dot.filled,
[data-theme="green"] .pomo-dot.filled,
[data-theme="slate"] .pomo-dot.filled {
  background-color: #ffffff;
}

/* ===== Action row (Start + icon group) ===== */
.pomo-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pomo-icon-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.pomo-start {
  width: 150px;
  height: 44px;
  background-color: var(--btn-start-from);
  background-image: linear-gradient(180deg, var(--btn-start-from), var(--btn-start-to));
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, filter 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.pomo-start:hover {
  filter: brightness(1.08);
}

.pomo-start:active {
  transform: scale(0.97);
}

.pomo-start.paused {
  background: var(--btn-lap-bg);
  color: var(--btn-lap-text);
}

.pomo-start.paused:hover {
  filter: brightness(1.12);
}

[data-theme="red"] .pomo-start,
[data-theme="teal"] .pomo-start,
[data-theme="blue"] .pomo-start,
[data-theme="purple"] .pomo-start,
[data-theme="green"] .pomo-start,
[data-theme="slate"] .pomo-start {
  background: #ffffff;
  color: var(--accent);
}

[data-theme="red"] .pomo-start.paused,
[data-theme="teal"] .pomo-start.paused,
[data-theme="blue"] .pomo-start.paused,
[data-theme="purple"] .pomo-start.paused,
[data-theme="green"] .pomo-start.paused,
[data-theme="slate"] .pomo-start.paused {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.pomo-icon-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background-color 0.2s;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.pomo-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .pomo-icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
}

[data-theme="red"] .pomo-icon-btn,
[data-theme="teal"] .pomo-icon-btn,
[data-theme="blue"] .pomo-icon-btn,
[data-theme="purple"] .pomo-icon-btn,
[data-theme="green"] .pomo-icon-btn,
[data-theme="slate"] .pomo-icon-btn {
  color: #ffffff;
}

[data-theme="red"] .pomo-icon-btn:hover,
[data-theme="teal"] .pomo-icon-btn:hover,
[data-theme="blue"] .pomo-icon-btn:hover,
[data-theme="purple"] .pomo-icon-btn:hover,
[data-theme="green"] .pomo-icon-btn:hover,
[data-theme="slate"] .pomo-icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.18);
}

.pomo-icon-btn svg {
  width: 22px;
  height: 22px;
}

/* ===== Settings modal ===== */
.pomo-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  padding: 20px;
}

[data-theme="light"] .pomo-modal-overlay {
  background-color: rgba(0, 0, 0, 0.4);
}

.pomo-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.pomo-modal {
  --modal-padding-x: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--content-border);
  border-radius: 16px;
  padding: 26px var(--modal-padding-x);
  max-width: 460px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(20px);
  transition: transform 0.2s;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

html:not([data-theme]) .pomo-modal {
  border-color: rgba(255, 255, 255, 0.08);
}

.pomo-modal-overlay.active .pomo-modal {
  transform: translateY(0);
}

[data-theme="red"] .pomo-modal,
[data-theme="teal"] .pomo-modal,
[data-theme="blue"] .pomo-modal,
[data-theme="purple"] .pomo-modal,
[data-theme="green"] .pomo-modal,
[data-theme="slate"] .pomo-modal {
  background: var(--accent);
  border-color: rgba(255, 255, 255, 0.2);
}

.pomo-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  opacity: 0.65;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: calc(-1 * var(--modal-padding-x));
  margin-right: calc(-1 * var(--modal-padding-x));
  padding: 0 var(--modal-padding-x) 16px;
  border-bottom: 1px solid var(--content-border);
}

html:not([data-theme]) .pomo-modal-title {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="red"] .pomo-modal-title,
[data-theme="teal"] .pomo-modal-title,
[data-theme="blue"] .pomo-modal-title,
[data-theme="purple"] .pomo-modal-title,
[data-theme="green"] .pomo-modal-title,
[data-theme="slate"] .pomo-modal-title {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

/* 3-column grid for time durations */
/* Setting row: label left, control right */
.pomo-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.pomo-setting-row > label:first-child {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

[data-theme="red"] .pomo-setting-row > label:first-child,
[data-theme="teal"] .pomo-setting-row > label:first-child,
[data-theme="blue"] .pomo-setting-row > label:first-child,
[data-theme="purple"] .pomo-setting-row > label:first-child,
[data-theme="green"] .pomo-setting-row > label:first-child,
[data-theme="slate"] .pomo-setting-row > label:first-child {
  color: #ffffff;
}

.pomo-setting-row input[type="number"] {
  width: 90px;
  height: 38px;
  padding: 0 12px;
  background-color: #1e1e1e;
  border: 0.5px solid #555;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.pomo-setting-row input[type="number"]::-webkit-outer-spin-button,
.pomo-setting-row input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

[data-theme="light"] .pomo-setting-row input[type="number"] {
  background-color: #ebebeb;
  border-color: #ccc;
}

[data-theme="red"] .pomo-setting-row input[type="number"],
[data-theme="teal"] .pomo-setting-row input[type="number"],
[data-theme="blue"] .pomo-setting-row input[type="number"],
[data-theme="purple"] .pomo-setting-row input[type="number"],
[data-theme="green"] .pomo-setting-row input[type="number"],
[data-theme="slate"] .pomo-setting-row input[type="number"] {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Sound picker */
.pomo-sound-wrap {
  position: relative;
  width: 160px;
  flex-shrink: 0;
}

.pomo-sound-btn {
  width: 100%;
  height: 38px;
  background-color: #1e1e1e;
  border: 0.5px solid #555;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 0 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  position: relative;
}

[data-theme="light"] .pomo-sound-btn {
  background-color: #ebebeb;
  border-color: #ccc;
}

[data-theme="red"] .pomo-sound-btn,
[data-theme="teal"] .pomo-sound-btn,
[data-theme="blue"] .pomo-sound-btn,
[data-theme="purple"] .pomo-sound-btn,
[data-theme="green"] .pomo-sound-btn,
[data-theme="slate"] .pomo-sound-btn {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.pomo-sound-btn svg {
  position: absolute;
  right: 12px;
  width: 12px;
  height: 7px;
  color: var(--text-secondary);
}

[data-theme="red"] .pomo-sound-btn svg,
[data-theme="teal"] .pomo-sound-btn svg,
[data-theme="blue"] .pomo-sound-btn svg,
[data-theme="purple"] .pomo-sound-btn svg,
[data-theme="green"] .pomo-sound-btn svg,
[data-theme="slate"] .pomo-sound-btn svg {
  color: rgba(255, 255, 255, 0.8);
}

.pomo-sound-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background-color: #2a2a2a;
  border-radius: 8px;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .pomo-sound-dropdown {
  background-color: #f0f0f0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="red"] .pomo-sound-dropdown,
[data-theme="teal"] .pomo-sound-dropdown,
[data-theme="blue"] .pomo-sound-dropdown,
[data-theme="purple"] .pomo-sound-dropdown,
[data-theme="green"] .pomo-sound-dropdown,
[data-theme="slate"] .pomo-sound-dropdown {
  background-color: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pomo-sound-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pomo-sound-option {
  display: block;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.pomo-sound-option:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .pomo-sound-option:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

[data-theme="red"] .pomo-sound-option,
[data-theme="teal"] .pomo-sound-option,
[data-theme="blue"] .pomo-sound-option,
[data-theme="purple"] .pomo-sound-option,
[data-theme="green"] .pomo-sound-option,
[data-theme="slate"] .pomo-sound-option {
  color: #ffffff;
}

[data-theme="red"] .pomo-sound-option:hover,
[data-theme="teal"] .pomo-sound-option:hover,
[data-theme="blue"] .pomo-sound-option:hover,
[data-theme="purple"] .pomo-sound-option:hover,
[data-theme="green"] .pomo-sound-option:hover,
[data-theme="slate"] .pomo-sound-option:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.pomo-sound-option.selected {
  color: var(--btn-start-from);
  font-weight: 500;
}

[data-theme="red"] .pomo-sound-option.selected,
[data-theme="teal"] .pomo-sound-option.selected,
[data-theme="blue"] .pomo-sound-option.selected,
[data-theme="purple"] .pomo-sound-option.selected,
[data-theme="green"] .pomo-sound-option.selected,
[data-theme="slate"] .pomo-sound-option.selected {
  color: #ffe58f;
}

/* ===== Toggle switch (auto long break) ===== */
.pomo-switch {
  position: relative;
  width: 40px;
  height: 22px;
  display: inline-block;
  flex-shrink: 0;
}

.pomo-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.pomo-switch-slider {
  position: absolute;
  inset: 0;
  background-color: #555;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.pomo-switch-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="light"] .pomo-switch-slider {
  background-color: #c0c0c0;
}

.pomo-switch input:checked + .pomo-switch-slider {
  background-color: var(--btn-start-from);
}

.pomo-switch input:checked + .pomo-switch-slider::after {
  transform: translateX(18px);
}

/* Modal actions */
.pomo-modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-left: calc(-1 * var(--modal-padding-x));
  margin-right: calc(-1 * var(--modal-padding-x));
  padding: 16px var(--modal-padding-x) 0;
  border-top: 1px solid var(--content-border);
}

html:not([data-theme]) .pomo-modal-actions {
  border-top-color: rgba(255, 255, 255, 0.08);
}

[data-theme="red"] .pomo-modal-actions,
[data-theme="teal"] .pomo-modal-actions,
[data-theme="blue"] .pomo-modal-actions,
[data-theme="purple"] .pomo-modal-actions,
[data-theme="green"] .pomo-modal-actions,
[data-theme="slate"] .pomo-modal-actions {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.pomo-modal-actions .btn {
  width: 140px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ===== Fullscreen overlay ===== */
.pomo-fullscreen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-primary);
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 44px;
  padding: 40px 20px;
}

.pomo-fullscreen.active {
  display: flex;
}

.pomo-fs-time {
  font-size: clamp(120px, 22vw, 260px);
  font-weight: 400;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
  line-height: 1;
  user-select: none;
  text-align: center;
}

.pomo-fs-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.pomo-fs-start {
  width: 240px;
  height: 64px;
  background-color: var(--btn-start-from);
  background-image: linear-gradient(180deg, var(--btn-start-from), var(--btn-start-to));
  color: #ffffff;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.pomo-fs-start:hover {
  filter: brightness(1.08);
}

.pomo-fs-start:active {
  transform: scale(0.97);
}

.pomo-fs-start.paused {
  background: #525252;
}

[data-theme="red"] .pomo-fs-start,
[data-theme="teal"] .pomo-fs-start,
[data-theme="blue"] .pomo-fs-start,
[data-theme="purple"] .pomo-fs-start,
[data-theme="green"] .pomo-fs-start,
[data-theme="slate"] .pomo-fs-start {
  background: #ffffff;
  color: var(--accent);
}

[data-theme="red"] .pomo-fs-start.paused,
[data-theme="teal"] .pomo-fs-start.paused,
[data-theme="blue"] .pomo-fs-start.paused,
[data-theme="purple"] .pomo-fs-start.paused,
[data-theme="green"] .pomo-fs-start.paused,
[data-theme="slate"] .pomo-fs-start.paused {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.pomo-fs-start.paused:hover {
  filter: brightness(1.15);
}

.pomo-fs-exit {
  width: 54px;
  height: 54px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.pomo-fs-exit:hover {
  background-color: rgba(255, 255, 255, 0.16);
}

[data-theme="light"] .pomo-fs-exit {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .pomo-fs-exit:hover {
  background-color: rgba(0, 0, 0, 0.12);
}

.pomo-fs-exit svg {
  width: 30px;
  height: 30px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero:has(.pomo-card) {
    padding-top: 18vh;
  }

  .pomo-card {
    min-height: 320px;
    padding: 22px 18px;
    gap: 14px;
  }

  .pomo-tabs {
    gap: 2px;
    padding: 3px;
  }

  .pomo-tab {
    font-size: 12px;
    padding: 7px 12px;
  }

  .pomo-time {
    font-size: 84px;
    letter-spacing: -2px;
  }

  .pomo-start {
    width: 140px;
    height: 44px;
    font-size: 18px;
  }

  .pomo-icon-btn {
    width: 36px;
    height: 36px;
  }

  .pomo-icon-btn svg {
    width: 20px;
    height: 20px;
  }

  .pomo-modal {
    --modal-padding-x: 18px;
    padding: 22px var(--modal-padding-x);
    gap: 10px;
  }

  .pomo-modal-actions .btn {
    width: 120px;
    height: 36px;
  }

  .pomo-fs-time {
    font-size: clamp(84px, 26vw, 180px);
    letter-spacing: -2px;
  }

  .pomo-fs-start {
    width: 200px;
    height: 56px;
    font-size: 20px;
  }

  .pomo-fs-exit {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 380px) {
  .pomo-tab {
    font-size: 11px;
    padding: 6px 10px;
  }
}
