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

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #ffffff;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
}

.header {
  margin-bottom: 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-container img {
  height: 40px;
  width: auto;
  filter: invert(1);
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 15px;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.header p {
  color: #94a3b8;
  font-size: 1.1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 30px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-text {
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: #4ade80;
  font-weight: 600;
}

.section {
  margin-bottom: 40px;
}

.section-title {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #ffffff;
}

.section-icon {
  font-size: 1.8rem;
  margin-right: 15px;
}

.todo-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 12px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
}

.todo-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(74, 222, 128, 0.3);
  transform: translateY(-2px);
}

.todo-item.completed {
  background: rgba(74, 222, 128, 0.1);
  border-color: #4ade80;
}

.todo-item.completed .todo-text {
  text-decoration: line-through;
  color: #94a3b8;
}

.checkbox {
  width: 28px;
  height: 28px;
  border: 3px solid #374151;
  border-radius: 8px;
  margin-right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.todo-item.completed .checkbox {
  background: #4ade80;
  border-color: #4ade80;
}

.checkbox-icon {
  color: #ffffff;
  font-size: 18px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.todo-item.completed .checkbox-icon {
  opacity: 1;
}

.todo-text {
  font-size: 1.1rem;
  line-height: 1.5;
  flex: 1;
  color: #ffffff;
}

.todo-text strong {
  color: #4ade80;
  font-weight: 600;
}

.reset-container {
  text-align: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.reset-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.reset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.reset-btn:active {
  transform: translateY(0);
}

.refresh-btn {
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
  background: linear-gradient(135deg, #f57c00, #ef6c00);
}

.refresh-btn:active {
  transform: translateY(0);
}

.cache-invalidate-btn {
  background: #ff9800;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
  margin-top: 10px;
}

.cache-invalidate-btn:hover {
  background: #f57c00;
}

.cache-invalidate-btn:active {
  transform: scale(0.98);
}

.completion-celebration {
  text-align: center;
  padding: 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.1), rgba(34, 197, 94, 0.1));
  border-radius: 15px;
  border: 2px solid #4ade80;
  display: none;
}

.completion-celebration.show {
  display: block;
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.celebration-text {
  font-size: 1.3rem;
  color: #4ade80;
  font-weight: 600;
}

@media (max-width: 768px) {
  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .todo-item {
    padding: 15px;
  }

  .checkbox {
    width: 24px;
    height: 24px;
    margin-right: 15px;
  }
}

.checklist-scroll {
  max-height: calc(100vh - 320px); /* Further reduced for header without padding */
  overflow-y: auto;
  padding-right: 8px;
}

/* Optional: Hide scrollbar for Webkit browsers */
.checklist-scroll::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}
.checklist-scroll::-webkit-scrollbar-thumb {
  background: rgba(74, 222, 128, 0.2);
  border-radius: 4px;
}

.logout-btn {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
  background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.logout-btn:active {
  transform: translateY(0);
}

.section-progress-overview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 15px;
}

.section-progress-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
  min-height: 24px;
}

.section-progress-icon {
  font-size: 1.2rem;
  margin-right: 4px;
  display: flex;
  align-items: center;
}

.section-progress-title {
  width: 85px;
  min-width: 85px;
  max-width: 85px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: #fff;
  font-weight: 500;
  transition: color 0.3s, font-weight 0.3s;
}

.section-progress-bar.completed .section-progress-title,
.section-progress-bar.completed .section-progress-icon {
  color: #4ade80;
  font-weight: 700;
}

.section-progress-bar.completed .section-progress-title::after {
  content: ' \2714'; /* checkmark */
  color: #4ade80;
  font-size: 1.1em;
  margin-left: 6px;
}

.progress-bar.small {
  height: 4px;
  min-width: 80px;
  max-width: 120px;
  margin: 0 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
}

.progress-bar.small.fixed-width {
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.section-progress-text {
  color: #4ade80;
  font-size: 0.9em;
  min-width: 35px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.error-container {
  text-align: center;
  padding: 40px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 15px;
  margin: 20px;
}

.error-container h2 {
  color: #ef4444;
  margin-bottom: 15px;
  font-size: 1.5rem;
}

.error-container p {
  color: #94a3b8;
  margin-bottom: 20px;
  line-height: 1.5;
}

.error-container button {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.error-container button:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
}
