/* CrossFit Tracker - Main Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

/* Navigation */
.navbar {
  background-color: #2d3748;
  color: white;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.navbar-logo {
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-link {
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background-color 0.2s;
  font-weight: 500;
}

.navbar-link:hover {
  background-color: #4a5568;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid #4a5568;
}

.logout-btn {
  background-color: #e53e3e;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background-color: #c53030;
}

/* Main Content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 80px);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.2s;
  line-height: 1;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #3182ce, #2c5aa0);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 5px 15px rgba(49, 130, 206, 0.3);
}

.btn-secondary {
  background-color: #718096;
  color: white;
}

.btn-secondary:hover {
  background-color: #4a5568;
}

.btn-danger {
  background-color: #e53e3e;
  color: white;
}

.btn-danger:hover {
  background-color: #c53030;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* Welcome Section */
.welcome-section {
  text-align: center;
  padding: 60px 20px;
}

.welcome-container h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #2d3748;
}

.welcome-description {
  font-size: 20px;
  color: #718096;
  margin-bottom: 50px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.feature {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.feature h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #2d3748;
}

.welcome-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.dashboard-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #2d3748;
}

.workouts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

.workout-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  transition: all 0.2s;
}

.workout-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.workout-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.workout-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #2d3748;
  margin: 0;
}

.workout-date {
  background-color: #edf2f7;
  color: #4a5568;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.workout-result {
  margin-bottom: 12px;
  padding: 12px;
  background-color: #f0fff4;
  border-left: 4px solid #48bb78;
  border-radius: 6px;
}

.workout-notes {
  margin-bottom: 16px;
  padding: 12px;
  background-color: #fefcbf;
  border-left: 4px solid #d69e2e;
  border-radius: 6px;
  font-size: 14px;
}

.workout-image {
  margin-bottom: 16px;
}

.workout-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.workout-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.no-workouts {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.no-workouts h3 {
  font-size: 24px;
  color: #4a5568;
  margin-bottom: 10px;
}

.no-workouts p {
  color: #718096;
  margin-bottom: 30px;
}

/* Auth Forms */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px;
}

.auth-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #2d3748;
  font-size: 28px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #4a5568;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s;
  background-color: #f7fafc;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3182ce;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.auth-button {
  background: linear-gradient(135deg, #3182ce, #2c5aa0);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 10px;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(49, 130, 206, 0.3);
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  color: #718096;
  font-size: 14px;
}

.auth-link a {
  color: #3182ce;
  text-decoration: none;
  font-weight: 500;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Error Messages */
.error-message {
  background-color: #fed7d7;
  color: #c53030;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #e53e3e;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #3182ce;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .main-content {
    padding: 15px;
  }
  
  .navbar-container {
    flex-direction: column;
    gap: 15px;
  }
  
  .navbar-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .navbar-user {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid #4a5568;
    padding-top: 15px;
  }
  
  .welcome-container h1 {
    font-size: 36px;
  }
  
  .welcome-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .welcome-actions .btn {
    width: 100%;
    max-width: 300px;
  }
  
  .dashboard-header {
    flex-direction: column;
    text-align: center;
  }
  
  .dashboard-header h1 {
    font-size: 28px;
  }
  
  .workouts-grid {
    grid-template-columns: 1fr;
  }
  
  .workout-actions {
    flex-direction: column;
  }
  
  .auth-card {
    padding: 30px 25px;
  }
  
  .auth-card h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 10px;
  }
  
  .welcome-container h1 {
    font-size: 28px;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .auth-card {
    padding: 25px 20px;
  }
}