/* ===== Base ===== */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== Tab nav active state ===== */
.tab-btn.active-tab {
  color: #3A75A8;
  border-bottom-color: #5B9FD6;
}

/* ===== Filter pills ===== */
.hw-filter.active-filter {
  background-color: #5B9FD6 !important;
  color: white !important;
  border-color: transparent !important;
}
.cal-view-btn.active-view {
  background-color: #5B9FD6 !important;
  color: white !important;
}

/* ===== Child chip ===== */
.child-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid transparent;
  background: white;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.child-chip:hover { background: #f1f5f9; }
.child-chip.active {
  background: linear-gradient(135deg, #5B9FD6, #4A8DC4);
  color: white;
  box-shadow: 0 2px 8px -1px rgba(91, 159, 214, 0.4);
}
.child-chip .avatar-dot {
  width: 8px; height: 8px; border-radius: 9999px;
  background: currentColor; opacity: 0.6;
}
.child-chip.active .avatar-dot { opacity: 1; background: white; }

/* ===== Homework item ===== */
.hw-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: white; border: 1px solid #e2e8f0;
  border-radius: 0.875rem;
  transition: all 0.2s ease;
}
.hw-item:hover { border-color: #B0D5ED; box-shadow: 0 2px 8px -2px rgba(91, 159, 214, 0.15); }
.hw-item.done {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.hw-item.done .hw-title {
  text-decoration: line-through;
  color: #94a3b8;
}
.hw-item.overdue {
  border-color: #fecaca;
  background: #fef2f2;
}

/* ===== Custom checkbox with bounce animation ===== */
.hw-check {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: white;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.hw-check:hover { border-color: #5B9FD6; }
.hw-check svg {
  width: 14px; height: 14px;
  color: white;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hw-check.checked {
  background: linear-gradient(135deg, #5B9FD6, #4A8DC4);
  border-color: #4A8DC4;
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hw-check.checked svg { transform: scale(1); }

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Confetti puff on completion */
.hw-check.just-checked::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid #5B9FD6;
  opacity: 0.6;
  animation: ripple 0.6s ease-out forwards;
}
@keyframes ripple {
  0%   { transform: scale(0.5); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ===== Subject badge ===== */
.subj-badge {
  display: inline-flex; align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  background: #EEF6FC;
  color: #3A75A8;
}

/* ===== Day-of-week toggle in academy modal ===== */
.day-toggle {
  padding: 0.5rem 0;
  border-radius: 0.625rem;
  border: 1.5px solid #e2e8f0;
  background: white;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.day-toggle:hover { border-color: #B0D5ED; }
.day-toggle.selected {
  background: #5B9FD6;
  border-color: #5B9FD6;
  color: white;
}

/* ===== Color swatch in child modal ===== */
.color-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.15s ease;
}
.color-swatch.selected {
  border-color: #1e293b;
  transform: scale(1.1);
}

/* ===== Calendar ===== */
.cal-cell {
  position: relative;
  min-height: 84px;
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 0.5rem;
  padding: 0.375rem;
  cursor: default;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cal-cell.muted { background: #fafafa; color: #cbd5e1; }
.cal-cell.today {
  border-color: #5B9FD6;
  background: #EEF6FC;
}
.cal-cell.drag-over {
  background: #FEF4EA;
  border-color: #F5A962;
  border-style: dashed;
}
.cal-day-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}
.cal-cell.today .cal-day-num { color: #3A75A8; }
.cal-cell .sun { color: #ef4444; }
.cal-cell .sat { color: #3b82f6; }

.cal-chip {
  display: block;
  font-size: 0.65rem;
  padding: 2px 5px;
  margin-top: 2px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  font-weight: 500;
  line-height: 1.2;
}
.cal-chip:active { cursor: grabbing; }
.cal-chip.hw {
  background: #D7EAF6;
  color: #2E5D86;
}
.cal-chip.hw.done {
  background: #f1f5f9;
  color: #94a3b8;
  text-decoration: line-through;
}
.cal-chip.ac {
  background: #FCE3CB;
  color: #9a4a13;
  cursor: default;
}

@media (max-width: 640px) {
  .cal-cell { min-height: 58px; padding: 0.25rem; }
  .cal-chip { font-size: 0.6rem; padding: 1px 3px; }
}

/* ===== Toast ===== */
#toast.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}
#toast.toast-success { background: #16a34a; }
#toast.toast-error { background: #dc2626; }
#toast.toast-info { background: #3A75A8; }
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.empty-state .icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
