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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  padding: 20px;
  transition: all 0.3s ease;
}

body.light-theme {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

body.dark-theme {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.container {
  max-width: 800px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.light-theme .container {
  background: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dark-theme .container {
  background: #1a1a2e;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 0;
}

h1 {
  text-align: center;
  padding: 30px 20px;
  font-size: 2.2em;
  font-weight: 600;
  transition: all 0.3s ease;
}

.light-theme h1 {
  background: #4a6fa5;
  color: white;
}

.dark-theme h1 {
  background: #16213e;
  color: #a0d8f1;
}

.task-form {
  padding: 20px;
  display: flex;
  gap: 10px;
  border-bottom: 1px solid #e9ecef;
  transition: all 0.3s ease;
  margin-bottom: 0;
}

.light-theme .task-form {
  background: #f8f9fa;
}

.dark-theme .task-form {
  background: #1e2a4a;
  border-bottom-color: #3a5a8a;
  margin-bottom: 0;
}

/* Стили для экрана загрузки */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.light-theme #loading-screen {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(243, 243, 243, 0.3);
  border-top: 4px solid #4a6fa5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.dark-theme .spinner {
  border: 4px solid rgba(58, 90, 138, 0.3);
  border-top: 4px solid #a0d8f1;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#task-title {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

.light-theme #task-title {
  border-color: #e9ecef;
  background: white;
  color: #333;
}

.dark-theme #task-title {
  border-color: #3a5a8a;
  background: #1e2a4a;
  color: #fff;
}

#task-title:focus {
  border-color: #4a6fa5;
}

#add-task {
  padding: 12px 24px;
  background: #4a6fa5;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#add-task:hover {
  background: #3a5a8a;
}

.dark-theme #add-task {
  background: #3a5a8a;
}

.dark-theme #add-task:hover {
  background: #4a6fa5;
}

#task-list {
  list-style: none;
  padding: 0;
}

.task-item {
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.light-theme .task-item {
  background: white;
  color: #333;
}

.dark-theme .task-item {
  background: #1e2a4a;
  color: #fff;
  border-bottom-color: #3a5a8a;
}

.task-item:hover {
  background: #f8f9fa;
}

.dark-theme .task-item:hover {
  background: #2a3b5c;
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.task-title {
  font-size: 1.3em;
  font-weight: 600;
  transition: color 0.3s ease;
}

.light-theme .task-title {
  color: #333;
}

.dark-theme .task-title {
  color: #fff;
}

.delete-task {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.delete-task:hover {
  background: #c0392b;
}

.dark-theme .delete-task {
  background: #c0392b;
}

.dark-theme .delete-task:hover {
  background: #e74c3c;
}

.subtask-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.subtask-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.add-subtask {
  padding: 10px 16px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

.add-subtask:hover {
  background: #219653;
}

.subtask-list {
  list-style: none;
}

.subtask-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.light-theme .subtask-item {
  background: #f1f3f5;
  color: #333;
}

.dark-theme .subtask-item {
  background: #2a3b5c;
  color: #fff;
}

.subtask-checkbox {
  margin-right: 10px;
  accent-color: #4a6fa5;
  transform: scale(1.2);
}

.subtask-text {
  flex: 1;
  transition: text-decoration 0.3s ease;
}

.subtask-item.completed .subtask-text {
  text-decoration: line-through;
  color: #95a5a6;
}

.delete-subtask {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.delete-subtask:hover {
  background: #c0392b;
}

.dark-theme .delete-subtask {
  background: #c0392b;
}

.dark-theme .delete-subtask:hover {
  background: #e74c3c;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
  background-color: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.theme-icon {
  width: 20px;
  height: 20px;
  stroke: white;
  transition: all 0.3s ease;
}

.sun-icon {
  opacity: 1;
  transform: scale(1);
}

.moon-icon {
  opacity: 0;
  transform: scale(0);
}

.dark-theme .sun-icon {
  opacity: 0;
  transform: scale(0);
}

.dark-theme .moon-icon {
  opacity: 1;
  transform: scale(1);
}