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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
header {
  text-align: center;
  color: white;
  margin-bottom: 30px;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 1rem;
  opacity: 0.95;
}

/* Login Container */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.login-card {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 400px;
  width: 100%;
}

.login-card h2 {
  margin-bottom: 10px;
  color: #667eea;
}

.login-card p {
  margin-bottom: 25px;
  color: #666;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

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

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

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

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Schedule Container */
.schedule-container {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.date-display {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 15px;
  order: 0;
}

.date-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e0e0e0;
  order: 2;
}

.date-label {
  font-weight: 600;
  color: #667eea;
  margin-right: 8px;
}

.btn-secondary {
  padding: 10px 20px;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

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

/* Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 1px;
  background: #e0e0e0;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  order: 1;
}

.grid-header {
  display: contents;
}

.grid-row {
  display: contents;
}

.grid-cell {
  background: white;
  padding: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
}

.header-cell {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

.time-cell {
  font-weight: 600;
  color: #667eea;
  text-align: center;
  font-size: 0.95rem;
}

/* Available Slot */
.slot-available {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.slot-available:hover {
  transform: scale(1.02);
}

.availability-badge {
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Booked Slot */
.slot-booked {
  background: #f5f5f5;
  color: #666;
}

.slot-full {
  border-left: 4px solid #ff6b6b;
}

.class-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.class-instructor {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 4px;
}

.class-capacity {
  font-size: 0.8rem;
  color: #999;
}

/* Loading and Error States */
.loading {
  text-align: center;
  padding: 40px;
  color: #667eea;
  font-size: 1.1rem;
  order: 1;
}

.error-message {
  background: #ffe0e0;
  color: #d32f2f;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  font-size: 0.9rem;
  border-left: 4px solid #d32f2f;
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    display: none;
  }

  .login-card {
    padding: 25px;
  }

  .schedule-container {
    padding: 20px;
  }

  .schedule-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .btn-secondary {
    width: 100%;
  }

  /* Keep 3-column grid on mobile, just make it more compact */
  .schedule-grid {
    grid-template-columns: 70px 1fr 1fr;
    font-size: 0.85rem;
  }

  .header-cell {
    font-size: 0.75rem;
    padding: 10px 5px;
  }

  .time-cell {
    font-size: 0.8rem;
    padding: 12px 5px;
  }

  .grid-cell {
    padding: 10px 5px;
    min-height: 60px;
  }

  .class-name {
    font-size: 0.8rem;
  }

  .class-instructor {
    font-size: 0.75rem;
  }

  .class-capacity {
    font-size: 0.7rem;
  }

  .availability-badge {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  header h1 {
    font-size: 1.3rem;
  }

  .login-card {
    padding: 20px;
  }

  .schedule-container {
    padding: 12px;
  }

  /* Even more compact for very small screens */
  .schedule-grid {
    grid-template-columns: 60px 1fr 1fr;
    font-size: 0.8rem;
  }

  .header-cell {
    font-size: 0.7rem;
    padding: 8px 3px;
  }

  .time-cell {
    font-size: 0.75rem;
    padding: 10px 3px;
  }

  .grid-cell {
    padding: 8px 3px;
    min-height: 50px;
  }

  .class-name {
    font-size: 0.75rem;
  }

  .class-instructor {
    font-size: 0.7rem;
  }

  .class-capacity {
    font-size: 0.65rem;
  }

  .availability-badge {
    font-size: 0.85rem;
  }
}
