/* Custom Styles for Video Lecture App */

:root {
  --primary-gradient: linear-gradient(135deg, #325d88 0%, #29abe0 100%);
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --card-hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  --transition-speed: 0.3s;
}

/* Main Layout */
body {
  min-height: 100vh;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.main-container {
  min-height: calc(100vh - 120px);
  padding-bottom: 60px;
}

/* Navigation Improvements */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: var(--primary-gradient) !important;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.nav-link {
  font-weight: 500;
  transition: all var(--transition-speed);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: white;
  transition: all var(--transition-speed);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* Page Headers */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--bs-primary);
}

.page-title {
  font-weight: 700;
  color: var(--bs-primary);
  margin-bottom: 0.5rem;
}

/* Card Improvements */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-speed);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-5px);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition-speed);
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-title {
  font-weight: 600;
  color: var(--bs-dark);
}

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Course/Video Grid */
.course-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.course-card,
.video-card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.course-card .card-body,
.video-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-card .card-actions,
.video-card .card-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--bs-gray-300);
}

/* Video Thumbnail Container */
.video-thumbnail {
  position: relative;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-thumbnail .play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-speed);
}

.video-thumbnail .play-overlay::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 20px solid var(--bs-primary);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 5px;
}

.video-card:hover .play-overlay {
  transform: translate(-50%, -50%) scale(1.1);
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-processing {
  background: #cfe2ff;
  color: #084298;
}

.status-completed {
  background: #d1e7dd;
  color: #0f5132;
}

.status-failed {
  background: #f8d7da;
  color: #842029;
}

/* Button Enhancements */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all var(--transition-speed);
  border: none;
}

.btn-primary {
  background: var(--primary-gradient);
  box-shadow: 0 2px 5px rgba(50, 93, 136, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 10px rgba(50, 93, 136, 0.4);
  transform: translateY(-2px);
}

.btn-group .btn {
  margin-right: 0.5rem;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

/* Form Improvements */
.form-control,
.form-select {
  border-radius: 8px;
  border: 2px solid var(--bs-gray-300);
  padding: 0.75rem 1rem;
  transition: all var(--transition-speed);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(50, 93, 136, 0.15);
}

.form-label {
  font-weight: 600;
  color: var(--bs-dark);
  margin-bottom: 0.5rem;
}

.form-text {
  font-size: 0.875rem;
  color: var(--bs-gray-600);
}

/* File Upload Area */
.file-upload-area {
  border: 2px dashed var(--bs-gray-400);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: var(--bs-gray-100);
  transition: all var(--transition-speed);
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--bs-primary);
  background: rgba(50, 93, 136, 0.05);
}

.file-upload-area input[type="file"] {
  display: none;
}

/* Alert Improvements */
.alert {
  border-radius: 12px;
  border: none;
  box-shadow: var(--card-shadow);
}

.alert-heading {
  font-weight: 600;
}

/* Progress Bar */
.progress {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  transition: width 0.6s ease;
}

/* Footer */
footer {
  background: var(--bs-dark);
  color: var(--bs-light);
  padding: 1.5rem 0;
  margin-top: auto;
}

footer p {
  margin: 0;
  opacity: 0.8;
}

/* Video Player Container */
.video-player-container {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
}

/* Price Tag */
.price-tag {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bs-success);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-tag::before {
  content: '$';
  font-size: 1rem;
  opacity: 0.7;
}

/* Stats Cards */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.stat-card .stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-card .stat-label {
  opacity: 0.9;
  font-size: 1rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--bs-gray-600);
}

.empty-state-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .course-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
  
  .page-header .btn {
    margin-top: 1rem;
    width: 100%;
  }
}

/* Accordion/Collapse Styles */
.accordion .card-header button {
  transition: all var(--transition-speed);
}

.accordion .card-header button[aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

.accordion .card-header button .bi-chevron-down {
  transition: transform var(--transition-speed);
  display: inline-block;
}

.accordion .card-header:hover {
  opacity: 0.95;
  cursor: pointer;
}

.accordion-collapse {
  transition: height 0.35s ease;
}

/* Select2 Custom Styles */
.select2-container--bootstrap-5 .select2-selection {
  min-height: 38px;
  border-radius: 0.375rem;
}

.select2-container--bootstrap-5 .select2-selection--single {
  padding: 0.375rem 0.75rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
  border-radius: 0.375rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--bs-primary);
  color: white;
}

.select2-container--bootstrap-5 .select2-search__field {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
}

/* Course Thumbnail Styles */
.course-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

.course-thumbnail-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border-radius: 8px;
  color: #6c757d;
  font-size: 4rem;
  transition: all var(--transition-speed);
}

.course-thumbnail-placeholder:hover {
  background: linear-gradient(135deg, #dee2e6 0%, #ced4da 100%);
  color: #495057;
}

/* Thumbnail preview in form */
.thumbnail-preview {
  max-width: 300px;
  margin-top: 1rem;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.thumbnail-preview img {
  border-radius: 8px;
  width: 100%;
  height: auto;
}

/* Show page thumbnail card */
.course-show-thumbnail {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  animation: shimmer 2s infinite;
  background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
  background-size: 1000px 100%;
}
