/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow: hidden;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

input, select {
  font-family: inherit;
  font-size: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== APP LAYOUT ===== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Profile Section */
.profile-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  flex: 1;
}

.profile-name span {
  font-weight: 600;
  color: var(--text-primary);
}

/* Navigation */
.nav-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-primary);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-tertiary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
}

.nav-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  border-right: 2px solid var(--accent-primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Library Section */
.library-section {
  flex: 1;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.library-title {
  padding: 0 20px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-container {
  position: relative;
  margin: 0 20px 16px;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.courses-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px;
}

.course-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 6px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.course-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
}

.course-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
}

.course-icon {
  width: 32px;
  height: 32px;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.course-info {
  flex: 1;
  min-width: 0;
}

.course-name {
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-progress {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.main-header {
  height: 60px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.back-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.theme-icon {
  width: 20px;
  height: 20px;
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Home Section */
.home-section {
  height: 100%;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.add-course-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background-color: var(--accent-primary);
  color: white;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-course-btn:hover {
  background-color: var(--accent-hover);
}

.add-course-btn svg {
  width: 18px;
  height: 18px;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  height: calc(100% - 80px);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 14px;
}

/* Course Card */
.course-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 200px;
  position: relative;
  overflow: hidden;
}

.course-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.course-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.course-card-cover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  border-radius: 12px;
}

.course-card-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
  transition: background 0.3s ease;
}

.course-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s ease;
}

.course-card:hover .course-card-cover img {
  filter: blur(3px);
}

.course-card:hover .course-card-cover::before {
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.8) 100%);
}

.course-card-icon {
  width: 48px;
  height: 48px;
  background-color: var(--bg-tertiary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  border: 2px solid var(--bg-secondary);
  overflow: hidden;
}

.course-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-card-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 3;
}

.course-card.has-cover .course-card-info,
.course-card.has-cover .course-card-body {
  position: relative;
  z-index: 3;
}

.course-card.has-cover .course-card-title {
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.course-card.has-cover .course-card-subtitle {
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.course-card.has-cover .course-stats {
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.course-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.course-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.course-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.course-progress-bar {
  width: 100%;
  height: 4px;
  background-color: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.course-progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  transition: width 0.3s ease;
}

/* Settings Section */
.settings-section {
  max-width: 600px;
}

.settings-content h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.settings-group {
  margin-bottom: 32px;
}

.settings-group h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-primary);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item label {
  font-weight: 500;
  color: var(--text-secondary);
}

.setting-item select {
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-primary);
  min-width: 120px;
}

.setting-item select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    width: 240px;
  }
  
  .courses-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
  }
  
  .content-area {
    padding: 16px;
  }
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-primary);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-primary);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

/* Image Selection */
.image-selection {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.image-upload {
  flex: 1;
}

.image-preview {
  width: 80px;
  height: 80px;
  border: 2px dashed var(--border-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
}

.image-preview:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-hover);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-placeholder {
  color: var(--text-muted);
  text-align: center;
  font-size: 11px;
}

.image-preview-placeholder svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.image-upload-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  margin-top: 8px;
}

.image-upload-btn:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.image-upload-btn svg {
  width: 16px;
  height: 16px;
}

.folder-path {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: monospace;
  word-break: break-all;
}

/* File List */
.file-list {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: 12px;
  max-height: 150px;
  overflow-y: auto;
}

.file-item {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-primary);
}

.file-item:last-child {
  border-bottom: none;
}

.file-item-more {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Buttons */
.btn-primary {
  padding: 10px 20px;
  background-color: var(--accent-primary);
  color: white;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  padding: 10px 20px;
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== NOTIFICATIONS ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  min-width: 300px;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
}

.notification-success {
  background-color: var(--success);
  color: white;
}

.notification-warning {
  background-color: var(--warning);
  color: white;
}

.notification-error {
  background-color: var(--error);
  color: white;
}

.notification-info {
  background-color: var(--accent-primary);
  color: white;
}

.notification-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 12px;
}

.notification-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.notification-close:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.notification-close svg {
  width: 12px;
  height: 12px;
}

/* No Courses Message */
.no-courses {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== ANIMATIONS ===== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Video Player Modal */
.video-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.video-player-container {
    width: 100%;
    height: 100%;
    background: var(--surface-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.video-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.close-player {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-player:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.close-player svg {
    width: 20px;
    height: 20px;
}

.video-info h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.video-info p {
    margin: 4px 0 0 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.video-wrapper {
    flex: 1;
    display: flex;
    background: #000;
    position: relative;
    min-height: 0;
}

#main-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    outline: none;
}

.video-navigation {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-wrapper:hover .video-navigation {
    opacity: 1;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

/* Course Details Enhancements */
.course-details-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.course-header {
    padding: 0 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-primary);
}

.course-info-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    color: var(--text-color);
}

.course-description {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.course-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.course-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--surface-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.course-progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Videos Section */
.videos-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin: 0;
    color: var(--text-color);
}

.view-controls {
    display: flex;
    gap: 0.5rem;
}

.view-toggle {
    background: var(--surface-secondary);
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle:hover,
.view-toggle.active {
    background: var(--primary-color);
    color: white;
}

.view-toggle svg {
    width: 18px;
    height: 18px;
}

/* Video Cards Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--surface-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--border-hover);
}

.video-card.watched {
    border-color: var(--success-color);
}

.video-card.in-progress {
    border-color: var(--warning-color);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, var(--surface-secondary), var(--surface-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    animation: fadeInThumbnail 0.5s ease forwards;
}

@keyframes fadeInThumbnail {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.thumbnail-placeholder {
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.thumbnail-placeholder.loading {
    opacity: 0.6;
    animation: thumbnailPulse 1.5s ease-in-out infinite;
}

@keyframes thumbnailPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

.thumbnail-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
}

.video-number {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    backdrop-filter: blur(10px);
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.play-btn-large {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.3);
}

.play-btn-large:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.4);
}

.play-btn-large svg {
    width: 24px;
    height: 24px;
    margin-left: 2px;
}

.completion-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--success-color-rgb), 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.completion-overlay .completion-badge {
    width: 50px;
    height: 50px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(var(--success-color-rgb), 0.3);
}

.completion-overlay .completion-badge svg {
    width: 24px;
    height: 24px;
    color: white;
}

.progress-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
}

.progress-bar-small {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill-small {
    height: 100%;
    background: var(--warning-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.video-info {
    padding: 1rem;
}

.video-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.video-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.video-status {
    font-size: 0.8rem;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.watched {
    background: rgba(var(--success-color-rgb), 0.1);
    color: var(--success-color);
}

.status-badge.in-progress {
    background: rgba(var(--warning-color-rgb), 0.1);
    color: var(--warning-color);
}

.status-badge.unwatched {
    background: var(--surface-secondary);
    color: var(--text-secondary);
}

.video-progress-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* List View */
.videos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.videos-list .video-card {
    display: flex;
    flex-direction: row;
    height: 120px;
}

.videos-list .video-thumbnail {
    width: 200px;
    height: 120px;
    flex-shrink: 0;
}

.videos-list .video-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-player-container {
        width: 100%;
        height: 100%;
    }
    
    .video-playlist {
        width: 100%;
        right: -100%;
    }
    
    .playlist-toggle {
        opacity: 1;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .course-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .video-thumbnail {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .course-details-container {
        padding: 1rem;
    }
    
    .course-info-header h1 {
        font-size: 1.5rem;
    }
    
    .video-controls-overlay {
        gap: 1rem;
    }
    
    .control-btn {
        padding: 0.75rem;
    }
    
    .control-btn svg {
        width: 20px;
        height: 20px;
    }
}

.video-playlist {
    position: absolute;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100%;
    background: var(--surface-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 1000;
}

.video-playlist.show {
    right: 0;
}

.playlist-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 1001;
}

.video-wrapper:hover .playlist-toggle {
    opacity: 1;
}

.video-playlist h4 {
    padding: 1rem 1.5rem;
    margin: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.playlist-videos {
    flex: 1;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 1rem;
}

.playlist-item:hover {
    background: var(--hover-bg);
}

.playlist-item.current {
    background: var(--primary-color-alpha);
    border-left: 3px solid var(--primary-color);
}

.playlist-item.watched {
    opacity: 0.7;
}

.playlist-number {
    width: 24px;
    height: 24px;
    background: var(--surface-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.playlist-item.current .playlist-number {
    background: var(--primary-color);
    color: white;
}

.playlist-info {
    flex: 1;
    min-width: 0;
}

.playlist-title {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-progress {
    font-size: 0.8rem;
}

.watched-indicator {
    color: var(--success-color);
}

.progress-indicator {
    color: var(--warning-color);
}

.unwatched-indicator {
    color: var(--text-secondary);
}

.playlist-thumbnail {
    width: 40px;
    height: 30px;
    background: var(--surface-color);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
}

/* Course Header Actions */
.course-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.back-button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.back-button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.back-button svg {
  width: 18px;
  height: 18px;
}

.delete-course-button {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  margin-left: auto;
}

.delete-course-button:hover {
  background: var(--error);
  color: white;
}

.delete-course-button svg {
  width: 18px;
  height: 18px;
}

/* Delete Confirmation Modal */
.delete-confirmation {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.warning-icon {
  width: 48px;
  height: 48px;
  background: rgba(var(--warning-color-rgb), 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.warning-icon svg {
  width: 24px;
  height: 24px;
  color: var(--warning);
}

.delete-message {
  flex: 1;
}

.delete-message h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.delete-message p {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.delete-message p:last-child {
  margin-bottom: 0;
}

.warning-text {
  font-size: 13px;
  color: var(--text-muted) !important;
  background: var(--bg-tertiary);
  padding: 12px;
  border-radius: 6px;
  border-left: 3px solid var(--warning);
}

/* Danger Button */
.btn-danger {
  padding: 10px 20px;
  background-color: var(--error);
  color: white;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

.playlist-toggle svg {
    width: 20px;
    height: 20px;
}

.playlist-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* ===== PROFILE SECTION STYLES ===== */
.profile-section-content {
  padding: 24px;
}

.profile-content {
  max-width: 1000px;
  margin: 0 auto;
}

.profile-header {
  margin-bottom: 32px;
  text-align: center;
}

.profile-header h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.profile-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.profile-main {
  display: grid;
  gap: 32px;
}

.profile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 32px;
}

.profile-edit-section {
  display: flex;
  justify-content: center;
}

.profile-avatar-edit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
}

.avatar-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--border-primary);
}

.avatar-edit-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.avatar-edit-btn:hover {
  background: var(--accent-secondary);
  transform: scale(1.1);
}

.avatar-edit-btn svg {
  width: 18px;
  height: 18px;
}

.profile-name-edit {
  display: flex;
  gap: 12px;
  align-items: center;
}

.profile-name-edit input {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  min-width: 200px;
  text-align: center;
}

.profile-name-edit input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.profile-stats {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 32px;
}

.profile-stats h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
}

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

.stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-primary);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-info {
  flex: 1;
}

.stat-info h4 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.stat-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Profile responsive */
@media (max-width: 768px) {
  .profile-section-content {
    padding: 16px;
  }
  
  .profile-card {
    padding: 24px 16px;
  }
  
  .profile-stats {
    padding: 24px 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .profile-name-edit {
    flex-direction: column;
    gap: 16px;
  }
  
  .profile-name-edit input {
    min-width: 250px;
  }
  
  .avatar-container {
    width: 100px;
    height: 100px;
  }
} 