:root {
  --primary: #4a6cf7;
  --primary-dark: #3b5be3;
  --secondary: #6c757d;
  --success: #28a745;
  --danger: #dc3545;
  --dark: #1d2a3a;
  --light: #f8f9fa;
  --gray: #6c757d;
  --light-gray: #e9ecef;
  --border-radius: 8px;
  --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f7fb;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header Styles */
header {
  background: linear-gradient(120deg, var(--dark), #2c3e50);
  color: white;
  padding: 15px 0;
  box-shadow: var(--box-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo i {
  color: var(--primary);
}

/* Auth Section */
#auth-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-input {
  padding: 10px 15px;
  border: none;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  width: 180px;
  font-size: 14px;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.auth-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--border-radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.auth-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

#logoutBtn {
  background: var(--danger);
}

#logoutBtn:hover {
  background: #bd2130;
}

/* Main Content */
main {
  padding: 30px 0;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--dark);
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* Course Grid */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.course-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.course-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.course-image {
  height: 180px;
  background: linear-gradient(45deg, #3498db, #8e44ad);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}

.course-content {
  padding: 20px;
}

.course-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--dark);
}

.course-description {
  color: var(--gray);
  margin-bottom: 15px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.course-price {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 15px;
  text-align: center;
  background: var(--light);
  padding: 8px 12px;
  border-radius: var(--border-radius);
  border: 2px solid var(--primary);
}

.view-clips-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
}

.view-clips-btn:hover {
  background: var(--primary-dark);
}

/* Clips Section */
#clips-section {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  margin-bottom: 30px;
}

.clips-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--light-gray);
  flex-wrap: wrap;
  gap: 15px;
}

.course-header-title {
  font-size: 1.5rem;
  color: var(--dark);
  margin-bottom: 5px;
}

.course-price-display {
  font-size: 1.1rem;
  color: var(--success);
  font-weight: 600;
}

.purchase-btn {
  padding: 12px 25px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.purchase-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

.clips-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.clip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: var(--light);
  border-radius: var(--border-radius);
  transition: var(--transition);
  flex-wrap: wrap;
  gap: 15px;
}

.clip-item:hover {
  background: #e9ecef;
}

.clip-info {
  flex: 1;
  min-width: 200px;
}

.clip-title {
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 5px;
}

.clip-duration {
  font-size: 0.85rem;
  color: var(--gray);
}

.clip-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.clip-btn {
  padding: 8px 15px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.preview-btn {
  background: var(--primary);
  color: white;
}

.preview-btn:hover {
  background: var(--primary-dark);
}

.full-btn {
  background: var(--success);
  color: white;
}

.full-btn:hover {
  background: #218838;
}

/* Video Player Section */
#video-section {
  background: white;
  border-radius: var(--border-radius);
  padding: 25px;
  box-shadow: var(--box-shadow);
  text-align: center;
}

#videoPlayer {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: var(--border-radius);
  background: var(--dark);
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }
  
  .header-content {
    flex-direction: column;
    text-align: center;
  }
  
  #auth-section {
    width: 100%;
    justify-content: center;
  }
  
  .auth-input {
    width: 100%;
    max-width: 200px;
  }
  
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .course-image {
    height: 150px;
    font-size: 2.5rem;
  }
  
  .course-content {
    padding: 15px;
  }
  
  .clips-header {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  
  .purchase-btn {
    justify-content: center;
  }
  
  .clip-item {
    flex-direction: column;
    text-align: center;
  }
  
  .clip-actions {
    width: 100%;
    justify-content: center;
  }
  
  .clip-btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
  
  .section-title {
    font-size: 1.5rem;
    text-align: center;
  }
  
  .section-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.2rem;
  }
  
  .auth-btn {
    padding: 8px 15px;
    font-size: 12px;
  }
  
  .course-price {
    font-size: 1rem;
    padding: 6px 10px;
  }
  
  .clip-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  #videoPlayer {
    height: 200px;
  }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .header-content {
    flex-wrap: nowrap;
  }
  
  #auth-section {
    flex-wrap: nowrap;
  }
}

/* Loading Animation */
.loader {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Notification Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 25px;
  background: var(--dark);
  color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  z-index: 1000;
  max-width: 300px;
  text-align: center;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Error and loading states */
.no-courses, .no-clips, .error-loading {
  text-align: center;
  padding: 30px;
  color: var(--gray);
  font-style: italic;
}