/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  color: white;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info span {
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5a6fd6;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-large {
  padding: 15px 30px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cards */
.card, .login-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-card {
  text-align: center;
  padding: 48px 24px;
}

.login-card h2 {
  margin-bottom: 12px;
  color: #333;
}

.login-card p {
  color: #666;
  margin-bottom: 24px;
}

.card h2 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.3rem;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

/* Workout List */
.workout-list {
  max-height: 400px;
  overflow-y: auto;
}

.workout-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.workout-item:last-child {
  border-bottom: none;
}

.workout-item-main {
  flex: 1;
}

.workout-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.workout-item-name {
  font-weight: 600;
  color: #333;
}

.workout-item-type {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: #e8eaff;
  color: #667eea;
}

.workout-item-date {
  font-size: 0.85rem;
  color: #888;
}

.workout-item-details {
  font-size: 0.9rem;
  color: #666;
  margin-top: 4px;
}

.workout-item-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #f0f0f0;
  color: #333;
}

.btn-icon.delete:hover {
  background: #ffe5e5;
  color: #e53935;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

/* Loading */
.loading {
  text-align: center;
  color: #888;
  padding: 20px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 1000;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

/* Utility */
.hidden {
  display: none !important;
}

/* GitHub Icon */
.github-icon {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media (max-width: 600px) {
  .header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .card, .login-card {
    padding: 16px;
  }

  .workout-item {
    flex-direction: column;
    gap: 12px;
  }

  .workout-item-actions {
    align-self: flex-end;
  }
}
