:root {
  --cat-bg: #fef6ff;
  --cat-surface: rgba(255, 255, 255, 0.82);
  --cat-surface-strong: rgba(255, 255, 255, 0.9);
  --cat-primary: #f582ae;
  --cat-accent: #8bd3dd;
  --cat-deep: #2b2c7c;
  --cat-text: #1f2937;
  --cat-muted: #6b7280;
  --cat-highlight: #ffc15e;
  --cat-border: rgba(255, 255, 255, 0.5);
}

body {
  font-family: 'M PLUS Rounded 1c', 'Fredoka', sans-serif;
  background: linear-gradient(130deg, rgba(255, 245, 248, 1) 0%, rgba(234, 246, 255, 1) 45%, rgba(255, 252, 241, 1) 100%);
  color: var(--cat-text);
  margin: 0;
  min-height: 100vh;
  letter-spacing: 0.01em;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 12px 30px rgba(47, 55, 90, 0.08);
  padding: 1.1rem 0;
}

.navbar {
  background: transparent !important;
  border: none;
}

.navbar-brand {
  color: var(--cat-primary) !important;
  font-weight: 800;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-tabs {
  border: none;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.35rem;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.nav-tabs .nav-link {
  border: none;
  border-radius: 12px;
  color: var(--cat-muted);
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
  color: var(--cat-primary);
}

.nav-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-accent));
  color: #fff;
  box-shadow: 0 8px 22px rgba(245, 130, 174, 0.32);
}

.date-nav {
  margin: 1.2rem 0;
}

.date-nav .btn {
  border-color: var(--cat-primary);
  color: var(--cat-primary);
  border-radius: 999px;
  font-weight: 600;
  padding: 0.45rem 1rem;
  transition: all 0.2s ease;
}

.date-nav .btn:hover {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-accent));
  color: #fff;
  box-shadow: 0 14px 30px rgba(245, 130, 174, 0.25);
}

.container {
  max-width: 1400px;
}

.card {
  background: var(--cat-surface);
  border-radius: 22px;
  border: 1px solid var(--cat-border);
  box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(10px);
  margin-bottom: 1rem;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 55px rgba(31, 41, 55, 0.12);
}

.card-img-top {
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  object-fit: cover;
  height: 260px;
}

.metrics-card {
  margin-bottom: 1rem;
}

.detection-card {
  cursor: pointer;
  transition: transform 0.25s ease;
  height: 100%;
}

.detection-card:hover {
  transform: translateY(-6px);
}

.group-header {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--cat-deep);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.session-timeline-container {
  margin-bottom: 2rem;
}

.session-timeline {
  position: relative;
  height: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  border: 1px solid var(--cat-border);
}

.timeline-dot {
  position: absolute;
  top: -8px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-accent));
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(245, 130, 174, 0.35);
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--cat-muted);
}

.popover-img {
  position: absolute;
  z-index: 2000;
  border: 1px solid var(--cat-border);
  background: var(--cat-surface-strong);
  padding: 10px;
  border-radius: 16px;
  display: none;
  max-width: 260px;
  box-shadow: 0 20px 40px rgba(31, 41, 55, 0.18);
}

#dailyChart, #sessionChart, #hourlyActivityChart {
  max-height: 260px !important;
}

#timeLapseContainer, #ltTimeLapseContainer {
  text-align: center;
  margin-bottom: 1rem;
  min-height: 400px;
  position: relative;
  transition: opacity 0.5s ease;
  background: rgba(255, 255, 255, 0.55);
  border: 1px dashed rgba(245, 130, 174, 0.35);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#timeLapseContainer img, #ltTimeLapseContainer img {
  max-width: 100%;
  max-height: 360px;
  border-radius: 20px;
  box-shadow: 0 25px 45px rgba(49, 46, 129, 0.22);
  cursor: pointer;
  transition: transform 0.3s ease;
}

#timeLapseContainer img:hover, #ltTimeLapseContainer img:hover {
  transform: translateY(-4px);
}

.btn-cat {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-accent));
  border: none;
  color: #fff;
  border-radius: 999px;
  font-weight: 700;
  padding: 0.55rem 1.4rem;
  box-shadow: 0 12px 28px rgba(245, 130, 174, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-cat:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(245, 130, 174, 0.45);
  color: #fff;
}

.btn-cat.loading {
  opacity: 0.7;
  cursor: wait;
}

.paw-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.speed-control-container {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  padding: 12px 18px;
  box-shadow: 0 12px 30px rgba(49, 46, 129, 0.12);
  margin-bottom: 1.5rem;
  border: 1px solid var(--cat-border);
}

.cheeto-alert {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: 800;
  color: var(--cat-primary);
  text-shadow: 0 10px 25px rgba(245, 130, 174, 0.45);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}

.animate-cheeto-alert {
  animation: zoomShake 3s ease forwards;
}

@keyframes zoomShake {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  25% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.2) rotate(2deg); }
  75% { transform: translate(-50%, -50%) scale(1.05) rotate(-2deg); }
  100% { transform: translate(-50%, -50%) scale(0.55); opacity: 0; }
}

@keyframes floaty {
  from { transform: translateY(-3px); }
  to { transform: translateY(3px); }
}

.cat-card {
  position: relative;
  background: var(--cat-surface);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 24px 50px rgba(47, 55, 90, 0.12);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 20% 20%, rgba(245, 130, 174, 0.18), transparent 60%), radial-gradient(120% 120% at 80% 0%, rgba(139, 211, 221, 0.18), transparent 65%);
  pointer-events: none;
  opacity: 0.9;
}

.cat-card > * {
  position: relative;
}

.floating-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.floating-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 32px 60px rgba(47, 55, 90, 0.18);
}

.smart-insight-card {
  padding: 2rem 2.2rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.smart-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.smart-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cat-muted);
}

.smart-paw-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.smart-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  color: var(--cat-primary);
}

.smart-nav-btn[data-direction="1"] .paw-icon {
  transform: scaleX(-1);
}

.smart-nav-btn:hover {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-accent));
  color: #fff;
  box-shadow: 0 10px 22px rgba(245, 130, 174, 0.28);
  transform: translateY(-2px);
}

.smart-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.smart-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.smart-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.smart-dot .paw-icon {
  font-size: 0.9rem;
}

.smart-dot:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(245, 130, 174, 0.25);
}

.smart-dot.active {
  background: linear-gradient(135deg, var(--cat-primary), var(--cat-accent));
  color: #fff;
  box-shadow: 0 14px 28px rgba(245, 130, 174, 0.35);
}

.smart-dot.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.smart-card-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 2rem;
  font-weight: 800;
  color: var(--cat-deep);
}

.smart-cat-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 8px 18px rgba(245, 130, 174, 0.35));
}

.smart-card-stats {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--cat-text);
  margin: 0;
}

.smart-card-vibe {
  font-size: 0.98rem;
  color: var(--cat-muted);
  margin: 0;
}

.smart-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
}

.smart-hour {
  font-weight: 700;
  color: var(--cat-primary);
}

.smart-trend-panel {
  padding: 1.9rem 2rem;
  min-height: 100%;
}

.smart-trend-heading {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--cat-deep);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.smart-trend-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.smart-trend-item {
  display: flex;
  gap: 0.9rem;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 18px 40px rgba(47, 55, 90, 0.12);
}

.smart-trend-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.smart-trend-title {
  font-weight: 700;
  color: var(--cat-deep);
  margin-bottom: 0.2rem;
}

.smart-trend-desc {
  font-size: 0.95rem;
  color: var(--cat-muted);
}

.smart-empty {
  font-size: 0.95rem;
  color: var(--cat-muted);
  margin: 0;
}

.trend-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.trend-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 45px rgba(47, 55, 90, 0.15);
}

.trend-value {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: var(--cat-primary);
}

.trend-label {
  font-size: 1rem;
  color: var(--cat-muted);
}

.trend-change {
  font-size: 0.9rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  display: inline-block;
  margin-top: 0.5rem;
}

.trend-up {
  background-color: rgba(46, 204, 113, 0.16);
  color: #2ecc71;
}

.trend-down {
  background-color: rgba(231, 76, 60, 0.16);
  color: #e74c3c;
}

.trend-neutral {
  background-color: rgba(108, 117, 125, 0.18);
  color: #6c757d;
}

.slide-in-card {
  animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 992px) {
  .smart-card-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .smart-paw-nav {
    display: none;
  }
  .smart-dots {
    justify-content: flex-end;
  }
}
