﻿:root {
  --bg: #f3f3f3;
  --card-bg: #e1e1e1;
  --accent: #007bff;
  --accent2: #0aa01f;
  --danger: #d32f2f;
  --text-main: #222;
  --text-muted: #555;
  --border: #c0c0c0;
  --list-bg: #ffffff;
  --list-item-bg: #fafafa;
  --list-item-selected: #dbeafe;
  --shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.12);
  --radius: 14px;
  --radius-large: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #ffffff, var(--bg));
}

body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

#app {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 10px;
}

/* Non-blocking floating timer window */
.running-modal {
  background: transparent;      /* no dark overlay */
  pointer-events: none;         /* let clicks fall through except on panel */
  align-items: flex-start;      /* put it near top */
  justify-content: center;
}

.running-modal .modal-content {
  pointer-events: auto;         /* panel itself is still clickable */
  margin-top: 20px;
}


.app-header {
  text-align: center;
  margin: 8px 0 12px;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-soft);
  padding: 10px 10px 14px;
}

/* Tabs */

.tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.tab {
  flex: 1;
  border-radius: 999px 999px 0 0;
  border: 1px solid var(--border);
  padding: 6px 0;
  background: #fdfdfd;
  cursor: pointer;
  font-weight: 500;
}

.tab.active {
  background: #ffffff;
  border-bottom-color: transparent;
}

/* Content */

.content {
  border-radius: 0 0 var(--radius-large) var(--radius-large);
  border: 1px solid var(--border);
  border-top: none;
  padding: 10px 10px 14px;
  background: #f4f4f4;
}

.section-title {
  text-align: center;
  margin: 4px 0 4px;
  font-size: 1.1rem;
}

.presets-title {
  color: #cc0000;
}

.selected-title {
  color: #0051c7;
  margin-top: 10px;
}

/* Listbox */

.listbox {
  background: var(--list-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 4px;
  max-height: 160px;
  overflow-y: auto;
}

.listbox.small {
  max-height: 220px;
}

.list-item {
  padding: 7px 9px;
  border-radius: 999px;
  margin: 3px 0;
  background: var(--list-item-bg);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
}

.list-item:hover {
  border-color: #b0b0b0;
}

.list-item.selected {
  background: var(--list-item-selected);
  border-color: var(--accent);
}

/* Buttons */

.row {
  display: flex;
  align-items: center;
}

.row.spaced {
  justify-content: space-between;
  gap: 8px;
}

.btn,
.icon-btn {
  border-radius: 999px;
  border: 1px solid #888;
  background: #ffffff;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  min-width: 72px;
}

.btn:hover,
.icon-btn:hover {
  background: #f1f1f1;
}

.btn.primary {
  border-color: var(--accent2);
  color: #ffffff;
  background: var(--accent2);
}

.btn.primary:hover {
  filter: brightness(0.95);
}

.btn.danger {
  border-color: var(--danger);
  color: #ffffff;
  background: var(--danger);
}

.icon-btn {
  font-size: 1.2rem;
  font-weight: 600;
  width: 46px;
}

/* Master Level */

.master {
  margin-top: 14px;
}

.master-label {
  text-align: center;
  margin-bottom: 5px;
  font-size: 1.05rem;
}

.value {
  font-weight: 700;
}

.value.accent {
  color: #c62828;
}

.timer-display {
  font-family: "Courier New", monospace;
  font-size: 2rem;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  background: #111;
  color: #e53935;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 10px;
}

/* Sliders */

input[type="range"] {
  width: 100%;
}

/* Bottom buttons */

.bottom-buttons {
  margin-top: 12px;
}

/* Modals */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #eaeaea;
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-soft);
}

.modal-content.timers {
  text-align: center;
}

.modal-title {
  margin-top: 0;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.field span {
  margin-bottom: 3px;
}

.field-group {
  border-radius: 12px;
  padding: 8px 10px;
  background: #dadada;
  margin-bottom: 10px;
}

.field-group-title {
  display: block;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}

.modal-actions {
  margin-top: 8px;
}

/* Inputs */

input[type="text"],
input[type="number"] {
  border-radius: 999px;
  border: 1px solid #999;
  padding: 6px 10px;
  font-size: 0.95rem;
}

/* Responsive tweaks */

@media (min-width: 700px) {
  .content {
    padding: 14px 18px 20px;
  }

  .listbox {
    max-height: 200px;
  }
}
