/* Todoke - Brand Styles */
/* Color System: Coral (#FF6B6B) + Teal (#2D9CDB) + Navy (#334E68) */

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Toast notification */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.3s ease 2.7s forwards;
  pointer-events: none;
  backdrop-filter: blur(10px);
  max-width: 90vw;
}
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #FF6B6B, #E84545); }
.toast.info { background: linear-gradient(135deg, #2D9CDB, #1A7BB5); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-2rem) scale(0.8); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(-50%) translateY(-1rem); }
}

/* Gradient backgrounds */
.bg-brand-gradient { background: linear-gradient(135deg, #FF6B6B 0%, #2D9CDB 100%); }
.bg-coral-gradient { background: linear-gradient(135deg, #FF6B6B 0%, #FF8A8A 100%); }
.bg-teal-gradient { background: linear-gradient(135deg, #2D9CDB 0%, #4DB8E8 100%); }
.bg-warm-gradient { background: linear-gradient(135deg, #FF6B6B 0%, #FFB347 100%); }
.bg-cool-gradient { background: linear-gradient(135deg, #2D9CDB 0%, #6C5CE7 100%); }
.bg-success-gradient { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }

/* Card styles */
.card {
  background: white;
  border-radius: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 0 1px rgba(0,0,0,0.06);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
}
.card:active { transform: scale(0.98); }
.card-hover:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.08); transform: translateY(-1px); }

/* Tile cards (home screen) */
.tile {
  border-radius: 1.25rem;
  padding: 1.25rem;
  color: white;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.tile:active { transform: scale(0.96); }
.tile::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 60%;
  height: 150%;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
.tile .tile-icon {
  width: 2.75rem;
  height: 2.75rem;
  background: rgba(255,255,255,0.2);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  backdrop-filter: blur(4px);
}
.tile .tile-count {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.tile .tile-label {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 0.25rem;
  font-weight: 500;
}

/* PWA install banner */
.pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #FF6B6B, #2D9CDB);
  color: white;
  padding: 1rem;
  z-index: 9998;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid rgba(0,0,0,0.04);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.04);
  backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.6rem;
  font-weight: 600;
  color: #9FB3C8;
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}
.nav-item.active { color: #FF6B6B; }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5rem;
  height: 2.5px;
  background: linear-gradient(90deg, #FF6B6B, #FF8A8A);
  border-radius: 2px;
}
.nav-item i { font-size: 1.15rem; margin-bottom: 0.2rem; }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #FF6B6B, #E84545);
  color: white;
  border: none;
  border-radius: 1.25rem;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}
.btn-primary:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2); }
.btn-primary:disabled { opacity: 0.6; }

.btn-teal {
  background: linear-gradient(135deg, #2D9CDB, #1A7BB5);
  color: white;
  border: none;
  border-radius: 1.25rem;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(45, 156, 219, 0.3);
}
.btn-teal:active { transform: scale(0.97); }
.btn-teal:disabled { opacity: 0.6; }

.btn-confirm.confirmed {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4) !important;
  animation: celebrate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Badge styles */
.badge-must-read {
  background: linear-gradient(135deg, #FF6B6B, #FF8A8A);
  color: white;
  font-weight: 700;
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  display: inline-block;
}
.badge-optional {
  background: linear-gradient(135deg, #2D9CDB, #4DB8E8);
  color: white;
  font-weight: 700;
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  display: inline-block;
}
.badge-done {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  font-weight: 700;
  font-size: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 2rem;
  display: inline-block;
}
.badge-overdue {
  color: #E84545;
  font-weight: 800;
}

/* Loading spinner */
.spinner {
  border: 3px solid #FFE0E0;
  border-top: 3px solid #FF6B6B;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  width: 1rem;
  height: 1rem;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 42, 67, 0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(6px);
}
.modal-content {
  background: white;
  border-radius: 1.5rem 1.5rem 0 0;
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, #f8f8f8 25%, #f0f0f0 50%, #f8f8f8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 0.75rem;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Safe area */
.page-content {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0));
}

/* Celebrate animation */
@keyframes celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.celebrate { animation: celebrate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Progress bar */
.progress-bar {
  height: 0.5rem;
  border-radius: 1rem;
  background: #f0f0f0;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 1rem;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Avatar circle */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}
.avatar-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: white;
  flex-shrink: 0;
}

/* Section header */
.section-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #829AB1;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Line clamp utility */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Toggle switch */
input[type="checkbox"].sr-only + div {
  position: relative;
  cursor: pointer;
}
input[type="checkbox"].sr-only + div::after {
  transition: transform 0.2s ease;
}

/* Pulse animation for alerts */
@keyframes pulse-coral {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); }
}
.pulse-coral { animation: pulse-coral 2s infinite; }

/* Smooth page transitions */
#app {
  animation: pageEnter 0.3s ease;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
