:root {
  --bg: #0f172a;
  --card: #1e293b;
  --primary: #38bdf8;
  --secondary: #8b5cf6;
  --success: #22c55e;
  --text: #f8fafc;
  --text-dim: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

.todo-app {
  width: 100%;
  max-width: 600px;
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 90vh;
}

/* App Header */
.app-header {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.progress-section {
  margin-top: 1rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text-dim);
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  transition: width 0.6s ease;
}

/* Filter Tabs */
.tabs {
  display: flex;
  padding: 0.5rem;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.tab {
  flex: 1;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  color: var(--text-dim);
  transition: all 0.3s ease;
}

.tab.active {
  background: var(--primary);
  color: #000;
}

/* Task List */
.task-list {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.task-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 1.5rem 0 0.75rem 0;
}

.task-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.task-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
}

.task-item.completed {
  opacity: 0.5;
}

.checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-dim);
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.task-item.completed .checkbox {
  background: var(--success);
  border-color: var(--success);
}

.checkbox::after {
  content: "✓";
  font-size: 12px;
  color: #000;
  display: none;
}

.task-item.completed .checkbox::after {
  display: block;
}

.task-content {
  flex: 1;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.task-item.completed .task-title {
  text-decoration: line-through;
}

.task-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Float Add Button */
.add-task-container {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
}

input[type="text"] {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--text);
  outline: none;
}

input[type="text"]:focus {
  border-color: var(--primary);
}

.btn-add {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 0 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Answer Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1.5rem;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--primary);
  border-radius: 24px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--primary);
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.btn-close {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Streak Badge */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.current-date {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 500;
  margin-top: 2px;
}

.streak-badge {
  background: rgba(255, 140, 0, 0.15);
  border: 1px solid rgba(255, 140, 0, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  color: #ff8c00;
  font-size: 0.9rem;
}

/* Mobile Responsiveness Improvements */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.5rem;
  }

  .todo-app {
    height: min(95vh, 800px);
    border-radius: 20px;
  }

  .app-header {
    padding: 1.5rem;
  }

  .app-header h1 {
    font-size: 1.25rem;
  }

  .streak-badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .tabs {
    overflow-x: auto;
    white-space: nowrap;
  }

  .tab {
    min-width: 80px;
    padding: 0.6rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
  }

  .todo-app {
    height: 100vh;
    border-radius: 0;
    border: none;
  }

  .task-list {
    padding: 1rem;
  }

  .task-item {
    padding: 0.85rem;
    border-radius: 12px;
    gap: 0.75rem;
  }

  .add-task-container {
    padding: 1rem;
    padding-bottom: env(safe-area-inset-bottom, 1.5rem);
    background: var(--card);
  }
}
