:root {
  color-scheme: dark;
  --bg: #030407;
  --surface: rgba(8, 13, 23, 0.85);
  --surface-alt: rgba(16, 24, 38, 0.8);
  --card: rgba(21, 31, 53, 0.4);
  --text: #f5f7fb;
  --muted: #93a3c2;
  --accent: #ff6b6b;
  --accent-soft: rgba(255, 107, 107, 0.18);
  --glow: rgba(129, 140, 248, 0.35);
  --border: rgba(255, 255, 255, 0.08);
  --success: #4ade80;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 20%, #19274a, #05060b 55%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.4;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -2;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(255, 107, 107, 0.12), transparent 45%),
    radial-gradient(circle at 40% 100%, rgba(99, 102, 241, 0.18), transparent 55%);
  filter: blur(40px);
  animation: aurora 30s ease-in-out infinite alternate;
}

body::after {
  animation-delay: 5s;
  opacity: 0.7;
}

@keyframes aurora {
  0% {
    transform: translate3d(-4%, -4%, 0) scale(1);
  }
  50% {
    transform: translate3d(3%, 2%, 0) scale(1.05);
  }
  100% {
    transform: translate3d(-2%, 5%, 0) scale(0.98);
  }
}

.container {
  width: min(1400px, 95vw);
  margin: 0 auto;
}

header {
  padding: 4rem 0 2rem;
}

.header-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.hero-copy {
  flex: 1;
  max-width: 620px;
}

.view-switcher {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.view-switcher-buttons {
  display: inline-flex;
  gap: 0.6rem;
}

.language-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

.language-picker select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.language-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.view-btn {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, color 0.2s ease, border 0.25s ease;
}

.view-btn.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.view-btn:not(.active):hover {
  border-color: rgba(255, 255, 255, 0.35);
}

h1 {
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  margin: 0;
}

h2 {
  margin: 0;
  font-size: 1.8rem;
}

h3 {
  margin: 0;
  font-size: 1.4rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.hero-text {
  max-width: 550px;
  color: var(--muted);
  line-height: 1.6;
}

main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 3rem;
}

.view-section {
  width: 100%;
}

.view-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .view-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }
}

.view-hidden {
  display: none !important;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  backdrop-filter: blur(28px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45), 0 0 30px rgba(71, 85, 105, 0.25);
  position: relative;
  overflow: hidden;
  animation: floatIn 0.8s ease forwards;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 45%);
  pointer-events: none;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.panel-header small {
  color: var(--muted);
}

.timer-card {
  background: linear-gradient(135deg, rgba(15, 24, 39, 0.8), rgba(16, 31, 56, 0.7));
  border-radius: 24px;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.mode-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.mode {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
}

.mode.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

.timer-display {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#timer-display {
  font-size: clamp(3.4rem, 12vw, 5rem);
  font-weight: 600;
  text-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 107, 107, 0.2);
  letter-spacing: 0.08em;
  transition: transform 0.3s ease;
}

#timer-status {
  color: var(--muted);
  margin: 0;
  min-height: 1.3rem;
}

.timer-controls {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

button {
  border: none;
  border-radius: 14px;
  padding: 0.85rem 1.5rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

button:active {
  transform: translateY(1px);
}

button:hover {
  transform: translateY(-1px);
}

.primary {
  background: var(--accent);
  color: #070707;
  box-shadow: 0 18px 35px rgba(255, 107, 107, 0.35);
}

.ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.ghost.small {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.tasks {
  background: var(--surface-alt);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  backdrop-filter: blur(16px);
}

.tasks-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.hint {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.9rem;
}

.hint .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 0.35rem;
}

form {
  display: flex;
  gap: 0.5rem;
}

input[type="text"] {
  flex: 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0a0f15;
  color: var(--text);
  padding: 0.8rem 1rem;
  font-family: inherit;
}

input[type="text"]::placeholder {
  color: #5f6c7f;
}

form button {
  background: #233247;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#task-list,
#day-task-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.task-item {
  position: relative;
  background: linear-gradient(120deg, rgba(7, 11, 19, 0.95), rgba(18, 26, 40, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 18px;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: grab;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.task-item.dragging {
  opacity: 0.6;
  border-color: var(--accent);
  transform: rotate(-1deg) scale(1.02);
}

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.8;
}

.task-item input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.task-text {
  flex: 1;
  font-size: 0.95rem;
}

.task-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.task-actions button {
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
}

.handle {
  font-size: 1.1rem;
  color: var(--muted);
  cursor: grab;
}

/* Calendar */
.calendar-shell {
  background: var(--surface-alt);
  border-radius: 26px;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-toolbar button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03));
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease, border 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.calendar-toolbar button:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.45), 0 0 18px rgba(255, 255, 255, 0.12);
}

.calendar-toolbar button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 107, 107, 0.35), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.calendar-toolbar button:active::after {
  opacity: 1;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.weekday {
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.days {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
}

.day {
  min-height: 110px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  transition: border 0.22s ease, transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.01);
}

.day:hover,
.day.active {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
}

.day-number {
  font-weight: 600;
}

.day-tasks {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
  max-height: 3.8rem;
}

.day-tasks span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-tasks span.done {
  text-decoration: line-through;
  color: rgba(144, 193, 144, 0.8);
}

.pill-count {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.7rem;
  color: var(--muted);
}

#day-details {
  background: rgba(10, 15, 21, 0.8);
  border-radius: 22px;
  padding: 1.25rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.day-task-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.75rem 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.day-task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  padding: 1rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

footer .container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  align-items: center;
}

.footer-credit {
  color: var(--text);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  header {
    padding-top: 2.8rem;
  }

  .header-layout {
    flex-direction: column;
  }

  .view-switcher {
    width: 100%;
    text-align: left;
  }

  .view-switcher-buttons {
    flex-wrap: wrap;
  }

  .panel {
    padding: 1.2rem;
  }

  .timer-card,
  .calendar-shell,
  #day-details {
    padding: 1rem;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .day {
    min-height: 70px;
  }
}
#stats-panel {
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.25rem;
  border-radius: 20px;
  background: rgba(11, 18, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.stat-card h3 {
  margin: 0.3rem 0 0;
  font-size: 2rem;
}

.chart-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 24px;
  background: rgba(6, 10, 18, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stats-bars {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stats-bar-label {
  width: 110px;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: capitalize;
}

.stats-bar-track {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.8), rgba(255, 170, 119, 0.8));
  transition: width 0.4s ease;
}

.stats-bar-value {
  min-width: 60px;
  text-align: right;
  font-size: 0.9rem;
}
