/* Fitness Tracker - Main Stylesheet */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --dark: #1f2937;
  --light: #f3f4f6;
  --white: #ffffff;
  --gray-100: #f7fafc;
  --gray-200: #edf2f7;
  --gray-300: #e2e8f0;
  --gray-400: #cbd5e0;
  --gray-500: #a0aec0;
  --gray-600: #718096;
  --gray-700: #4a5568;
  --gray-800: #2d3748;
  --gray-900: #1a202c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Navigation */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white) !important;
}

.navbar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white) !important;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background: #059669;
  color: var(--white);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background: #dc2626;
  color: var(--white);
}

.btn-outline-primary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-success {
  background: var(--secondary);
  color: var(--white);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

/* Forms */
.form-control, .form-select {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--gray-300);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.form-label {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

/* Badges */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
  font-size: 0.75rem;
}

.badge-primary {
  background: var(--primary);
}

.badge-success {
  background: var(--secondary);
}

.badge-warning {
  background: var(--warning);
  color: var(--white);
}

.badge-danger {
  background: var(--danger);
}

.badge-info {
  background: var(--info);
}

/* Progress Bars */
.progress {
  height: 0.75rem;
  border-radius: 1rem;
  background: var(--gray-200);
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 1rem;
  transition: width 0.5s ease;
}

/* Stats Cards */
.stat-card {
  background: var(--white);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-card .stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--dark);
}

.stat-card .stat-label {
  color: var(--gray-600);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Workout Card */
.workout-card {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  background: var(--white);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.workout-card:hover {
  background: var(--gray-100);
  transform: translateX(4px);
}

.workout-card h5 {
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.workout-card .workout-meta {
  display: flex;
  gap: 1rem;
  color: var(--gray-600);
  font-size: 0.875rem;
}

.workout-card .workout-category {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Exercise Item */
.exercise-item {
  padding: 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--white);
}

.exercise-item .exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.exercise-item .exercise-name {
  font-weight: 600;
  color: var(--dark);
}

.exercise-item .sets-info {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.exercise-item .set-badge {
  padding: 0.25rem 0.5rem;
  background: var(--gray-100);
  border-radius: 0.25rem;
  font-size: 0.75rem;
  color: var(--gray-700);
}

/* Goal Card */
.goal-card {
  background: var(--white);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.goal-card.completed {
  border-left: 4px solid var(--secondary);
}

.goal-card.active {
  border-left: 4px solid var(--primary);
}

/* Badge */
.badge-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.badge-item.earned {
  border: 2px solid var(--secondary);
}

.badge-item .badge-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--gray-200);
  color: var(--gray-600);
}

.badge-item.earned .badge-icon {
  background: var(--secondary);
  color: var(--white);
}

/* Nutrition */
.macro-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.macro-ring .value {
  font-size: 1.25rem;
  font-weight: 700;
  z-index: 1;
}

/* Water Tracker */
.water-tracker {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.water-glass {
  width: 30px;
  height: 40px;
  border: 2px solid var(--info);
  border-radius: 4px 4px 8px 8px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.water-glass.filled {
  background: var(--info);
}

.water-glass:hover {
  transform: scale(1.1);
}

/* Charts Container */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  padding: 1rem;
}

/* Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  border: none;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 4rem 2rem;
  border-radius: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
  padding: 2rem;
}

.auth-card {
  background: var(--white);
  border-radius: 1.5rem;
  padding: 3rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--dark);
}

/* Checkbox Group */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.checkbox-item:hover {
  border-color: var(--primary);
}

.checkbox-item input {
  width: 18px;
  height: 18px;
}

.checkbox-item.selected {
  background: rgba(79, 70, 229, 0.1);
  border-color: var(--primary);
}

/* Footer */
.footer {
  background: var(--dark);
  color: var(--white);
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

/* Utilities */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-primary {
  color: var(--primary) !important;
}

.text-secondary {
  color: var(--secondary) !important;
}

.text-muted {
  color: var(--gray-600) !important;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .navbar {
    padding: 0.75rem 1rem;
  }

  .container {
    padding: 1rem 0.75rem;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-600);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

/* Modal */
.modal-content {
  border-radius: 1rem;
  border: none;
}

.modal-header {
  border-bottom: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--gray-200);
  padding: 1rem 1.5rem;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--gray-100);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  border-bottom: 2px solid var(--gray-200);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.table tr:hover {
  background: var(--gray-50);
}

/* Workout Category Colors */
.category-strength { background: #fee2e2; color: #991b1b; }
.category-cardio { background: #dbeafe; color: #1e40af; }
.category-hiit { background: #fef3c7; color: #92400e; }
.category-flexibility { background: #d1fae5; color: #065f46; }
.category-sports { background: #e0e7ff; color: #3730a3; }
.category-other { background: var(--gray-200); color: var(--gray-700); }

/* Muscle Group Colors */
.muscle-chest { background: #ef4444; color: white; }
.muscle-back { background: #3b82f6; color: white; }
.muscle-shoulders { background: #f59e0b; color: white; }
.muscle-biceps { background: #8b5cf6; color: white; }
.muscle-triceps { background: #ec4899; color: white; }
.muscle-legs { background: #10b981; color: white; }
.muscle-core { background: #6366f1; color: white; }
.muscle-cardio { background: #14b8a6; color: white; }
