/* ============================================
   VISUAL HYDRATION TRACKER - Premium Styles
   Matches your app's earthy/forest theme with fresh water blues
   ============================================ */

.hydration-tracker {
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 10px 30px rgba(44, 94, 59, 0.08);
  border: 1px solid #f0f0e8;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
  font-family: 'Inter', system-ui, sans-serif;
}

@media (max-width: 640px) {
  .hydration-tracker {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .hydration-bottle {
    width: 140px;
    height: 280px;
  }

  .hydration-bottle::before {
    width: 48px;
    height: 24px;
  }

  .hydration-quick-adds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .hydration-bottle {
    width: 124px;
    height: 248px;
  }

  .hydration-quick-adds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hydration-header {
  text-align: center;
  margin-bottom: 20px;
}

.hydration-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--forest, #2C5E3B);
  margin: 0 0 4px;
}

.hydration-header p {
  font-size: 0.875rem;
  color: var(--cacao-light, #8a6f5c);
  margin: 0;
}

/* === THE BOTTLE === */
.hydration-bottle-container {
  display: flex;
  justify-content: center;
  margin: 20px 0 28px;
  perspective: 1000px;
}

.hydration-bottle {
  position: relative;
  width: 170px;
  height: 340px;
  background: linear-gradient(
    145deg,
    #f8f9f5 0%,
    #e8ede3 40%,
    #d4d9cb 100%
  );
  border-radius: 38px 38px 22px 22px;
  border: 8px solid #c3c9b8;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    inset 0 4px 12px rgba(255, 255, 255, 0.7),
    inset 0 -8px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hydration-bottle:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 14px 35px rgba(0, 0, 0, 0.18),
    inset 0 4px 12px rgba(255, 255, 255, 0.7);
}

/* Bottle neck / cap area */
.hydration-bottle::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px;
  height: 28px;
  background: linear-gradient(#c3c9b8, #b3b9a8);
  border-radius: 12px 12px 4px 4px;
  border: 6px solid #c3c9b8;
  z-index: 3;
}

/* Water fill container */
.hydration-water {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(
    to top,
    #0ea5e9 0%,
    #38bdf8 35%,
    #7dd3fc 65%,
    #bae6fd 100%
  );
  transition: height 650ms cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  overflow: hidden;
  border-radius: 0 0 14px 14px;
}

/* Beautiful water wave effect */
.hydration-water::before,
.hydration-water::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 40px;
  bottom: 0;
  left: -50%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 40%;
  animation: wave 1.8s linear infinite;
}

.hydration-water::after {
  background: rgba(255, 255, 255, 0.18);
  animation: wave 2.6s linear infinite reverse;
  height: 32px;
  bottom: 6px;
}

@keyframes wave {
  0% { transform: translateX(0) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

/* Subtle bubbles when filling */
.hydration-water .bubble {
  position: absolute;
  background: rgba(255,255,255,0.45);
  border-radius: 50%;
  animation: rise 2.2s ease-in infinite;
  pointer-events: none;
}

@keyframes rise {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0.7;
  }
  80% {
    opacity: 0.35;
  }
  100% {
    transform: translateY(-120px) scale(0.2);
    opacity: 0;
  }
}

/* Text overlay on bottle */
.hydration-text-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
  padding: 0 12px;
  text-align: center;
}

.hydration-text-overlay .amount {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: #0c4a6e;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(255,255,255,0.75);
}

.hydration-text-overlay .goal {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0e7490;
  margin-top: 2px;
  text-shadow: 0 1px 4px rgba(255,255,255,0.6);
}

.hydration-text-overlay .percent {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255,255,255,0.65);
  color: #0c4a6e;
  padding: 1px 9px;
  border-radius: 9999px;
  letter-spacing: -.3px;
}

/* === CONTROLS === */
.hydration-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hydration-quick-adds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hydration-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  background: #f8f9f5;
  border: 2px solid #e2e8d8;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cacao, #5A4032);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.1;
}

.hydration-btn:hover {
  background: #f1f3ea;
  border-color: #c3c9b8;
  transform: translateY(-1px);
}

.hydration-btn:active {
  transform: scale(0.96);
}

.hydration-btn .icon {
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 2px;
}

.hydration-btn .label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475b3f;
}

.hydration-btn .amount {
  font-size: 0.68rem;
  color: #7f8f6d;
  font-weight: 600;
}

/* Action row */
.hydration-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.hydration-actions button {
  flex: 1;
  padding: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-secondary {
  background: #f8f9f5;
  color: var(--cacao, #5A4032);
  border: 1.5px solid #d4d9cb;
}

.btn-secondary:hover {
  background: #f1f3ea;
}

.btn-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1.5px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
}

/* Goal editor */
.goal-editor {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.goal-editor label {
  color: var(--cacao-light, #8a6f5c);
  font-weight: 600;
}

.goal-editor input {
  width: 92px;
  padding: 6px 10px;
  border: 1.5px solid #d4d9cb;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--forest);
}

.goal-editor input:focus {
  outline: none;
  border-color: var(--matcha, #7E9F3D);
}

/* Progress summary */
.hydration-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.75rem;
  color: #647c54;
}

.hydration-summary .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hydration-summary .stat-value {
  font-weight: 700;
  color: var(--forest);
  font-size: 0.95rem;
}

/* Celebration state */
.hydration-bottle.goal-reached {
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 0 0 8px rgba(126, 159, 61, 0.15);
  animation: goalPulse 2s ease-in-out infinite;
}

@keyframes goalPulse {
  0%, 100% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 0 0 8px rgba(126, 159, 61, 0.15); }
  50% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 0 0 14px rgba(126, 159, 61, 0.08); }
}

/* Toast for reminders */
.hydration-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0ea5e9;
  color: white;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(14, 165, 233, 0.4);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  width: max-content;
  max-width: calc(100% - 32px);
  animation: toastSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1.4;
}

.hydration-toast span:first-child {
  flex: 1;
}

.hydration-toast button {
  background: rgba(255,255,255,0.25);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.hydration-toast .close {
  margin-left: 0;
  opacity: 0.8;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1.2rem;
  padding: 4px;
}

@keyframes toastSlide {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Weekly chart inside tracker */
.hydration-weekly {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e8ede3;
}

.hydration-weekly h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cacao-light);
  margin: 0 0 8px;
}

.hydration-weekly canvas {
  width: 100% !important;
  max-height: 110px;
}