/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Arial, sans-serif;
}

body {
  background-color: #f0f2f5;
  color: #333;
  padding: 20px;
}

/* ===== Header ===== */
header {
  text-align: center;
  margin-bottom: 30px;
  padding: 30px 20px;
  background: linear-gradient(135deg, #3730a3, #6d28d9);
  border-radius: 16px;
  color: white;
  box-shadow: 0 4px 20px rgba(55, 48, 163, 0.3);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

header p {
  opacity: 0.85;
  font-size: 1rem;
}

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.filters input[type="text"] {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  min-width: 180px;
}

.filters input[type="text"]:focus {
  border-color: #6d28d9;
}

.filters select {
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.filters select:focus {
  border-color: #6d28d9;
}

#reset-btn {
  padding: 9px 18px;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

#reset-btn:hover {
  background: #fca5a5;
}

/* ===== Grid — fixed 3 columns, always centered ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 300px);
  gap: 20px;
  justify-content: center;
  align-content: start;
  margin-bottom: 40px;
}

/* ===== Card ===== */
.drill-card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.drill-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(55, 48, 163, 0.15);
}

.drill-img {
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.drill-content {
  padding: 14px 16px 18px;
}

.drill-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #1e1b4b;
}

.drill-content p {
  font-size: 0.85rem;
  margin-bottom: 5px;
  color: #444;
  line-height: 1.4;
}

/* Difficulty Colors */
.difficulty {
  font-weight: 600;
  margin-top: 4px;
  font-size: 0.85rem;
}

.Beginner     { color: #16a34a; }
.Intermediate { color: #d97706; }
.Advanced     { color: #dc2626; }

/* Description */
.description {
  margin-top: 8px;
  color: #666;
  font-size: 0.82rem;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
}

/* ===== Workout Generator ===== */
#workout-generator {
  margin-top: 40px;
  text-align: center;
}

#workout-generator h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 14px;
}

#generate-plan {
  padding: 12px 28px;
  border: none;
  background: linear-gradient(135deg, #3730a3, #6d28d9);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 24px;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(55, 48, 163, 0.3);
}

#generate-plan:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

#generate-plan:active {
  transform: scale(0.97);
}

.workout-plan {
  margin: 0 auto;
  background: white;
  padding: 24px;
  border-radius: 14px;
  max-width: 600px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  text-align: left;
}

.workout-plan h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 6px;
}

.workout-plan > p {
  color: #6d28d9;
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.plan-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8f7ff;
  margin-bottom: 10px;
  border-left: 4px solid #6d28d9;
  transition: background-color 0.2s;
}

.plan-item:hover {
  background: #ede9fe;
}

.plan-item p {
  font-size: 0.88rem;
  color: #444;
  margin-bottom: 2px;
}

.plan-item p strong {
  color: #1e1b4b;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, 300px);
  }
}

@media (max-width: 660px) {
  .grid {
    grid-template-columns: 300px;
  }

  header h1 {
    font-size: 1.8rem;
  }
}

/* ===== Footer ===== */
footer {
  margin-top: 60px;
  padding: 30px 20px;
  text-align: center;
  background: linear-gradient(135deg, #3730a3, #6d28d9);
  border-radius: 16px;
  color: white;
}

footer p {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 4px;
}