@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

* {
  box-sizing: border-box;
}

body {
  color: #444;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background-image: url('/static/assets/26214173_axcn_lm3k_211202.svg');
  background-attachment: fixed;
  background-size: 100%;
}

/* ========== LOGIN OVERLAY ========== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2rem;
  padding: 3rem 2rem;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-icon {
  font-size: 4rem;
  color: white;
  margin-bottom: 1rem;
}

.login-box h2 {
  color: white;
  font-size: 2rem;
  margin: 1rem 0;
}

.login-box p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.login-button {
  display: inline-block;
  background: rgba(255, 255, 255, 0.3);
  color: white;
  padding: 1rem 2rem;
  border-radius: 1rem;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.login-button:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ========== TOP BAR ========== */
.top-bar {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
}

.top-buttons {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.add-todo-btn {
  background: rgba(179, 131, 226, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(179, 131, 226, 0.4);
}

.add-todo-btn:hover {
  background: rgba(179, 131, 226, 1);
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 30px rgba(179, 131, 226, 0.6);
}

.user-info {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 0.7rem 1.2rem;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.user-info i {
  font-size: 1.3rem;
}

.home-button {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 0.7rem 1.2rem;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.home-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

/* ========== CONTAINER ========== */
.container {
  width: 100%;
  max-width: 800px;
  margin-top: 5rem;
}

h1 {
  color: rgb(179, 131, 226);
  font-size: 8rem;
  text-align: center;
  opacity: 0.6;
  margin: 0 0 2rem 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========== CONTROLS ========== */
.controls {
  margin-bottom: 2rem;
}

.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-box i {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 1.2rem;
}

.search-box input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.5rem;
  border: none;
  color: #222;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: inset 2px 2px 5px rgba(255, 255, 255, 0.3),
              inset -2px -2px 10px rgba(0, 0, 0, 0.2);
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  background: rgba(255, 255, 255, 0.3);
}

.filters {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.filter-select {
  flex: 1;
  min-width: 150px;
  padding: 0.8rem 1rem;
  border: none;
  color: #222;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 0.8rem;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:hover,
.filter-select:focus {
  background: rgba(255, 255, 255, 0.3);
}

/* ========== TODO FORM ========== */
.todo-form {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.input {
  border: none;
  color: #222;
  padding: 1rem 1.5rem;
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  border-radius: 0.8rem;
  box-shadow: inset 2px 2px 5px rgba(255, 255, 255, 0.3),
              inset -2px -2px 10px rgba(0, 0, 0, 0.2);
  outline: none;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.input:focus {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.4),
              inset -1px -1px 5px rgba(0, 0, 0, 0.1),
              0 0 10px rgba(179, 131, 226, 0.3);
}

.input::placeholder {
  color: #727171;
}

.main-input {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.form-details {
  margin-bottom: 1rem;
}

.description-input {
  font-size: 1rem;
  margin-bottom: 1rem;
  resize: vertical;
  min-height: 60px;
}

.form-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.select-input,
.date-input {
  flex: 1;
  min-width: 150px;
  font-size: 1rem;
  cursor: pointer;
}

.add-button {
  width: 100%;
  padding: 1rem;
  background: rgba(179, 131, 226, 0.8);
  color: white;
  border: none;
  border-radius: 0.8rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.add-button:hover {
  background: rgba(179, 131, 226, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(179, 131, 226, 0.4);
}

/* ========== TODOS LIST ========== */
.todos-container {
  margin-bottom: 2rem;
}

.todos {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  padding: 0;
  margin: 0;
  list-style-type: none;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.todos li {
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding: 1.2rem 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.todos li:first-child {
  border-top: none;
}

.todos li:hover {
  background: rgba(255, 255, 255, 0.1);
}

.todo-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
}

.todo-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border: 2px solid rgba(179, 131, 226, 0.6);
  border-radius: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  transition: all 0.3s ease;
}

.todo-checkbox i {
  display: none;
  color: white;
  font-size: 0.9rem;
}

.todo-info {
  flex: 1;
}

.todo-text {
  font-size: 1.3rem;
  color: #222;
  margin-bottom: 0.3rem;
  font-weight: 500;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.todo-description {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.todo-meta {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.todo-badge {
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.badge-category {
  background: rgba(99, 102, 241, 0.3);
  color: #3730a3;
}

.badge-priority {
  color: white;
}

.badge-priority.high {
  background: rgba(239, 68, 68, 0.8);
}

.badge-priority.medium {
  background: rgba(251, 191, 36, 0.8);
}

.badge-priority.low {
  background: rgba(34, 197, 94, 0.8);
}

.badge-date {
  background: rgba(139, 92, 246, 0.3);
  color: #5b21b6;
}

.badge-date.overdue {
  background: rgba(239, 68, 68, 0.3);
  color: #991b1b;
}

.todo-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  color: #444;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.6);
  color: white;
}

/* Completed state */
.todos li.completed .todo-checkbox {
  background: rgba(179, 131, 226, 0.8);
  border-color: rgba(179, 131, 226, 0.8);
}

.todos li.completed .todo-checkbox i {
  display: block;
}

.todos li.completed .todo-text {
  color: #7e7e7e85;
  text-decoration: line-through;
}

.todos li.completed .todo-description {
  color: #9999;
}

/* ========== EMPTY & LOADING STATES ========== */
.empty-state,
.loading-state {
  text-align: center;
  padding: 3rem 2rem;
  color: rgba(255, 255, 255, 0.8);
}

.empty-state i,
.loading-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state p,
.loading-state p {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.empty-state small {
  font-size: 1rem;
  opacity: 0.8;
}

/* ========== STATS ========== */
.stats {
  display: flex;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.stat-value {
  display: block;
  color: white;
  font-size: 2rem;
  font-weight: 600;
}

/* ========== HINT ========== */
.hint {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  display: block;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  h1 {
    font-size: 5rem;
  }
  
  .top-bar {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .container {
    margin-top: 8rem;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .filters {
    flex-direction: column;
  }
  
  .filter-select {
    width: 100%;
  }
  
  .stats {
    flex-direction: column;
    gap: 1rem;
  }
}