:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --border-color: #e2e8f0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Inter", sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  width: 90%;
}

.app-header {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 0rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: nowrap;
  padding-bottom: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 6px;
  position: relative;
}
.logo-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid white;
  border-left: 0;
  border-top: 0;
  left: 9px;
  top: 6px;
  transform: rotate(45deg);
}

.logo h1 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
}
.logo h1 span {
  color: var(--primary);
}

.avatar {
  width: 36px;
  height: 36px;
  background: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.container {
  padding-top: 3rem;
  flex: 1;
}

/* Todo Card Base */
.todo-card {
  max-width: 450px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  margin-bottom: 3rem;
}

.card-layout {
  display: flex;
  gap: 1.25rem;
}
.checkbox-wrapper {
  padding-top: 4px;
}

/* Toggle Logic */
.todo-card.is-editing [id^="view-"] {
  display: none !important;
}
.todo-card.is-editing [id^="edit-"] {
  display: block !important;
}
.todo-card.is-editing .edit-select {
  display: inline-block !important;
}
.todo-card.is-editing #desc-toggle {
  display: none !important;
}

/* Header Elements */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}
h2 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
}

/* Collapsible Description */
.description-container {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.description-container.collapsed {
  max-height: 7.5em;
}
.description {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.text-toggle-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

/* Form Field Styling */
.edit-input,
.edit-textarea,
.edit-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  outline-color: var(--primary);
}
.edit-textarea {
  min-height: 100px;
  resize: none;
}

/* Tags */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin-bottom: 1rem;
}
.tags-list li {
  background: #f1f5f9;
  color: #475569;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Status Indicators */
.time-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}
.status-dot.overdue-pulse {
  background: var(--danger);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.countdown {
  font-size: 0.85rem;
  font-weight: 800;
}
.overdue-text {
  color: var(--danger) !important;
}
.completed-text {
  color: var(--success) !important;
}
#view-due-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Card Footer */
.card-footer {
  border-top: 1px solid #f1f5f9;
  margin-top: 1rem;
  padding-top: 1rem;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.status-indicator {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

/* Priority Colors */
.priority-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}
.priority-badge.high {
  background: #fee2e2;
  color: #b91c1c;
}
.priority-badge.medium {
  background: #fef3c7;
  color: #92400e;
}
.priority-badge.low {
  background: #d1fae5;
  color: #065f46;
}

.card-actions {
  display: flex;
  gap: 4px;
}
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
}
.icon-btn:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.todo-card.completed h2 {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* NEW APP FOOTER STYLES */
.app-footer {
  background: white;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.attribution a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.attribution a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }
}
