@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&family=Space+Mono:wght@400;700&display=swap");

:root {
  --bg-1: #0b1120;
  --bg-2: #0f172a;
  --bg-3: #111827;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.14);
  --border: rgba(255, 255, 255, 0.16);
  --text: #f8fafc;
  --muted: #c7d2fe;
  --accent: #2dd4bf;
  --accent-2: #ff8a5b;
  --accent-3: #ffd166;
  --shadow: 0 18px 40px rgba(2, 6, 23, 0.35);
  --nav-bg: rgba(10, 12, 20, 0.75);
  --nav-icon-filter: none;
  --tab-active-text: #0b1120;
  --time-shadow: 0 10px 20px rgba(15, 23, 42, 0.4);
}

a:focus {
  outline: revert;
  outline-offset: revert;
}

.btn.active.focus,
.btn.active:focus,
.btn.focus,
.btn:active.focus,
.btn:active:focus,
.btn:focus {
  outline: revert;
  outline-offset: revert;
}

input[type=file]:focus,
input[type=checkbox]:focus,
input[type=radio]:focus {
  outline: revert;
  outline-offset: revert;
}

body[data-theme="light"] {
  --bg-1: #f8fafc;
  --bg-2: #e2e8f0;
  --bg-3: #ffffff;
  --glass: rgba(15, 23, 42, 0.06);
  --glass-strong: rgba(15, 23, 42, 0.12);
  --border: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #475569;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-icon-filter: invert(1);
  --tab-active-text: #0b1120;
  --time-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  padding-top: 70px;
  min-height: 100dvh;
  height: 100dvh;
  font-family: "Sora", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 15% -10%, rgba(45, 212, 191, 0.18), transparent 60%),
    radial-gradient(1000px 700px at 85% 0%, rgba(255, 138, 91, 0.22), transparent 55%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 45%, var(--bg-3));
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  inset: auto;
  border-radius: 999px;
  filter: blur(0);
  opacity: 0.55;
}

body::before {
  width: 420px;
  height: 420px;
  top: 12%;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(45, 212, 191, 0.7), transparent 60%);
}

body::after {
  width: 520px;
  height: 520px;
  bottom: -160px;
  right: -180px;
  background: radial-gradient(circle at 60% 40%, rgba(255, 209, 102, 0.55), transparent 70%);
}

.pipBody::before,
.pipBody::after {
  display: none;
}

#mainContainer {
  position: relative;
  z-index: 1;
  padding: 12px 0 18px;
  height: calc(100dvh - 140px);
}

.vertical-center {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.navbar-fixed-bottom,
.navbar-fixed-top {
  z-index: 9;
}

.navbar {
  min-height: 56px;
  line-height: 56px;
  border: none;
}

.navbar-inverse {
  background: var(--nav-bg);
  border-color: transparent;
  backdrop-filter: blur(14px);
  box-shadow: 0px -5px 32px rgba(2, 6, 23, 0.5) ;
}

.flex-navbar {
  display: flex;
  padding: 0 18px;
  color: var(--text);
  font-weight: 600;
  justify-content: space-between;
  align-items: center;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.brand-container img {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  filter: var(--nav-icon-filter);
}

.brand-title,
.brand-title:hover {
  color: var(--text);
  font-weight: 700;
}

.flex-navbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.flex-navbar-right img {
  width: 18px;
  height: 18px;
  filter: var(--nav-icon-filter);
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.flex-navbar-right img:hover {
  opacity: 1;
}

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 26px auto 0px;
  max-width: 720px;
  padding: 8px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.nav-tabs > li {
  float: none;
  width: auto;
  flex: 1;
  text-align: center;
}

.nav > li > a {
  padding: 10px 14px !important;
  margin-right: 0 !important;
  color: var(--muted);
  border: none !important;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
}

.nav > li > a:hover,
.nav > li > a:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--tab-active-text);
  border: none;
  box-shadow: 0 10px 22px rgba(45, 212, 191, 0.35);
}

#timerContainer .container {
  max-width: 720px;
  width: 100%;
  padding: 0 20px;
}

#timerContainer .container + .container {
  margin-top: 16px;
}

.starter-template {
  padding: 22px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 24px;
  background: transparent;
  border: none;
  box-shadow: none;
}

#timerContainer .container:first-child .starter-template {
  padding: 30px 24px 26px;
}

.starter-template span {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  display: none;
}

.timer-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.time {
  font-family: "Space Mono", "SFMono-Regular", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-shadow: var(--time-shadow);
  line-height: 1;
}

#time,
#time_short,
#time_long {
  font-size: clamp(56px, 12vw, 160px);
  margin-top: 0;
}

.button-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.full-width {
  font-size: 18px;
  padding: 18px 22px;
  border-radius: 16px !important;
  min-width: 80px;
  min-height: 64px;
}

.btn {
  border-radius: 16px;
  border: 1px solid transparent;
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 16px 30px rgba(2, 6, 23, 0.45);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #34d399, var(--accent));
  border-color: rgba(45, 212, 191, 0.4);
  color: #042f2e;
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-3), #f97316);
  border-color: rgba(255, 209, 102, 0.5);
  color: #2a1b06;
}

.btn-danger {
  background: linear-gradient(135deg, #fb7185, var(--accent-2));
  border-color: rgba(255, 138, 91, 0.45);
  color: #3b0d12;
}

.btn img {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.35));
}

.custom-btn {
  color: #fff;
  border-color: #fff;
}

.modal-content {
  background: rgba(10, 12, 20, 0.96);
  color: var(--text);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.6);
}

.modal-header,
.modal-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

.modal-content a {
  color: var(--accent);
  font-weight: 600;
}

.modal-content a:hover {
  color: var(--accent-3);
}

.custom-modal-title {
  display: inline;
  font-weight: 700;
}

.about-notice {
  background-color: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.25);
  padding: 18px;
  border-radius: 12px;
}

.preferences-group {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pref-label {
  display: block;
  margin: 0;
  font-weight: 600;
}

.pref-subtext {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.pref-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  justify-content: flex-end;
}

.pref-switch {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 26px;
}

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

.pref-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.pref-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 12px rgba(2, 6, 23, 0.35);
  transition: transform 0.2s ease;
}

.pref-switch input:checked + .pref-slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  border-color: transparent;
}

.pref-switch input:checked + .pref-slider::before {
  transform: translateX(22px);
}

#prefVolume {
  width: 120px;
  accent-color: var(--accent);
}

#prefVolume:disabled {
  opacity: 0.5;
}

.pref-volume-value {
  font-weight: 600;
  min-width: 52px;
  text-align: right;
}

.pref-volume-value.is-muted {
  opacity: 0.6;
}

body[data-theme="light"] .modal-content {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

body[data-theme="light"] .modal-header,
body[data-theme="light"] .modal-footer {
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .modal-content a {
  color: #0f766e;
}

body[data-theme="light"] .modal-content a:hover {
  color: #14b8a6;
}

body[data-theme="light"] .about-notice {
  background-color: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.12);
}

body[data-theme="light"] .pref-slider::before {
  background: #f8fafc;
}

body[data-theme="light"] .modal-header .close {
  color: #0f172a;
  opacity: 0.6;
  text-shadow: none;
}

body[data-theme="light"] .modal-header .close:hover,
body[data-theme="light"] .modal-header .close:focus {
  opacity: 0.9;
}

.about-icon-container {
  display: inline-flex;
  gap: 10px;
  float: left;
}

.modal-footer {
  justify-content: space-between;
}

footer {
  text-align: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  background: var(--glass-strong);
  transform: translateY(-1px);
}

.theme-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.theme-icon-sun {
  display: none;
}

body[data-theme="light"] .theme-icon-sun {
  display: block;
}

body[data-theme="light"] .theme-icon-moon {
  display: none;
}

.pip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #7e7d7d;
  font-weight: bold;
}

.pip::after {
  content: "Floating Window is Activated";
}

.pipBody {
  padding-top: 0;
}

.pipBody .vertical-center {
  min-height: 100vh;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 10;
  display: none;
}

#pipContainer {
  display: none;
}

@media (max-width: 767px) {
  body {
    padding-top: 62px;
  }

  .nav-tabs {
    margin: 18px 16px 16px;
    padding: 6px;
  }

  .nav > li > a {
    padding: 8px 10px !important;
    font-size: 0.9rem;
  }

  #timerContainer .container {
    padding: 0 14px;
  }

  .starter-template {
    padding: 18px 18px;
  }

  #timerContainer .container:first-child .starter-template {
    padding: 24px 18px 20px;
  }

  .full-width {
    padding: 14px 16px;
    min-width: 64px;
    min-height: 56px;
  }

  .button-container {
    gap: 12px;
  }

  .pref-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .pref-control {
    width: 100%;
    justify-content: space-between;
  }

  #prefVolume {
    width: 100%;
  }
}

@media (max-width: 498px) {
  .brand-container {
    gap: 4px;
  }

  .flex-navbar-right {
    gap: 10px;
  }
}
