/* Custom CSS for DogCare Pedometer PWA */

:root {
  --bg-gradient-start: #2ec4b6;
  --bg-gradient-end: #cbf3f0;
  --glass-bg: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.25);
  --glass-shadow: rgba(20, 100, 90, 0.1);
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.75);
  --text-light-muted: rgba(255, 255, 255, 0.55);
  --theme-teal: #2ec4b6;
  --theme-yellow: #ff9f1c;
  --theme-orange: #ff3c38;
}

body {
  font-family: 'Outfit', 'Gaegu', 'Malgun Gothic', sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.8s ease;
}

body.weather-sunny {
  --bg-gradient-start: #2ec4b6;
  --bg-gradient-end: #0f766e;
}

body.weather-rainy {
  --bg-gradient-start: #1e3a8a;
  --bg-gradient-end: #0f172a;
}

body.weather-hot {
  --bg-gradient-start: #9a3412;
  --bg-gradient-end: #451a03;
}

body.weather-cold {
  --bg-gradient-start: #0369a1;
  --bg-gradient-end: #0f172a;
}

.brand-text {
  font-family: 'Gaegu', cursive;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-icon {
  animation: tailWag 1s ease-in-out infinite alternate;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(20, 100, 90, 0.15);
}

.btn-glass-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-glass-round:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
  color: var(--theme-yellow);
}

/* Dog Interactive Area */
.dog-display-area {
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.speech-bubble {
  position: absolute;
  top: -5px;
  background: white;
  color: #333;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  max-width: 80%;
  animation: bounce 0.6s ease infinite alternate;
  font-family: 'Gaegu', cursive;
  font-size: 1.1rem;
  z-index: 10;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: white transparent;
  display: block;
  width: 0;
}

.dog-level-badge span {
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Circular Progress */
.step-circle-container {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-ring {
  position: absolute;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 12px;
}

.ring-progress {
  fill: none;
  stroke-width: 14px;
  stroke-linecap: round;
  stroke-dasharray: 596.9; /* 2 * PI * 95 */
  stroke-dashoffset: 596.9;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0px 0px 8px rgba(46, 196, 182, 0.4));
}

.step-count-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#step-count {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.step-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
}

/* Statistics Box */
.stat-box {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-val {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-lbl {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Custom action buttons */
.btn-action {
  font-family: 'Gaegu', cursive;
  font-size: 1.15rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.btn-feed {
  background: linear-gradient(135deg, #ff9f1c, #ffbf69);
}

.btn-pet {
  background: linear-gradient(135deg, #2ec4b6, #4ea8de);
}

.btn-custom {
  transition: all 0.2s ease;
}

.btn-custom:hover {
  transform: translateY(-1px);
}

.bg-black-50 {
  background-color: rgba(0, 0, 0, 0.35);
}

.bg-black-25 {
  background-color: rgba(0, 0, 0, 0.15);
}

.text-light-muted {
  color: var(--text-light-muted);
}

.fs-sm {
  font-size: 0.88rem;
}

/* Weekly Stat Chart */
.weekly-chart {
  height: 120px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  margin: 0 4px;
}

.chart-bar-val {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chart-bar-container:hover .chart-bar-val {
  opacity: 1;
}

.chart-bar {
  width: 100%;
  max-width: 16px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px 4px 0 0;
  height: 0%;
  transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.chart-bar.goal-reached {
  background: linear-gradient(to top, #2ec4b6, #cbf3f0);
  box-shadow: 0 0 8px rgba(46, 196, 182, 0.5);
}

/* Glass Modal */
.glass-modal {
  background: rgba(25, 35, 35, 0.9) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.form-control:focus, .form-select:focus {
  background: rgba(255,255,255,0.05);
  border-color: var(--theme-teal);
  box-shadow: 0 0 0 0.25rem rgba(46, 196, 182, 0.25);
  color: white;
}

/* Animations */
@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-5px); }
}

@keyframes tailWag {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(22deg); }
}

@keyframes earFlopLeft {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-8deg); }
}

@keyframes earFlopRight {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(8deg); }
}

@keyframes dogWalk {
  0% { transform: translateY(0) scaleX(1); }
  25% { transform: translateY(-6px) rotate(-2deg); }
  50% { transform: translateY(0) scaleX(1.02); }
  75% { transform: translateY(-6px) rotate(2deg); }
  100% { transform: translateY(0) scaleX(1); }
}

@keyframes dogJump {
  0% { transform: translateY(0) scaleY(1); }
  30% { transform: translateY(6px) scaleY(0.8); }
  50% { transform: translateY(-28px) scaleY(1.15); }
  70% { transform: translateY(-20px) rotate(3deg); }
  100% { transform: translateY(0) scaleY(1); }
}

/* Dog States */
.dog-idle #dog-svg {
  animation: bounce 1.8s ease-in-out infinite alternate;
}

.dog-walk #dog-svg {
  animation: dogWalk 0.4s linear infinite;
}

.dog-jump #dog-svg {
  animation: dogJump 0.5s ease-out;
}

/* Tail Animation */
.dog-idle #dog-tail {
  transform-origin: 32px 68px;
  animation: tailWag 0.8s ease-in-out infinite alternate;
}

.dog-walk #dog-tail {
  transform-origin: 32px 68px;
  animation: tailWag 0.3s ease-in-out infinite alternate;
}

/* Ear Animations */
.dog-idle #dog-ear-left {
  transform-origin: 52px 32px;
  animation: earFlopLeft 1.5s ease-in-out infinite alternate;
}

.dog-idle #dog-ear-right {
  transform-origin: 76px 32px;
  animation: earFlopRight 1.5s ease-in-out infinite alternate;
}
