:root {
  --dark: #0f172a;
  --gray: #64748b;
  --light: #f8fafc;
  --border: #e5e7eb;
  --accent: #0ea5e9;
  --accent-soft: #e0f2fe;
}

* {
  box-sizing: border-box;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--dark);
}


.hero {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  padding: 2rem 1rem 1.5rem;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.hero h1 {
  margin: 0 0 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.hero-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-nav button {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 0.55rem 1.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hero-nav button:hover {
  background: rgba(255,255,255,0.18);
}

.hero-nav button.active {
  background: white;
  color: var(--dark);
  font-weight: 500;
}


.page {
  max-width: 900px;
  margin: -2rem auto 3rem;
  padding: 1rem;
}

.view {
  display: none;
}
.view.active {
  display: block;
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}


.card {
  background: white;
  padding: 2rem;
  border-radius: 24px;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.08),
    0 1px 0 rgba(0,0,0,0.04);
  margin-bottom: 2rem;
}

.card h2 {
  margin-top: 0;
  font-weight: 600;
  margin-bottom: 1rem;
}


#todo-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

#todo-form input {
  flex: 1 1 160px;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fafafa;
}

#todo-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

#todo-form button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0 1.6rem;
  border-radius: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.25s ease;
}

#todo-form button:hover {
  background: #0284c7;
}


#todo-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

#todo-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

#todo-list li span {
  flex: 1;
  cursor: pointer;
}

#todo-list li.done span {
  text-decoration: line-through;
  color: var(--gray);
}

#todo-list li button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
}

#todo-list li button:hover {
  opacity: 1;
}


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

#counter {
  color: var(--gray);
  font-size: 0.9rem;
}

#clear-completed {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
}


.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calendar-header button {
  font-size: 1.4rem;
  background: none;
  border: none;
  cursor: pointer;
}

.calendar-weekdays,
#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekdays div {
  text-align: center;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--gray);
}

#calendar-grid .day {
  padding: 10px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  background: #f9fafb;
  transition: background 0.2s ease;
}

#calendar-grid .day:hover {
  background: var(--accent-soft);
}

#calendar-grid .day.has-task {
  font-weight: 600;
  position: relative;
}

#calendar-grid .day.has-task::after {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
}

#day-tasks {
  margin-top: 1rem;
}

.day-task {
  padding: 0.4rem 0;
  border-bottom: 1px dashed var(--border);
}


#o-aplikacji button {
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f1f5f9;
  cursor: pointer;
}

#o-aplikacji label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}


@media (max-width: 600px) {
  .card { padding: 1.5rem; }
  #todo-form input, #todo-form button { flex: 1 1 100%; }
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.toggle-label {
  font-weight: 500;
}

.toggle-status {
  margin-top: 0.4rem;
  color: var(--gray);
  font-size: 0.9rem;
}


.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5f5;
  border-radius: 999px;
  transition: 0.25s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
  background-color: var(--accent);
}

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



#day-tasks {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc, #ffffff);
  box-shadow: inset 0 0 0 1px var(--border);
}

#day-tasks h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--dark);
}


.day-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;

  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.day-task:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}


.day-task span,
.day-task {
  font-size: 0.95rem;
}


.day-task button {
  white-space: nowrap;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  background: var(--accent);
  color: white;
  transition: background 0.2s ease, transform 0.1s ease;
}

.day-task button:hover {
  background: #0284c7;
  transform: scale(1.05);
}


.day-task.completed {
  opacity: 0.6;
  text-decoration: line-through;
}

.day-task.completed button {
  background: #16a34a;
}