/* Classes Page Styles */

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  color: #333;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 1;
}

.modal-close:hover {
  background: #e0e0e0;
  transform: rotate(90deg);
}

.page-hero {
  background: white;
  padding: 40px 0 20px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.page-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.page-hero p {
  font-size: 1rem;
  color: #666;
  display: none;
}

.classes-section {
  padding: 40px 0;
  background: white;
}

.class-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
}

.filter-btn {
  padding: 14px 24px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #6b7280;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  bottom: -2px;
  letter-spacing: 0.3px;
}

.filter-btn:hover {
  color: #ff6b35;
  background: rgba(255, 107, 53, 0.05);
}

.filter-btn.active {
  background: linear-gradient(to bottom, rgba(255, 107, 53, 0.08) 0%, transparent 100%);
  color: #ff6b35;
  border-bottom-color: #ff6b35;
  font-weight: 700;
}

.filter-dropdowns {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-dropdown {
  padding: 12px 40px 12px 18px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.9rem;
  background: white;
  color: #374151;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ff6b35' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  min-width: 180px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-dropdown:hover {
  border-color: #ff6b35;
  background: #fff5f2;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
  transform: translateY(-1px);
}

.filter-dropdown:focus {
  outline: none;
  border-color: #ff6b35;
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.classes-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.class-item {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  border: 1px solid #f3f4f6;
}

.class-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff6b35 0%, #f7931e 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.class-item:hover {
  box-shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
  transform: translateY(-8px);
  border-color: #ffe5dc;
}

.class-item:hover::before {
  opacity: 1;
}

.class-item-image {
  width: 100%;
  height: 140px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
}

.class-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.class-item:hover .class-item-image img {
  transform: scale(1.08);
}

/* Overlay gradient on image */
.class-item-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
  pointer-events: none;
}

.class-item-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  display: inline-block;
}

.class-item-content {
  padding: 16px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.class-item-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}

.class-item-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.3;
}

.rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
}

.stars {
  display: flex;
  gap: 2px;
  color: #fbbf24;
  font-size: 14px;
}

.review-count {
  font-size: 13px;
  color: #666;
  margin-left: 0;
  font-weight: 500;
}

.class-item-level {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: #f0f0f0;
  color: #1a1a1a;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.class-item-level.beginner {
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
}

.class-item-level.intermediate {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.class-item-level.advanced {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  color: #1a1a1a;
}

.class-item-level.all-levels {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.class-item-description {
  color: #555;
  margin-bottom: 0;
  line-height: 1.6;
  font-size: 14px;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.class-item-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.class-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 13px;
  font-weight: 500;
}

.class-detail svg {
  color: #ff6b35;
  flex-shrink: 0;
}

.class-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: none;
  margin-top: auto;
}

.class-item-instructor {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.class-item-instructor svg {
  color: #ff6b35;
  width: 14px;
  height: 14px;
}

.instructor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.instructor-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.class-item-action {
  color: #ff6b35;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Price Display */
.class-card-price {
  position: absolute;
  bottom: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-label {
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.price-amount {
  font-size: 20px;
  font-weight: 700;
  color: #ff6b35;
  line-height: 1;
  margin-top: 2px;
}

/* Meta Items */
.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.meta-item svg {
  color: #ff6b35;
  flex-shrink: 0;
}

/* View Details Button */
.btn-view-details {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-view-details:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6a3f8f 100%);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.btn-view-details svg {
  transition: transform 0.3s ease;
}

.btn-view-details:hover svg {
  transform: translateX(4px);
}

/* Card Header */
.class-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.class-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin: 0;
}

.class-card-instructor {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.class-card-instructor svg {
  color: #ff6b35;
}

.class-card-description {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Badge on image */
.class-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
}

.badge-level {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Class Modal */
.modal-large {
  max-width: 800px;
}

.class-modal-header {
  position: relative;
  height: 300px;
  margin: -2rem -2rem 2rem -2rem;
  overflow: hidden;
}

.class-modal-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.class-modal-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
}

.class-modal-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.class-modal-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.class-modal-body {
  padding: 0 1rem;
}

.class-modal-section {
  margin-bottom: 2rem;
}

.class-modal-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.class-modal-section p, .class-modal-section ul {
  color: var(--text-light);
  line-height: 1.8;
}

.class-modal-section ul {
  padding-left: 1.5rem;
}

.class-modal-section li {
  margin-bottom: 0.5rem;
}

.class-schedule-list {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1rem;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.schedule-item:last-child {
  margin-bottom: 0;
}

.schedule-time {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
}

.schedule-day {
  color: var(--primary-color);
  font-weight: 700;
  min-width: 80px;
}

.class-modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
  .page-hero h1 {
    font-size: 2rem;
  }
  
  .classes-list {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }
  
  .class-item-image {
    height: 180px;
  }
  
  .class-item-content {
    padding: 20px;
    gap: 14px;
  }
  
  .class-item-title,
  .class-card-title {
    font-size: 18px;
  }
  
  .class-item-details,
  .class-card-meta {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .class-filters {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
    flex-wrap: nowrap !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 1.5rem !important;
  }
  
  .filter-btn {
    padding: 12px 16px;
    font-size: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    bottom: 0;
  }
  
  .filter-btn.active {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
  }
  
  .modal-large {
    max-width: 100%;
    margin: 1rem;
  }
  
  .class-modal-header {
    height: 200px;
  }
  
  .class-modal-title {
    font-size: 1.5rem;
  }
}

/* Loading State */
.classes-loading {
  text-align: center;
  padding: 60px 20px;
}

.classes-loading::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff6b35;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty State */
.no-classes-message {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 16px;
}

/* Hide deleted/disabled items */
.membership-item.is-deleted,
.membership-item.is-disabled,
.class-item.is-deleted,
.class-item.is-disabled {
  display: none !important;
}

/* Admin view - show deleted items with visual indication */
.admin-view .membership-item.is-deleted,
.admin-view .class-item.is-deleted {
  display: flex !important;
  opacity: 0.5;
  position: relative;
}

.admin-view .membership-item.is-deleted::after,
.admin-view .class-item.is-deleted::after {
  content: 'DELETED';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ef4444;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  z-index: 10;
}
