/* Základní reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #ece9e6, #ffffff);
  padding: 2rem;
  color: #333;
}

/* Nadpis */
h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #222;
  text-shadow: 1px 1px 2px #ccc;
}

/* Formulář */
form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

form input {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  flex: 1;
  transition: 0.3s;
  box-shadow: inset 0 0 4px #ddd;
}

form input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 6px #a0c7ff;
}

form button {
  padding: 0.5rem 1rem;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}

form button:hover {
  background: #357ac9;
}

/* To-Do úkol */
.todo {
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 1rem;
  position: relative;
  animation: fadeIn 0.4s ease;
  transition: all 0.3s ease;
}

.todo:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.todo.done {
  opacity: 0.7;
  background: #e2f0d9;
  text-decoration: line-through;
  color: #666;
}

.todo strong {
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.3rem;
}

.todo .small {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.5rem;
}

/* Tlačítka u úkolu */
.todo button {
  background: none;
  border: none;
  color: #4a90e2;
  cursor: pointer;
  margin-right: 0.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.todo button:hover {
  color: #1c5ea6;
}


.collapsible-section {
  margin-top: 2rem;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-bottom: 1rem;
  color: #4a4a4a;
  font-weight: bold;
  transition: 0.3s ease;
}

.toggle-btn.open::after {
  content: " ⯆";
}
.toggle-btn::after {
  content: " ⯈";
  margin-left: 0.5rem;
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.collapsible-content.open {
  max-height: 1000px;
  opacity: 1;
}

/* Rozklikávací položka v historii */
.history-item .details {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  padding-left: 1rem;
  font-size: 0.9rem;
}

.history-item.open .details {
  max-height: 200px;
  opacity: 1;
}

.history-item {
  margin-bottom: 1rem;
  cursor: pointer;
}


/* Animace pro přidání */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsivita */
@media (max-width: 600px) {
  form {
    flex-direction: column;
  }

  form input, form button {
    width: 100%;
  }
}



/* ===== Mobilní úpravy a detaily pro telefony ===== */

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
  }

  form {
    flex-direction: column;
    gap: 0.8rem;
  }

  form input, form button {
    width: 100%;
    font-size: 1rem;
  }

  .todo {
    padding: 0.8rem;
    font-size: 0.95rem;
  }

  .todo strong {
    font-size: 1rem;
  }

  .todo .small {
    font-size: 0.8rem;
  }

  .todo button {
    font-size: 0.85rem;
    margin-top: 0.5rem;
  }

  .toggle-btn {
    font-size: 1rem;
    text-align: left;
  }

  .collapsible-section {
    margin-top: 1.5rem;
  }

  .history-item .details {
    font-size: 0.85rem;
    padding-left: 0.5rem;
  }

  .history-item {
    font-size: 0.95rem;
  }
}

/* Vizuální doladění pro dotyková zařízení */
@media (hover: none) {
  form input, form button {
    padding: 1rem;
  }

  .todo {
    padding: 1.2rem;
  }

  .todo button {
    padding: 0.5rem 0;
  }
}

/* Pěkné přechody pro lepší UX na mobilu */
form input, form button, .todo, .toggle-btn {
  transition: all 0.3s ease;
}

/* Scroll fix – pro malou obrazovku */
html, body {
  overflow-x: hidden;
}



#delete-history {
  background-color: #e74c3c;      /* červená barva */
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%; /* na mobilu zabere celou šířku */
  max-width: 320px; /* na desktopu omezená šířka */
  display: block;
  margin: 1rem auto; /* vycentrované s mezerou nahoře a dole */
}

#delete-history:hover {
  background-color: #c0392b;
  box-shadow: 0 6px 10px rgba(0,0,0,0.15);
}

#delete-history:active {
  background-color: #a93226;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (min-width: 600px) {
  #delete-history {
    width: auto; /* na desktopu se přizpůsobí obsahu */
    padding: 12px 40px;
    font-size: 1.1rem;
  }
}

