@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Share+Tech+Mono&display=swap');

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

:root {
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-900: #1E3A8A;
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-400: #94A3B8;
  --gray-600: #475569;
  --gray-800: #1E293B;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: rgba(37,99,235,0.1);
  --border-strong: rgba(37,99,235,0.2);
  --shadow-sm: 0 1px 3px rgba(37,99,235,0.08), 0 1px 2px rgba(37,99,235,0.04);
  --shadow-md: 0 4px 20px rgba(37,99,235,0.12);
  --shadow-lg: 0 10px 40px rgba(37,99,235,0.15);
  --radius: 16px;
  --radius-sm: 10px;
}

body {
  font-family: 'Outfit', sans-serif;
  background: var(--white);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ---- NAV ---- */
nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  backdrop-filter: blur(8px);
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--blue-600);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 30px; height: 30px;
  background: var(--blue-600);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 15px;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.15s;
}

.nav-links a:hover { background: var(--blue-50); color: var(--blue-600); }
.nav-links a.active { background: var(--blue-600); color: white; }

/* ---- MAIN LAYOUT ---- */
.page { max-width: 760px; margin: 0 auto; padding: 3rem 2rem 4rem; }

/* ---- CLOCK DISPLAY ---- */
.clock-wrap {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-700) 100%);
  border-radius: 24px;
  padding: 3rem 2rem 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.clock-wrap::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.clock-wrap::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -20px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.clock-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1rem;
}

.clock-display {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(3.5rem, 12vw, 6rem);
  color: white;
  letter-spacing: 0.02em;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.clock-date {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-top: 0.75rem;
  font-weight: 400;
}

/* ---- BUTTONS ---- */
.btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 1.75rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.btn {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: white;
  color: var(--blue-600);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }

.btn-secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.25);
}

.btn-secondary:hover { background: rgba(255,255,255,0.25); }

.btn-danger {
  background: #EF4444;
  color: white;
}

.btn-danger:hover { background: #DC2626; }

/* ---- CARD ---- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue-500);
  margin-bottom: 1rem;
}

/* ---- PRESETS ---- */
.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-link {
  display: inline-block;
  padding: 6px 14px;
  background: var(--blue-50);
  color: var(--blue-600);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--blue-100);
  transition: all 0.15s;
}

.preset-link:hover {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
  transform: translateY(-1px);
}

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(15,23,42,0.2);
  animation: popIn 0.2s ease;
  overflow: hidden;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  color: white;
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}

.modal-close:hover { background: rgba(255,255,255,0.35); }

.modal-body { padding: 1.5rem; }

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ---- FORM ---- */
.field { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type=number], input[type=text], select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--gray-50);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

input:focus, select:focus { border-color: var(--blue-400); background: white; }

.input-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.input-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-btn-primary { background: var(--blue-600); color: white; }
.modal-btn-primary:hover { background: var(--blue-700); }
.modal-btn-cancel { background: var(--gray-100); color: var(--text-muted); }
.modal-btn-cancel:hover { background: var(--gray-200); }

/* ---- INFO SECTION ---- */
.info h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

/* ---- LAP TABLE ---- */
.lap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.lap-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-500);
  border-bottom: 1px solid var(--border);
}

.lap-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
}

.lap-table tr:last-child td { border-bottom: none; }
.lap-table tr:hover td { background: var(--blue-50); }

/* ---- WORLD CLOCK ---- */
.tz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tz-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.15s;
}

.tz-item:hover { background: var(--blue-50); border-color: var(--blue-200); }

.tz-city {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.tz-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--blue-600);
  font-weight: 500;
}

/* ---- FOOTER ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

footer a { color: var(--blue-500); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .page { padding: 1.5rem 1rem 3rem; }
  .clock-display { font-size: 3.2rem; }
  .input-row { grid-template-columns: 1fr; }
  .tz-grid { grid-template-columns: 1fr; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
}

/* ---- POMODORO ---- */
.pomo-modes {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.pomo-mode-btn {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: all 0.15s;
}

.pomo-mode-btn.active, .pomo-mode-btn:hover {
  background: rgba(255,255,255,0.95);
  color: var(--blue-700);
  border-color: transparent;
}

.pomo-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  margin: 1.25rem 0 0;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.pomo-progress-bar {
  height: 100%;
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  transition: width 1s linear;
}

.pomo-cycles {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 0.75rem;
  position: relative;
  z-index: 1;
}

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

.pomo-dot.done { background: rgba(255,255,255,0.9); }

/* ---- COUNTDOWN TO DATE ---- */
.countdown-units {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 1.5rem 0 0;
  position: relative;
  z-index: 1;
}

.countdown-unit {
  text-align: center;
}

.countdown-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: white;
  line-height: 1;
  font-weight: 400;
}

.countdown-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
}

.countdown-sep {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  padding-top: 0.25rem;
}

/* ---- TIMEZONE CONVERTER ---- */
.tz-converter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 1rem;
}

.tz-swap-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  color: var(--blue-600);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-bottom: 4px;
}

.tz-swap-btn:hover { background: var(--blue-600); color: white; }

.tz-result-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  margin-top: 1rem;
}

.tz-result-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  color: var(--blue-600);
  margin-bottom: 4px;
}

.tz-result-label {
  font-size: 13px;
  color: var(--text-muted);
}
