/* Подключение шрифта Pacifico */
@font-face {
  font-family: 'Pacifico';
  src: url('../fonts/Pacifico-Regular.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* Базовые стили */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.875rem;
  background-color: #cecece;
  margin: 0;
  padding: 20px 100px;
  color: #333;

  background-image: url(../img/bg/45degreee_fabric.png);

  /* background: url(https://shturval.by/templates/RedShturvalBy/img/bg01.jpg) no-repeat center fixed;
	-webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover; */
}

/* Блок header */
.header {
  font-size: 14px;
}

.header__title {
  font-family: 'Pacifico', cursive;
  text-align: center;
  margin-bottom: 20px;
  font-size: 6rem;
  color: #4a90e2;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) ;
}

.header__form {
  background-color: none;
  padding: 0;
}

.header__button-container {
  margin-bottom: 20px;
  height: 35px;
  top: 20px; 
  right: 20px; 
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Блок button */
.button {
  background-color: #4a90e2;
  transition: background-color 0.3s ease;
  font-size: 0.75rem;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  gap: 8px;
}

.button:hover {
  background-color: #357abd;
}

.button--admin {
  background-color: #4a90e2;
  text-decoration: none;
}
.button:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.button--admin:hover {
  background-color: #357abd;
}

.button--logout {
  background-color: #ff6b6b;
}

.button--logout:hover {
  background-color: #ff4757;
}

.button--edit {
  background-color: rgba(49, 107, 65, 0);
  border: dotted 1px #8eb198;
  color: #8eb198;
  max-width: 60px;
  max-height: 50px;
  padding: 5px;
  transition: all 0.3s ease;
}
.button--edit:hover {
  background-color: #518861;
  border: dotted 1px #518861;
  color: #ffffff;
}

.button--delete {
  background-color: rgba(255, 107, 107, 0);
  border: dotted 1px #ff9393;
  color: #ff9393;
  padding: 5px;
  transition: all 0.3s ease;
}
.button--delete:hover {
  background-color: #ff4757;
  color: #ffffff;
}

.button--change-password {
  background-color: #4caf50;
  color: white;
}

.button.category__button {
  border: none;
  padding: 4px;
}

.button--change-password:hover {
  background-color: #45a049;
}

/* Блок form */
.form {
  background: rgba(255, 255, 255, 0.5);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form__input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1;
  min-width: 200px;
}
.form__input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.form__select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1;
  min-width: 200px;
}
.form__select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.form__label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form__checkbox {
  width: 16px;
  height: 16px;
}

/* Блок category */
.category {
  transition: all 0.3s ease;
  margin: 5px 0;
  padding: 10px 15px;
  background: rgba(245, 245, 245, 0.8);
  border-radius: 5px;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
}

.category:hover {
  background: rgba(245, 245, 245, 0.9);
  transform: translateY(-1px);
  box-shadow: 2px 4px 12px rgba(0,0,0,0.15);
}

.category__title {
  margin-top: 0;
  color: #4a90e2;
  cursor: pointer;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  transition: color 0.3s ease;
}

.category__title:active {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

/* Вместо стилей для ::after теперь стилизуем SVG */
.category__title .svg-icon-arrow {
  margin-left: 10px;
  transition: transform 0.3s ease;
  position: absolute;
  right: 0;
}

.category__title.active .svg-icon-arrow {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
  position: absolute;
  right: 0;
}

.category__name {
  font-size: 1rem;
  line-height: 1rem;
  margin-right: 10px;
}

.category__counter {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.3);
  min-width: 80px;
}

.category__actions {
  display: flex;
  gap: 1px;
  margin-right: 10px;
}

/* При активном состоянии категории */
.category__title.active + .tasks {
  animation: fadeIn 0.3s ease-out;
}

/* Блок tasks */
.tasks {
  margin: 10px 0;
  counter-reset: task-number;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out, margin 0.3s ease-in-out;
}

.tasks.hide {
  max-height: 0;
  opacity: 0;
  margin-top: -10px;
  pointer-events: none; /* Отключаем взаимодействие, когда скрыто */
  transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out, margin 0.3s ease-in-out;
}

/* Блок task */
.task {
  display: flex;
  justify-content: space-between;
  padding: 4px;
  margin-top: 4px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background-color: #f9f9f9;
  transition: background-color 0.3s ease;
  counter-increment: task-number;
}
.task:hover {
  background-color: #ffffff;
}

/* Стиль для выполненных задач */
.task--completed {
  background-color: #e9f3e5;
}
.task--completed:hover {
  background-color: #e9f3e5;
}

.task__number {
  display: inline-block;
  vertical-align: top;
  text-align: right;
  width: 20px;
  font-weight: bold;
  color: #666;
}

.task__description {
  flex: 1;
  margin: 0 10px;
}

.task__description--completed {
  text-decoration: line-through;
  color: #888;
}

.task__actions {
  display: flex;
  gap: 5px;
}

.task__status {
  background-color: #e49f28;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.task__status:hover {
  background-color: #ce8f22;
}

.task__status--done {
  background-color: #4CAF50;
  color: white;
}

.task__status--done:hover {
  background-color: #45a049;
}

/* Блок modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
}

.modal__content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 8px;
  position: relative;
}

.modal__close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal__close:hover {
  color: #000;
}

.modal__title {
  margin-bottom: 20px;
}

.modal__input {
  width: 95%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.modal__input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

.modal__textarea {
  width: 95%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-height: 100px;
  resize: vertical;
}
.modal__textarea:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
}

/* Блок admin */
.admin {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin__section {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin__section-title {
  color: #4a90e2;
  margin-top: 0;
  margin-bottom: 20px;
}

.admin__table-container {
  overflow-x: auto;
}

.admin__table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.admin__table-header {
  background-color: #4a90e2;
  color: white;
}

.admin__table-header th {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

.admin__table-body tr:nth-child(even) {
  background-color: #f9f9f9;
}

.admin__table-body tr:hover {
  background-color: #f1f1f1;
}

.admin__table-cell {
  padding: 10px;
  border: 1px solid #ddd;
}

/* Блок login */
.login {
  max-width: 400px;
  margin: 100px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.login__title {
  color: #4a90e2;
  margin-bottom: 20px;
}

.login__error {
  color: #ff6b6b;
  margin-bottom: 10px;
  padding: 10px;
  background: #ffecec;
  border-radius: 4px;
}

.login__register {
  margin-top: 20px;
  color: #666;
}

.login__register-link {
  color: #4a90e2;
  text-decoration: none;
  transition: color 0.3s ease;
}

.login__register-link:hover {
  color: #357abd;
}

/* Анимации */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tasks .task {
  animation: fadeIn 0.3s ease-out;
}

/* Иконки */
.svg-icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  fill: currentColor; /* Наследует цвет от родительского элемента */
}

/* Медиа-запросы */
@media (max-width: 600px) {
  .header__button-container {
    position: static;
    margin-top: 10px;
    justify-content: center;
  }

  .button--admin,
  .button--logout {
    padding: 8px 16px;
    font-size: 14px;
  }

  .header__title {
    font-size: 24px;
  }

  .admin {
    padding: 10px;
  }

  .admin__section {
    padding: 15px;
  }

  .admin__table-cell {
    padding: 5px;
  }

  .button--change-password,
  .button--delete {
    padding: 5px 10px;
    font-size: 12px;
  }
}

/* Стили для стрелочки на кнопке разворачивания/сворачивания всех категорий */
.toggle-all-arrow {
    transition: transform 0.3s ease;
}

.toggle-all-arrow.active {
    transform: rotate(180deg);
}