:root {
  --primary: #4361ee;
  --primary-dark: #3a0ca3;
  --secondary: #4cc9f0;
  --accent: #f72585;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #4ad66d;
  --warning: #ffbe0b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin: 0;
  padding: 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--dark);
  line-height: 1.6;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.navbar .logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
}

.navbar .logo i {
  margin-right: 8px;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.5rem 0.8rem;
  border-radius: 8px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(67, 97, 238, 0.1);
}

/* Main container */
.container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-top: 5rem;
}

.container:hover {
  transform: translateY(-5px);
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

h1 {
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  color: var(--primary-dark);
  margin: 1rem 0;
  font-size: 1.5rem;
}

.progress-container {
  margin: 2rem 0;
}

.progress-bar {
  height: 12px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  border-radius: 6px;
  width: 0%;
  transition: width 0.5s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.3) 50%,
      rgba(255, 255, 255, 0) 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

/* Add to your CSS */
.progress-bar.secondary {
  height: 15px;
  background-color: #e0e0e0;
}

.progress-bar.secondary .progress-fill {
  background-color: #4CAF50;
  /* Different color for secondary bar */
}

.extra-hydration-options {
  margin: 20px 0;
  text-align: center;
}

.extra-hydration-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.btn-extra {
  background-color: #2196F3;
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-extra:hover {
  background-color: #0b7dda;
}

/* Ensure stat boxes wrap and stay within bounds */
.stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 10px;
  margin: 20px 0;
}

.stat-box {
  flex: 1 1 100px; /* Allows shrinking and wrapping */
  max-width: 30%;
  background-color: #fff;
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* On small screens, stack vertically */
@media (max-width: 500px) {
  .stat-box {
    max-width: 100%;
  }

  .stats {
    flex-direction: column;
    align-items: center;
  }
}


.stat-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.stat-box h3 {
  font-size: 0.9rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.stat-box p {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
}

.btn {
  flex: 1;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 6px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(67, 97, 238, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary-dark);
  border: 1px solid rgba(67, 97, 238, 0.2);
}

.btn-secondary:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chart-container {
  margin-top: 2rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.timer-container {
  background-color: #f0f8ff;
  padding: 20px;
  border-radius: 10px;
  margin: 20px auto;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timer-display {
  font-size: 3rem;
  font-weight: bold;
  margin: 15px 0;
  color: #0066cc;
  font-family: monospace;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

#minutesInput {
  padding: 10px;
  width: 80px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

#minutesInput {
  padding: 10px;
  width: 80px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.complete {
  color: #ff4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

#progressChart {
  width: 100%;
  height: 200px;
}

.badges-container {
  margin-top: 1.5rem;
}

.badge {
  display: inline-block;
  background: var(--warning);
  color: var(--dark);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0.3rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Water recommendation panel */
.recommendation-panel {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  margin-top: 2rem;
}

.calculator-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  color: var(--primary-dark);
}

.form-group input,
.form-group select {
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 1rem;
}

/* Leaderboard panel */
.leaderboard {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  margin-top: 2rem;
}

.leaderboard-list {
  list-style: none;
  margin: 1rem 0;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
}

.leaderboard-rank {
  font-weight: 700;
  color: var(--primary);
  width: 30px;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.leaderboard-score {
  font-weight: 700;
}

.motivation-quote {
  font-style: italic;
  color: var(--primary-dark);
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(76, 201, 240, 0.1);
  border-radius: 12px;
  position: relative;
}

.motivation-quote::before {
  content: '"';
  font-size: 3rem;
  position: absolute;
  top: -10px;
  left: 10px;
  color: rgba(76, 201, 240, 0.3);
}

.info-card {
  background: rgba(255, 255, 255, 0.7);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
  text-align: left;
}

.info-card h3 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.info-card ul {
  padding-left: 1.5rem;
}

.info-card li {
  margin-bottom: 0.5rem;
}

.tab-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.tab.active {
  background: var(--primary);
  color: white;
}

/* Hamburger menu - hidden by default on large screens */
.hamburger {
  display: none;
  font-size: 28px;
  cursor: pointer;
  padding: 10px;
}

/* Responsive styling */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background-color: #fff;
    position: absolute;
    top: 60px;
    right: 0;
    width: 200px;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 8px;
  }

  .nav-links a {
    padding: 10px;
    border-bottom: 1px solid #eee;
  }

  .nav-links.show {
    display: flex;
  }

  .hamburger {
    display: block;
  }

  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}