/* UniMAC IFT Production Hub - Main Stylesheet */

/* Import UniMAC Media Card Component */
@import url('media-card.css');

/* ===== CSS CUSTOM PROPERTIES (VARIABLES) ===== */
:root {
  /* Primary Color Palette - Clean & Professional */
  --primary-color: #a0043c;
  --primary-hover: #8a0336;
  --primary-light: #b91c47;
  --primary-rgb: 160, 4, 60;
  
  /* Supporting Colors */
  --secondary-color: #f8f9fa;
  --secondary-hover: #e9ecef;
  --accent-color: #6c757d;
  --accent-hover: #495057;
  
  /* Enhanced Button Colors */
  --btn-primary-bg: var(--primary-color);
  --btn-primary-hover: var(--primary-hover);
  --btn-primary-text: var(--text-on-primary);
  --btn-secondary-bg: var(--secondary-color);
  --btn-secondary-hover: var(--secondary-hover);
  --btn-secondary-text: var(--text-primary);
  
  /* Enhanced Border & Shadow Colors */
  --border-light: #dee2e6;
  --border-medium: #ced4da;
  --border-dark: #adb5bd;
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 8px 16px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 4px 12px rgba(var(--primary-rgb), 0.2);
  
  /* Text Colors - High Contrast for Accessibility */
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-muted: #adb5bd;
  --text-inverse: #ffffff;
  --text-on-primary: #ffffff;
  
  /* Background Colors - Clean & Modern */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-dark: #212529;
  --bg-dark-secondary: #343a40;
  --bg-dark-tertiary: #495057;
  
  /* Border Colors */
  --border-light: #e0e0e0;
  --border-medium: #d0d0d0;
  --border-dark: #404040;
  
  /* Status Colors */
  --success-color: #00a86b;
  --warning-color: #ff9500;
  --error-color: #ff3333;
  --info-color: #0066cc;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Typography */
  --font-family-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: "SF Mono", Monaco, Inconsolata, "Roboto Mono", Consolas, "Courier New", monospace;
  
  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 72px;
  --header-height: 56px;
  --container-max-width: 1200px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 50%;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted: #717171;
  --text-inverse: #0f0f0f;
  
  --bg-primary: #0f0f0f;
  --bg-secondary: #181818;
  --bg-tertiary: #272727;
  
  --border-light: #303030;
  --border-medium: #404040;
  --border-dark: #606060;
}

/* ===== GLOBAL STYLES ===== */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-primary);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Improved text contrast and readability */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--spacing-md) 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin: 0 0 var(--spacing-md) 0;
  color: var(--text-primary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: none;
}

/* ===== LAYOUT COMPONENTS ===== */

/* Main Layout Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ===== MAIN CONTENT AREA ===== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
  background-color: var(--bg-primary);
}

.main-wrapper.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

/* ===== TOP NAVIGATION ===== */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-xl);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  min-height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.mobile-only {
  display: none;
}

/* ===== SEARCH STYLES ===== */
.search-container {
  flex: 1;
  max-width: 600px;
  margin: 0 var(--spacing-lg);
}

.search-form {
  width: 100%;
}

.search-input-group {
  display: flex !important;
  align-items: center !important;
  background-color: #f8f9fa !important;
  border: 2px solid #e3e3e3 !important;
  border-radius: 24px !important;
  height: 40px !important;
  overflow: hidden !important;
  transition: all var(--transition-fast) !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.075) !important;
}

.search-input-group:focus-within {
  border-color: #1c4ed8 !important;
  box-shadow: 0 0 0 1px #1c4ed8 !important;
  background-color: #ffffff !important;
}

.search-input {
  flex: 1 !important;
  border: none !important;
  padding: 0 16px !important;
  background: transparent !important;
  color: #0f172a !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  outline: none !important;
  height: 100% !important;
  line-height: 1 !important;
}

.search-input::placeholder {
  color: #6b7280 !important;
  font-size: 16px !important;
}

.search-btn {
  background-color: #f8f9fa !important;
  border: none !important;
  border-left: 1px solid #e5e7eb !important;
  padding: 0 20px !important;
  color: #374151 !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 64px !important;
}

.search-btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.search-btn i {
  font-size: 16px;
}

/* Dark mode search styles - Enhanced for better brand integration */
[data-theme="dark"] .search-input-group {
  background-color: hsl(0, 0%, 7%) !important;
  border-color: hsl(0, 0%, 18.82%) !important;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2) !important;
}

[data-theme="dark"] .search-input-group:focus-within {
  border-color: rgba(160, 4, 60, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(160, 4, 60, 0.3), 0 0 12px rgba(160, 4, 60, 0.1) !important;
  background-color: hsl(0, 0%, 9%) !important;
}

[data-theme="dark"] .search-input {
  color: #f8f9fa !important;
}

[data-theme="dark"] .search-input::placeholder {
  color: rgba(248, 249, 250, 0.5) !important;
}

[data-theme="dark"] .search-btn {
  background-color: hsl(0, 0%, 7%) !important;
  border-left-color: hsl(0, 0%, 18.82%) !important;
  color: rgba(248, 249, 250, 0.7) !important;
}

[data-theme="dark"] .search-btn:hover {
  background-color: hsl(0, 0%, 12%) !important;
  color: #ffffff !important;
  border-left-color: hsl(0, 0%, 25%) !important;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

/* ===== YOUTUBE-STYLE HOMEPAGE ===== */
.homepage-container {
  padding: var(--spacing-xl);
}

.homepage-header {
  margin-bottom: var(--spacing-xl);
}

.homepage-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.homepage-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* Featured Content Section */
.featured-section {
  margin-bottom: var(--spacing-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: between;
  margin-bottom: var(--spacing-lg);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-left: var(--spacing-sm);
}

/* ===== MEDIA GRID LAYOUT (YouTube-style) ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.media-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

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

.media-thumbnail {
  position: relative;
  width: 100%;
  height: 180px;
  background-color: var(--bg-tertiary);
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.media-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.media-card:hover .media-image {
  transform: scale(1.05);
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: var(--text-inverse);
  opacity: 0.9;
  transition: all var(--transition-fast);
}

.media-card:hover .play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.document-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  color: var(--text-muted);
}

.audio-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  color: var(--primary-color);
}

.media-type-badge {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background-color: rgba(0, 0, 0, 0.8);
  color: var(--text-inverse);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
}

.media-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: var(--spacing-md);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.media-card:hover .media-overlay {
  opacity: 1;
}

.media-stats {
  display: flex;
  gap: var(--spacing-md);
  color: var(--text-inverse);
  font-size: 0.875rem;
}

.media-stats span {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: all 0.3s ease;
}

/* YouTube-style view count animations */
.media-stats span:has(i.fa-eye) {
  position: relative;
}

.media-stats span:has(i.fa-eye):hover {
  transform: scale(1.05);
}

/* Smooth number transitions */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-count-updated {
  animation: countUp 0.4s ease;
}

.media-info {
  padding: var(--spacing-md);
}

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

.media-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background-color: var(--primary-color);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== AUTHENTICATION PAGES ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  padding: var(--spacing-xl);
}

.auth-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.auth-logo i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-md);
}

.auth-logo h2 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.auth-logo p {
  color: var(--text-secondary);
  margin: 0;
}

/* Enhanced Form Styles */
.form-label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  display: block;
}

.form-control {
  width: 100%;
  padding: var(--spacing-md);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(160, 4, 60, 0.1);
}

.form-control.is-invalid {
  border-color: var(--error-color);
}

.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-select:focus {
  background-color: var(--surface-hover);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(160, 4, 60, 0.1);
}

/* Dark mode form select adjustments */
[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
  background-color: #2d3748;
  border-color: #4a5568;
  color: #ffffff;
}

[data-theme="dark"] .form-select:focus {
  background-color: #374151;
  border-color: var(--primary-color);
}

[data-theme="dark"] .form-select option {
  background-color: #2d3748;
  color: #ffffff;
}

/* Enhanced sort dropdown styling */
.sort-options {
  position: relative;
  z-index: 50;
}

.sort-options .form-select {
  min-width: 150px;
  font-weight: 500;
  font-size: 0.875rem;
}

/* Content section styling */
.content-section {
  padding: var(--spacing-lg) 0;
}

.content-header h2 {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

[data-theme="dark"] .content-header h2 {
  color: #9ca3af;
}

.invalid-feedback {
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
}

/* ===== ENHANCED BUTTON STYLES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 40px;
  box-shadow: var(--shadow-light);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

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

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  border-color: var(--border-light);
}

.btn-secondary:hover {
  background-color: var(--btn-secondary-hover);
  border-color: var(--border-medium);
  color: var(--btn-secondary-text);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-primary);
}

.btn-outline-secondary {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}

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

.btn-outline-danger {
  background-color: transparent;
  color: var(--error-color);
  border-color: var(--error-color);
}

.btn-outline-danger:hover {
  background-color: var(--error-color);
  color: var(--text-on-primary);
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: 0.75rem;
  min-height: 32px;
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1rem;
  min-height: 48px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== CARD COMPONENTS ===== */
.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-secondary);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-secondary);
}

/* ===== ALERT COMPONENTS ===== */
.alert {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  border: 1px solid transparent;
}

.alert-success {
  background-color: rgba(0, 168, 107, 0.1);
  border-color: var(--success-color);
  color: var(--success-color);
}

.alert-danger {
  background-color: rgba(255, 51, 51, 0.1);
  border-color: var(--error-color);
  color: var(--error-color);
}

.alert-warning {
  background-color: rgba(255, 149, 0, 0.1);
  border-color: var(--warning-color);
  color: var(--warning-color);
}

.alert-info {
  background-color: rgba(0, 102, 204, 0.1);
  border-color: var(--info-color);
  color: var(--info-color);
}

/* ===== DASHBOARD STYLES ===== */
.dashboard-content {
  padding: var(--spacing-xl);
}

.welcome-section {
  background: var(--primary-color);
  color: var(--text-on-primary);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-xl);
  margin-bottom: var(--spacing-xl);
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.15);
}

.welcome-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-avatar-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  border: 4px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.welcome-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  border: 4px solid rgba(255, 255, 255, 0.2);
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background-color: var(--bg-primary);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
  transition: transform var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

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

.quick-actions {
  margin-bottom: var(--spacing-xl);
}

.quick-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  background-color: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  min-height: 120px;
}

.quick-action-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--primary-color);
}

.quick-action-card i {
  font-size: 2rem;
  margin-bottom: var(--spacing-md);
}

.dashboard-section {
  margin-bottom: var(--spacing-2xl);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
}

.empty-state {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--text-secondary);
}

.empty-state i {
  margin-bottom: var(--spacing-lg);
}

/* ===== MEDIA VIEW STYLES ===== */
.media-view-content {
  padding: var(--spacing-xl);
}

.media-player {
  background-color: var(--bg-dark);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--spacing-xl);
}

.video-player {
  width: 100%;
  height: auto;
  max-height: 70vh;
}

.image-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background-color: var(--bg-dark);
}

.image-viewer img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.document-viewer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background-color: var(--bg-secondary);
}

.document-preview {
  text-align: center;
  padding: var(--spacing-2xl);
}

.document-icon {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

.media-details {
  margin-bottom: var(--spacing-xl);
}

.media-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.media-meta {
  margin-bottom: var(--spacing-lg);
}

.media-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.media-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

/* ===== YOUTUBE-STYLE ACTION BUTTONS ===== */

.youtube-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap; /* Allow wrapping on desktop */
}

/* Base YouTube Action Button */
.youtube-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border: none;
  border-radius: 18px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.05, 0, 0, 1);
  min-height: 36px;
  white-space: nowrap;
}

.youtube-action-btn:hover {
  background: var(--bg-tertiary);
}

.youtube-action-btn i {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.youtube-action-btn:hover i {
  transform: scale(1.1);
}

/* Like/Dislike Combined Button Group */
.youtube-like-dislike-group {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}

.youtube-like-dislike-group .youtube-action-btn {
  background: transparent;
  border-radius: 0;
  min-width: 64px;
  justify-content: center;
}

.youtube-like-dislike-group .like-btn {
  padding-right: 12px;
}

.youtube-like-dislike-group .dislike-btn {
  padding-left: 12px;
}

.button-separator {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  opacity: 0.3;
}

/* Active States */
.youtube-action-btn.like-btn.active {
  background: rgba(0, 102, 204, 0.1);
  color: #0066cc;
}

.youtube-action-btn.dislike-btn.active {
  background: rgba(96, 96, 96, 0.1);
  color: #606060;
}

.youtube-action-btn.watch-later-btn.active {
  background: rgba(0, 102, 204, 0.1);
  color: #0066cc;
}

.youtube-action-btn.watch-later-btn.active i {
  color: #0066cc;
}

/* Specific Button Styles */
.share-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.more-btn {
  min-width: 40px;
  padding: 10px;
  justify-content: center;
}

.more-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Count and Text Styling */
.youtube-action-btn .count {
  font-weight: 500;
  font-size: 14px;
}

.youtube-action-btn .btn-text {
  font-weight: 500;
  font-size: 14px;
}

/* Stats Display for Non-Logged Users */
.youtube-stats-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-radius: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-item i {
  font-size: 16px;
}

/* Hover Animations */
.youtube-action-btn:active {
  transform: scale(0.95);
}

.youtube-like-dislike-group:hover {
  background: var(--bg-tertiary);
}

/* Special Effects for Like Button */
.youtube-action-btn.like-btn.active i {
  color: #0066cc;
  animation: likePress 0.3s ease;
}

.youtube-action-btn.dislike-btn.active i {
  color: #606060;
  animation: dislikePress 0.3s ease;
}

@keyframes likePress {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes dislikePress {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Legacy support for old action-btn class */
.action-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background-color: var(--bg-tertiary);
  transform: translateY(-1px);
}

.action-btn.active {
  background-color: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
}

/* YouTube-style like/dislike buttons */
.action-btn[data-action="like"].active {
  background-color: #065fd4;
  color: white;
}

.action-btn[data-action="dislike"].active {
  background-color: #606060;
  color: white;
}

/* Hide dislike count visually for non-creators */
.action-btn[data-action="dislike"] span:empty {
  display: none;
}

/* Ensure proper spacing when count is hidden */
.action-btn[data-action="dislike"] span:empty + * {
  margin-left: 0;
}

/* YouTube-Style Comment System */
.comments-section {
  margin-top: var(--spacing-lg);
}

.comments-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment {
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.comment-main {
  display: flex;
  gap: var(--spacing-md);
  align-items: flex-start;
}

/* YouTube-style avatars */
.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-avatar-placeholder,
.comment-avatar-placeholder-sm {
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.comment-avatar-placeholder {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.comment-avatar-placeholder-sm {
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
}

/* Comment content styling */
.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-decoration: none;
}

.comment-author:hover {
  color: var(--primary-color);
}

.comment-timestamp {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 400;
}

.comment-text {
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: var(--spacing-sm);
  word-wrap: break-word;
}

/* YouTube-style comment actions */
.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.comment-action-btn {
  background: none;
  border: none;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  min-height: 32px;
}

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

.comment-action-btn.active {
  color: var(--primary-color);
  background-color: rgba(6, 95, 212, 0.1);
}

.comment-action-btn i {
  font-size: 0.875rem;
}

/* Reply section styling */
.comment-replies {
  margin-top: var(--spacing-md);
  margin-left: 54px; /* Align with parent comment content */
  border-left: 2px solid var(--border-light);
  padding-left: var(--spacing-md);
}

.reply-form {
  margin-top: var(--spacing-md);
  margin-left: 54px;
}

.reply-form .comment-form {
  background-color: var(--bg-secondary);
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.reply-form textarea {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-sm);
  font-size: 0.875rem;
  resize: vertical;
  min-height: 80px;
}

.reply-form textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(6, 95, 212, 0.1);
  outline: none;
}

/* Reply toggle button */
.replies-toggle {
  margin-top: var(--spacing-sm);
  margin-left: 54px;
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: var(--spacing-xs) 0;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.replies-toggle:hover {
  text-decoration: underline;
}

.replies-toggle i {
  transition: transform 0.2s ease;
}

.replies-toggle.expanded i {
  transform: rotate(180deg);
}

/* Comment form styling */
.main-comment-form {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.main-comment-form .form-control {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  font-size: 0.875rem;
  min-height: 100px;
}

.main-comment-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(6, 95, 212, 0.1);
  outline: none;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-replies.showing {
  animation: slideDown 0.3s ease;
}

.reply-form.showing {
  animation: slideDown 0.3s ease;
}

/* Loading states */
.comment-action-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.comment-action-btn.loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid var(--text-secondary);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: var(--spacing-xs);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.creator-info {
  display: flex;
  align-items: center;
  padding: var(--spacing-lg);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
}

.creator-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  margin-right: var(--spacing-md);
  object-fit: cover;
}

.creator-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--primary-color);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: var(--spacing-md);
}

.creator-name {
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* ===== COMMENTS SECTION ===== */
.comments-section {
  margin-top: var(--spacing-2xl);
}

.comment-form {
  margin-bottom: var(--spacing-xl);
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.comment-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--primary-color);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.comment-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.comment-avatar-placeholder-sm {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background-color: var(--primary-color);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.comment {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--border-light);
}

.comment:last-child {
  border-bottom: none;
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.comment-author {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-text {
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--spacing-sm);
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.comment-replies {
  margin-top: var(--spacing-lg);
  margin-left: var(--spacing-xl);
  border-left: 2px solid var(--border-light);
  padding-left: var(--spacing-lg);
}

/* ===== PROFILE STYLES ===== */
.profile-content {
  padding: var(--spacing-xl);
}

.profile-header {
  margin-bottom: var(--spacing-xl);
}

.profile-cover {
  background: var(--primary-color);
  color: var(--text-on-primary);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px rgba(var(--primary-rgb), 0.15);
}

.profile-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-xl);
}

.profile-avatar {
  flex-shrink: 0;
}

.avatar-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  border: 4px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  border: 4px solid rgba(255, 255, 255, 0.2);
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.profile-title {
  font-size: 1.125rem;
  opacity: 0.9;
  margin-bottom: var(--spacing-sm);
}

.profile-meta {
  opacity: 0.8;
  margin-bottom: var(--spacing-md);
}

.profile-bio {
  max-width: 600px;
  opacity: 0.9;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.stat-item {
  background-color: var(--bg-primary);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

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

/* ===== UPLOAD STYLES ===== */
.upload-content {
  padding: var(--spacing-xl);
}

.upload-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.upload-dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background-color: var(--bg-secondary);
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary-color);
  background-color: rgba(160, 4, 60, 0.05);
}

.dropzone-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

.file-input {
  display: none;
}

.file-preview {
  margin-top: var(--spacing-lg);
}

.file-preview-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background-color: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.preview-image,
.preview-video {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.preview-icon {
  font-size: 2rem;
  color: var(--text-muted);
  width: 80px;
  text-align: center;
}

.file-info {
  flex: 1;
}

.file-info h6 {
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--text-primary);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
  }
  
  .dashboard-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: 1050;
    transition: transform 0.3s ease-in-out;
  }
  
  .sidebar.show {
    transform: translateX(0);
  }
  
  /* Mobile sidebar backdrop */
  .sidebar.show::after {
    content: '';
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    width: calc(100vw - var(--sidebar-width));
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
  
  .main-wrapper {
    margin-left: 0;
  }
  
  .main-wrapper.sidebar-collapsed {
    margin-left: 0;
  }
  
  .mobile-only {
    display: block;
  }
  
  .top-nav {
    padding: var(--spacing-md);
  }
  
  .search-container {
    flex: 1;
    margin: 0 var(--spacing-sm);
    max-width: none;
  }
  
  .search-input-group {
    height: 36px;
  }
  
  .search-input {
    font-size: 14px;
    padding: 0 12px;
  }
  
  .search-input::placeholder {
    font-size: 14px;
  }
  
  .search-btn {
    padding: 0 16px;
    min-width: 48px;
  }
  
  .search-btn i {
    font-size: 14px;
  }
  
  .top-nav-actions {
    gap: var(--spacing-sm);
  }
  
  .page-title {
    font-size: 1.25rem;
  }
  
  .homepage-container,
  .dashboard-content,
  .media-view-content,
  .profile-content,
  .upload-content {
    padding: var(--spacing-md);
  }
  
  .media-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-sm);
  }
  
  /* Enhanced mobile media card layout */
  .media-card {
    display: flex;
    flex-direction: row;
    height: 120px;
    margin-bottom: var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }
  
  .media-card .media-thumbnail {
    width: 160px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 0;
  }
  
  .media-card .media-info {
    flex: 1;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
  }
  
  .media-card .media-title {
    font-size: 0.875rem;
    line-height: 1.3;
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .media-card .media-meta {
    margin-bottom: 0;
  }
  
  .media-card .user-name {
    font-size: 0.75rem;
  }
  
  .media-card .media-stats {
    font-size: 0.75rem;
    gap: var(--spacing-sm);
  }
  
  .profile-info {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-lg);
  }
  
  .media-actions {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
  
  .action-btn {
    font-size: 0.75rem;
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .auth-container {
    padding: var(--spacing-md);
  }
  
  .auth-card {
    padding: var(--spacing-xl);
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Ultra-mobile media card optimizations */
  .media-card {
    height: 100px;
    margin-bottom: var(--spacing-xs);
  }
  
  .media-card .media-thumbnail {
    width: 120px;
    height: 100px;
  }
  
  .media-card .media-title {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    line-height: 1.2;
  }
  
  .media-card .user-name {
    font-size: 0.7rem;
  }
  
  .media-card .media-stats {
    font-size: 0.7rem;
  }
  
  .media-card .media-info {
    padding: var(--spacing-xs);
  }
  
  /* Compact grid for very small screens */
  .media-grid {
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-xs);
  }
  
  /* Performance optimizations for very small screens */
  .media-card:hover .media-image {
    transform: none; /* Disable hover effects on small screens */
  }
  
  .play-icon {
    font-size: 1.5rem; /* Smaller play icon */
  }
  
  /* Simplified overlay for small screens */
  .media-overlay {
    display: none; /* Hide overlay on small screens for cleaner look */
  }
  
  /* Watch Later page specific mobile optimizations */
  .youtube-watch-later-container {
    padding: var(--spacing-xs) !important;
  }
  
  .youtube-video-item {
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
    padding: var(--spacing-xs) !important;
  }
  
  .youtube-video-thumbnail {
    border-radius: var(--radius-xs);
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }

.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-xs); }
.p-2 { padding: var(--spacing-sm); }
.p-3 { padding: var(--spacing-md); }
.p-4 { padding: var(--spacing-lg); }
.p-5 { padding: var(--spacing-xl); }

.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--error-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-info { color: var(--info-color) !important; }

.bg-primary { background-color: var(--bg-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-light { background-color: var(--bg-tertiary) !important; }

.border-0 { border: none !important; }
.border { border: 1px solid var(--border-light) !important; }

.rounded { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for better accessibility */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus,
.btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.slide-in {
  animation: slideIn 0.3s ease forwards;
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar,
  .top-nav,
  .btn,
  .action-btn {
    display: none !important;
  }
  
  .main-wrapper {
    margin-left: 0 !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* ===== YOUTUBE-STYLE COMMENTS SYSTEM ===== */
.youtube-comments {
  margin-top: 24px;
  background: var(--bg-primary) !important;
  border-radius: 8px;
  padding: 20px;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.comments-count {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
}

.comments-sort button {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 20px;
  transition: all 0.2s ease;
}

.comments-sort button:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

/* YouTube Comment Form */
.youtube-comment-form {
  margin-bottom: 32px;
  background: var(--bg-primary);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.comment-input-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.user-avatar {
  flex-shrink: 0;
}

.input-section {
  flex: 1;
}

.youtube-comment-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border-medium);
  background: transparent;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

.youtube-comment-input:focus {
  outline: none;
  border-bottom-color: var(--text-primary);
  border-bottom-width: 2px;
}

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

.comment-form-actions {
  margin-top: 16px;
  padding-top: 8px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.comment-form-actions.show {
  opacity: 1;
  transform: translateY(0);
}

.form-actions-left .emoji-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.form-actions-left .emoji-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.comment-submit-btn {
  background: var(--primary-color) !important;
  color: white !important;
  border: none !important;
  padding: 10px 16px !important;
  border-radius: 18px !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
}

.comment-submit-btn:hover:not(:disabled) {
  background: var(--primary-hover) !important;
}

.comment-submit-btn:disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
}

/* YouTube Comments List */
.youtube-comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-primary);
  border-radius: 8px;
  overflow: hidden;
}

.youtube-comment {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.youtube-comment:last-child {
  border-bottom: none;
}

.comment-main {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.comment-avatar-section {
  flex-shrink: 0;
}

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

.comment-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.comment-avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
}

.comment-avatar-placeholder-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-author-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
}

.comment-timestamp {
  font-size: 12px;
  color: var(--text-secondary);
}

.comment-text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-wrap: break-word;
}

.comment-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.comment-action-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 8px 12px !important;
  border-radius: 18px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  text-decoration: none !important;
}

.comment-action-btn:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  text-decoration: none !important;
}

.comment-action-btn.liked {
  color: var(--primary-color) !important;
}

.comment-action-btn.disliked {
  color: var(--text-primary) !important;
}

.comment-action-btn i {
  font-size: 16px;
}

.like-count {
  font-size: 12px;
  color: var(--text-secondary);
  margin-right: 8px;
  min-width: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.like-count:not(:empty) {
  margin-left: -6px;
}

.reply-btn {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* YouTube Reply Form */
.youtube-reply-form {
  margin-left: 56px;
  margin-top: 16px;
}

.reply-input-container {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.reply-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* YouTube Replies */
.youtube-replies {
  margin-left: 56px;
  margin-top: 16px;
}

.show-replies-btn {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.show-replies-btn:hover {
  color: var(--primary-hover);
}

.show-replies-btn.expanded i {
  transform: rotate(180deg);
}

.show-replies-btn i {
  transition: transform 0.2s ease;
  font-size: 12px;
}

.replies-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.youtube-reply {
  position: relative;
}

.youtube-reply::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-light);
}

/* Responsive Design for Comments */
@media (max-width: 768px) {
  .comments-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .comment-input-container,
  .reply-input-container {
    gap: 12px;
  }
  
  .comment-main {
    gap: 12px;
  }
  
  .youtube-reply-form,
  .youtube-replies {
    margin-left: 36px;
  }
  
  .youtube-reply::before {
    left: -20px;
  }
  
  .comment-avatar {
    width: 32px;
    height: 32px;
  }
  
  .comment-avatar-placeholder {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .youtube-reply-form,
  .youtube-replies {
    margin-left: 24px;
  }
  
  .youtube-reply::before {
    left: -12px;
  }
  
  .comment-actions-bar {
    flex-wrap: wrap;
  }
}

/* Animation for new comments */
.youtube-comment.new-comment {
  animation: slideInComment 0.5s ease;
}

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

/* Theme-specific overrides for YouTube Comments */
[data-theme="dark"] .youtube-comments {
  background: #181818 !important;
  border: 1px solid #303030;
}

[data-theme="dark"] .youtube-comment-form {
  background: #181818 !important;
  border: 1px solid #303030;
}

[data-theme="dark"] .youtube-comments-list {
  background: #181818 !important;
}

[data-theme="dark"] .youtube-comment {
  background: #181818 !important;
  border-bottom-color: #303030;
}

[data-theme="dark"] .youtube-comment-input {
  background: transparent !important;
  color: #ffffff !important;
  border-bottom-color: #404040;
}

[data-theme="dark"] .youtube-comment-input:focus {
  border-bottom-color: #ffffff !important;
}

[data-theme="dark"] .youtube-comment-input::placeholder {
  color: #aaaaaa !important;
}

[data-theme="dark"] .comment-author-name {
  color: #ffffff !important;
}

[data-theme="dark"] .comment-text {
  color: #ffffff !important;
}

[data-theme="dark"] .comment-timestamp {
  color: #aaaaaa !important;
}

[data-theme="dark"] .comment-action-btn {
  color: #aaaaaa !important;
}

[data-theme="dark"] .comment-action-btn:hover {
  background: #303030 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .comments-count {
  color: #ffffff !important;
}

[data-theme="dark"] .comments-sort button {
  color: #aaaaaa !important;
}

[data-theme="dark"] .comments-sort button:hover {
  background: #303030 !important;
  color: #ffffff !important;
}

/* ===== YOUTUBE-STYLE RELATED VIDEOS SECTION ===== */

.youtube-related-content {
  background: transparent;
  padding: 0;
}

.related-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding: 0 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

.youtube-related-videos {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.youtube-related-video-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.youtube-related-video-item:hover {
  background-color: var(--bg-secondary);
}

/* Thumbnail Section */
.youtube-related-thumbnail {
  position: relative;
  width: 168px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.youtube-related-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-tertiary);
  transition: opacity 0.3s ease;
}

.youtube-related-thumb-img:not([src]),
.youtube-related-thumb-img[src=""] {
  opacity: 0;
}

.youtube-related-thumb-img[src]:not([src=""]) {
  opacity: 1;
}

.youtube-related-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--bg-secondary);
}

.youtube-related-thumb-placeholder.video {
  background: var(--primary-color);
  color: var(--text-on-primary);
}

.youtube-related-thumb-placeholder.document {
  background: var(--accent-color);
  color: var(--text-on-primary);
}

.youtube-related-thumb-placeholder i {
  font-size: 24px;
}

/* Media Type Badge */
.youtube-media-type-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

/* Video Duration */
.youtube-video-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Roboto Mono', monospace;
}

/* Video Details Section */
.youtube-related-details {
  flex: 1;
  padding: 4px 0;
  min-width: 0;
}

.youtube-related-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.youtube-related-channel {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-badge {
  color: #606060;
  font-size: 10px;
}

.youtube-related-stats {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.youtube-related-stats .separator {
  font-weight: bold;
}

/* Empty State */
.youtube-no-related {
  padding: 40px 20px;
  text-align: center;
}

.youtube-empty-state {
  color: var(--text-muted);
}

.youtube-empty-state i {
  margin-bottom: 12px;
  opacity: 0.5;
}

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

/* Hover Effects */
.youtube-related-video-item:hover .youtube-related-title {
  color: var(--primary-color);
}

.youtube-related-video-item:hover .youtube-related-thumbnail {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.youtube-related-video-item:hover .youtube-video-duration,
.youtube-related-video-item:hover .youtube-media-type-badge {
  background: rgba(0, 0, 0, 0.9);
}

/* Animation for smooth transitions */
.youtube-related-thumbnail {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.youtube-related-title {
  transition: color 0.2s ease;
}

/* Dark Theme Support */
[data-theme="dark"] .related-section-title {
  color: #ffffff;
  border-bottom-color: #404040;
}

[data-theme="dark"] .youtube-related-video-item:hover {
  background-color: #303030;
}

[data-theme="dark"] .youtube-related-title {
  color: #ffffff;
}

[data-theme="dark"] .youtube-related-channel {
  color: #aaaaaa;
}

[data-theme="dark"] .youtube-related-stats {
  color: #aaaaaa;
}

[data-theme="dark"] .youtube-related-thumb-placeholder {
  background: var(--bg-dark-secondary);
  border: 1px solid var(--bg-dark-tertiary);
}

[data-theme="dark"] .youtube-empty-state {
  color: #666666;
}

/* ===== DARK THEME SUPPORT FOR YOUTUBE ACTION BUTTONS ===== */

[data-theme="dark"] .youtube-action-btn {
  background: #272727;
  color: #ffffff;
}

[data-theme="dark"] .youtube-action-btn:hover {
  background: #3f3f3f;
}

[data-theme="dark"] .youtube-like-dislike-group {
  background: #272727;
}

[data-theme="dark"] .youtube-like-dislike-group:hover {
  background: #3f3f3f;
}

[data-theme="dark"] .button-separator {
  background: #404040;
}

[data-theme="dark"] .youtube-action-btn.like-btn.active {
  background: rgba(70, 155, 255, 0.2);
  color: #469bff;
}

[data-theme="dark"] .youtube-action-btn.dislike-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

[data-theme="dark"] .youtube-action-btn.watch-later-btn.active {
  background: rgba(70, 155, 255, 0.2);
  color: #469bff;
}

[data-theme="dark"] .youtube-stats-display {
  background: #272727;
  color: #aaaaaa;
}

[data-theme="dark"] .share-btn:hover,
[data-theme="dark"] .more-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .youtube-related-thumbnail {
    width: 140px;
    height: 79px;
  }
}

@media (max-width: 992px) {
  .youtube-related-video-item {
    flex-direction: column;
    gap: 12px;
  }
  
  .youtube-related-thumbnail {
    width: 100%;
    height: 180px;
  }
  
  .youtube-related-details {
    padding: 0;
  }
}

@media (max-width: 768px) {
  .youtube-related-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }
  
  .youtube-related-video-item {
    flex-direction: column;
  }
  
  .youtube-related-thumbnail {
    height: 160px;
  }
}

/* ===== MOBILE MEDIA ENHANCEMENTS ===== */
@media (max-width: 768px) {
  /* General mobile layout improvements */
  .container-fluid {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
  
  /* Mobile-optimized page titles */
  .page-title {
    font-size: 1.25rem;
  }
  
  /* Improved spacing for mobile content */
  .homepage-container,
  .dashboard-content,
  .upload-content {
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  /* Mobile search optimization */
  .search-container {
    margin: 0 var(--spacing-sm);
    max-width: none;
    flex: 1;
  }
  
  .search-input-group {
    height: 36px !important;
  }
  
  .search-input {
    font-size: 14px !important;
  }
  
  /* Mobile button optimizations */
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
    min-height: 36px;
  }
  
  .btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    min-height: 32px;
  }
  
  /* Mobile alert optimizations */
  .alert {
    padding: var(--spacing-sm);
    font-size: 0.875rem;
  }
}

/* ===== RESPONSIVE DESIGN FOR YOUTUBE ACTION BUTTONS ===== */

@media (max-width: 768px) {
  /* Mobile layout optimizations for media view */
  .media-view-content {
    padding: 0 !important; /* Remove padding to allow full-width video */
  }
  
  /* Add padding back for content below the video */
  .media-view-content .row {
    margin: 0 !important;
  }
  
  .media-view-content .col-lg-8 {
    padding: 0 !important; /* Remove padding for video container */
  }
  
  /* Add padding back for content after the video */
  .media-meta {
    margin: 0 1rem !important;
    padding-top: 1rem !important;
  }
  
  /* Mobile media card hover optimizations */
  .media-card:hover {
    transform: none; /* Disable transform on mobile for better performance */
    background-color: var(--bg-secondary);
  }
  
  .media-card:active {
    background-color: var(--bg-tertiary);
    transform: scale(0.98);
  }
  
  /* Optimize thumbnail loading on mobile */
  .media-card .media-image {
    object-fit: cover;
    width: 100%;
    height: 100%;
  }
  
  /* Better touch targets for mobile */
  .media-card {
    min-height: 44px; /* iOS guideline for touch targets */
    cursor: pointer;
  }
  
  .youtube-action-buttons {
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px !important;
    flex-wrap: nowrap !important; /* Prevent wrapping on mobile */
    /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
  }
  
  /* Fix layout for mobile - keep stats on same line, buttons on new line */
  .media-meta .d-flex.justify-content-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  
  /* Keep media stats on the same line */
  .media-meta .media-stats {
    display: flex !important;
    align-items: center !important;
    gap: var(--spacing-lg) !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }
  
  /* Ensure action buttons take full width on mobile and have proper spacing */
  .media-meta .youtube-action-buttons {
    width: 100% !important;
    justify-content: flex-start !important;
    margin-top: 4px !important;
  }
  
  /* Hide scrollbar for WebKit browsers */
  .youtube-action-buttons::-webkit-scrollbar {
    display: none !important;
  }
  
  .youtube-action-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
    min-height: 32px !important;
    flex-shrink: 0 !important; /* Prevent buttons from shrinking */
  }
  
  .youtube-action-btn .btn-text {
    display: none;
  }
  
  .youtube-action-btn.watch-later-btn .btn-text {
    display: none;
  }
  
  .youtube-like-dislike-group {
    flex-shrink: 0; /* Prevent group from shrinking */
  }
  
  .youtube-like-dislike-group .youtube-action-btn {
    min-width: 48px;
    padding: 8px 10px;
  }
  
  .youtube-stats-display {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  /* Optimize media stats for mobile */
  .media-meta .media-stats {
    font-size: 0.8rem !important;
    gap: 1rem !important;
  }
  
  .media-meta .media-stats span {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .youtube-action-buttons {
    /* Keep horizontal scroll behavior instead of trying to fit everything */
    gap: 8px;
    padding-bottom: 10px;
    /* Add scroll indicators on very small screens */
    position: relative;
  }
  
  /* Further optimize stats for very small screens */
  .media-meta .media-stats {
    font-size: 0.75rem !important;
    gap: 0.75rem !important;
  }
  
  .media-meta .media-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .media-meta .media-stats i {
    font-size: 0.7rem;
  }
  
  /* Add subtle scroll indicator */
  .youtube-action-buttons::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 10px;
    width: 20px;
    background: linear-gradient(to right, transparent, var(--bg-primary));
    pointer-events: none;
    opacity: 0.8;
  }
  
  .youtube-action-btn {
    padding: 8px 12px;
    min-width: auto;
    /* Ensure minimum touch target size */
    min-height: 36px;
  }
  
  .youtube-like-dislike-group {
    min-width: auto;
  }
  
  .youtube-like-dislike-group .youtube-action-btn {
    min-width: 44px; /* Minimum touch target */
  }
}

/* ===== YOUTUBE-STYLE VIDEO PLAYER ===== */

.youtube-video-player {
  position: relative;
  background: var(--bg-dark);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Loading Spinner */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: none;
}

.video-loading.show {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Play Button Overlay */
.play-button-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
  transition: opacity 0.3s ease;
}

.play-button-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.play-button-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  color: #000;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.play-button-large:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

/* Tap Zones for Mobile */
.tap-zones {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  z-index: 5;
  pointer-events: none;
}

.tap-zone {
  flex: 1;
  position: relative;
  pointer-events: auto;
  cursor: pointer;
}

.tap-zone.left-tap {
  background: linear-gradient(to right, rgba(0,0,0,0.1), transparent);
}

.tap-zone.right-tap {
  background: linear-gradient(to left, rgba(0,0,0,0.1), transparent);
}

.tap-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.tap-feedback.show {
  opacity: 1;
  animation: tapFeedback 0.6s ease;
}

@keyframes tapFeedback {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

/* Video Controls Overlay */
.video-controls-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.8) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 20;
  pointer-events: none;
}

.video-controls-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.top-controls {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.video-title-overlay {
  color: white;
  font-size: 18px;
  font-weight: 500;
  max-width: 70%;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.bottom-controls {
  padding: 10px 20px 20px;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 15px;
  height: 6px;
  cursor: pointer;
}

.progress-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  transition: height 0.2s ease;
}

.progress-container:hover .progress-bar {
  height: 6px;
}

.progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

.progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #ff0000;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

.progress-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #ff0000;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  left: 0%;
}

.progress-container:hover .progress-handle {
  opacity: 1;
}

/* Main Controls */
.main-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.left-controls,
.right-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn {
  background: none;
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  position: relative;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

.play-pause-btn {
  width: 48px;
  height: 48px;
  font-size: 20px;
}

.skip-btn {
  position: relative;
  font-size: 18px;
}

.skip-text {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 10px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.7);
  padding: 1px 3px;
  border-radius: 2px;
  line-height: 1;
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.volume-slider {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  opacity: 0;
}

.volume-control:hover .volume-slider {
  width: 60px;
  opacity: 1;
}

.volume-bar {
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
}

.volume-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  width: 100%;
}

.volume-handle {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(50%, -50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
}

/* Time Display */
.time-display {
  color: white;
  font-size: 14px;
  font-weight: 500;
  user-select: none;
  margin-left: 12px;
}

.time-separator {
  margin: 0 2px;
  opacity: 0.7;
}

/* Settings Dropdown */
.settings-dropdown {
  position: relative;
}

.settings-menu {
  position: absolute;
  bottom: 50px;
  right: 0;
  background: rgba(28, 28, 28, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 8px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 100;
}

.settings-dropdown.active .settings-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-item {
  margin-bottom: 12px;
}

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

.settings-item > span {
  color: white;
  font-size: 14px;
  font-weight: 500;
  display: block;
  margin-bottom: 8px;
}

.speed-options,
.quality-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.speed-option,
.quality-option {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.speed-option:hover,
.quality-option:hover {
  background: rgba(255, 255, 255, 0.2);
}

.speed-option.active,
.quality-option.active {
  background: #ff0000;
  border-color: #ff0000;
}

/* Mobile Controls */
.mobile-controls-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.8) 100%);
  display: none;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 25;
  pointer-events: none;
}

.mobile-controls-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.mobile-top-bar {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-control-btn {
  background: none;
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s ease;
}

.mobile-control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-title {
  color: white;
  font-size: 16px;
  font-weight: 500;
  flex: 1;
  line-height: 1.3;
}

.mobile-bottom-bar {
  padding: 15px 20px 25px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.mobile-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-time {
  color: white;
  font-size: 12px;
  font-weight: 500;
  min-width: 35px;
  text-align: center;
}

.mobile-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.mobile-progress-filled {
  height: 100%;
  background: #ff0000;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .video-controls-overlay {
    display: none;
  }
  
  .mobile-controls-overlay {
    display: flex;
  }
  
  .youtube-video-player {
    border-radius: 0 !important;
    aspect-ratio: 16/9 !important;
    /* Break out of container and occupy full width */
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  /* Apply same full-width treatment to image containers */
  .image-carousel-container {
    border-radius: 0 !important;
    /* Break out of container and occupy full width */
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  
  /* Apply same full-width treatment to document viewers */
  .document-viewer {
    border-radius: 0;
    /* Break out of container and occupy full width */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: 100vw;
    background: var(--bg-secondary);
    padding: 2rem 1rem;
  }
  
  /* Ensure the video wrapper also takes full width */
  .youtube-video-player .video-wrapper {
    width: 100%;
  }
  
  /* Ensure the video element takes full width */
  .youtube-video-player .main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .play-button-large {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }
  
  .tap-feedback {
    font-size: 20px;
  }
}

/* Fullscreen Styles */
.youtube-video-player:fullscreen {
  border-radius: 0;
  aspect-ratio: unset;
  height: 100vh;
  width: 100vw;
}

.youtube-video-player:-webkit-full-screen {
  border-radius: 0;
  aspect-ratio: unset;
  height: 100vh;
  width: 100vw;
}

.youtube-video-player:-moz-full-screen {
  border-radius: 0;
  aspect-ratio: unset;
  height: 100vh;
  width: 100vw;
}

/* Auto-hide controls */
.video-wrapper.playing .video-controls-overlay,
.video-wrapper.playing .mobile-controls-overlay {
  opacity: 0;
  pointer-events: none;
  transition-delay: 3s;
}

.video-wrapper.playing:hover .video-controls-overlay,
.video-wrapper.playing.show-controls .video-controls-overlay,
.video-wrapper.playing.show-controls .mobile-controls-overlay {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}

/* Control button states */
.control-btn.active {
  background: rgba(255, 255, 255, 0.3);
}

.autoplay-btn.active {
  color: #ff0000;
}

/* Keyboard focus styles */
.control-btn:focus,
.mobile-control-btn:focus {
  outline: 2px solid #ff0000;
  outline-offset: 2px;
}

/* PiP button hide on unsupported browsers */
.pip-btn.hidden {
  display: none;
}

/* ===== YOUTUBE-STYLE PROFILE PAGE ===== */

/* Profile Container */
.yt-profile-container {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  background: var(--bg-primary) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-md) !important;
  margin-bottom: 24px !important;
}

/* Cover Section */
.yt-profile-cover {
  position: relative !important;
  height: 160px !important;
  background: linear-gradient(135deg, 
    var(--primary-color) 0%, 
    var(--accent-color) 50%, 
    var(--secondary-color) 100%
  ) !important;
  overflow: hidden !important;
}

.yt-cover-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(160, 4, 60, 0.8) 0%, 
    rgba(0, 49, 81, 0.6) 50%, 
    rgba(193, 151, 120, 0.4) 100%
  );
}

.yt-cover-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 2px, transparent 2px);
  background-size: 30px 30px, 50px 50px;
  animation: float 20s infinite linear;
}

@keyframes float {
  0% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(-10px) translateY(-5px); }
  50% { transform: translateX(10px) translateY(-10px); }
  75% { transform: translateX(-5px) translateY(-15px); }
  100% { transform: translateX(0) translateY(0); }
}

/* Profile Info Section */
.yt-profile-info {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  position: relative;
}

.yt-profile-avatar-section {
  position: relative;
  margin-top: -60px;
}

.yt-profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--bg-primary);
  box-shadow: var(--shadow-lg);
  background: var(--bg-secondary);
}

.yt-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.yt-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-on-primary);
  background: var(--primary-color);
}

.yt-avatar-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--primary-color);
  opacity: 0.2;
  z-index: -1;
  animation: pulse-ring 3s infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.yt-profile-avatar:hover .yt-avatar-img {
  transform: scale(1.05);
}

/* Profile Details */
.yt-profile-details {
  flex: 1;
  min-width: 0;
}

.yt-profile-header {
  margin-bottom: 8px;
}

.yt-profile-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.yt-verified-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 50%;
  color: var(--text-inverse);
  font-size: 0.75rem;
}

.yt-profile-handle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 12px;
}

.yt-profile-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.yt-stat-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.yt-stat-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

.yt-stat-separator {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.yt-profile-description {
  line-height: 1.5;
}

.yt-description-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  white-space: pre-wrap;
}

.yt-description-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.yt-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.yt-meta-item i {
  color: var(--primary-color);
}

/* Profile Actions */
.yt-profile-actions {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.yt-action-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 18px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.yt-btn-primary {
  background: var(--text-primary);
  color: var(--text-inverse);
}

.yt-btn-primary:hover {
  background: var(--text-secondary);
  color: var(--text-inverse);
  transform: translateY(-1px);
}

.yt-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  padding: 9px 15px;
}

.yt-btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

/* Analytics Cards */
.yt-analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 0 24px 24px;
}

.yt-analytics-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.yt-analytics-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.yt-analytics-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-radius: 12px;
  color: var(--text-inverse);
  font-size: 1.25rem;
}

.yt-analytics-content {
  flex: 1;
}

.yt-analytics-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.yt-analytics-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Tab Navigation */
.yt-tab-navigation {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}

.yt-tab-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  padding: 0 24px;
}

.yt-tab-button {
  position: relative;
  padding: 16px 0;
  margin-right: 32px;
  background: none;
  border: none;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.yt-tab-button:hover {
  color: var(--text-primary);
}

.yt-tab-button.active {
  color: var(--text-primary);
}

.yt-tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.yt-tab-button.active .yt-tab-indicator {
  transform: scaleX(1);
}

/* Tab Content */
.yt-tab-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.yt-tab-pane {
  display: none;
}

.yt-tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Styling */
.yt-section {
  margin-bottom: 48px;
}

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

.yt-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.yt-section-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.yt-section-link:hover {
  color: var(--primary-hover);
}

/* Video Grid */
.yt-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.yt-video-card {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.yt-video-card:hover {
  transform: translateY(-4px);
}

.yt-video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  margin-bottom: 12px;
}

.yt-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.yt-thumbnail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  color: var(--text-muted);
  font-size: 2rem;
}

.yt-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.yt-video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-inverse);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.yt-media-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-inverse);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

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

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

.yt-video-actions {
  display: flex;
  gap: 8px;
}

.yt-action-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.875rem;
}

.yt-action-btn:hover {
  background: var(--text-inverse);
  transform: scale(1.1);
}

.yt-video-info {
  padding: 0 4px;
}

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

.yt-video-metadata {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.yt-views, .yt-timestamp {
  white-space: nowrap;
}

.yt-separator {
  color: var(--text-muted);
}

/* Video List View */
.yt-video-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.yt-video-list-item {
  display: flex;
  gap: 16px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.yt-video-list-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.yt-list-thumbnail {
  position: relative;
  width: 168px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.yt-list-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yt-list-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 1.5rem;
}

.yt-list-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-inverse);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
}

.yt-list-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

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

.yt-list-metadata {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.yt-list-type {
  background: var(--primary-color);
  color: var(--text-inverse);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.yt-list-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.yt-list-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}

/* Section Controls */
.yt-section-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.yt-filter-btn {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.yt-filter-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}

.yt-filter-btn.active {
  background: #a0043c !important;
  color: #ffffff !important;
  border-color: #a0043c !important;
  box-shadow: 0 4px 12px rgba(160, 4, 60, 0.2) !important;
}

/* Additional specificity for the filter buttons */
a.yt-filter-btn.active,
.yt-filter-container a.yt-filter-btn.active {
  background: #a0043c !important;
  color: #ffffff !important;
  border-color: #a0043c !important;
}

.yt-sort-dropdown {
  position: relative;
}

.yt-sort-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.yt-sort-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
}

.yt-sort-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.yt-sort-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.yt-sort-option {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.yt-sort-option:hover {
  background: var(--bg-secondary);
}

.yt-sort-option.active {
  background: var(--primary-color);
  color: var(--text-inverse);
}

/* Load More */
.yt-load-more {
  text-align: center;
  margin-top: 32px;
}

/* Empty States */
.yt-empty-state {
  text-align: center;
  padding: 64px 24px;
}

.yt-empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-size: 2rem;
}

.yt-empty-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

.yt-empty-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* About Tab Specific */
.yt-about-content {
  max-width: 800px;
}

.yt-about-section {
  margin-bottom: 32px;
}

.yt-about-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.yt-about-description {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.yt-no-description {
  color: var(--text-secondary);
  font-style: italic;
}

.yt-about-details {
  display: grid;
  gap: 32px;
}

.yt-detail-section {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border-light);
}

.yt-detail-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.yt-detail-grid {
  display: grid;
  gap: 16px;
}

.yt-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

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

.yt-detail-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.yt-detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

.yt-stats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yt-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.yt-stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.yt-stat-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .yt-profile-info {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .yt-profile-avatar-section {
    align-self: center;
    margin-top: -40px;
  }
  
  .yt-profile-avatar {
    width: 100px;
    height: 100px;
  }
  
  .yt-profile-name {
    font-size: 1.5rem;
    text-align: center;
  }
  
  .yt-profile-stats {
    justify-content: center;
  }
  
  .yt-profile-actions {
    justify-content: center;
  }
  
  .yt-analytics-cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    padding: 0 16px 16px;
  }
  
  .yt-tab-container {
    padding: 0 16px;
  }
  
  .yt-tab-button {
    margin-right: 24px;
  }
  
  .yt-tab-content {
    padding: 16px;
  }
  
  .yt-video-grid {
    grid-template-columns: 1fr;
  }
  
  .yt-list-thumbnail {
    width: 120px;
    height: 68px;
  }
  
  .yt-video-list-item {
    flex-direction: column;
    gap: 12px;
  }
  
  .yt-list-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .yt-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .yt-section-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* Department Cards Styling */
.department-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-left: 4px solid #A0043C; /* Default color, overridden inline */
  position: relative;
  backdrop-filter: blur(10px);
}

.department-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: var(--border-light);
}

.department-card .card-body {
  padding: 24px;
  background: linear-gradient(145deg, 
    rgba(255, 255, 255, 0.9) 0%, 
    rgba(248, 249, 250, 0.95) 100%);
  position: relative;
  z-index: 1;
  border-radius: 8px;
  margin: 4px;
}

/* Add subtle gradient overlay for better visual separation */
.department-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(0, 0, 0, 0.02) 50%,
    rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
  z-index: 0;
}

.department-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.department-card:hover .department-icon {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.department-icon i {
  font-size: 24px;
}

.department-stats .stat-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.department-stats .stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.specialization-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.specialization-tags .tag-link {
  text-decoration: none;
  transition: all 0.2s ease;
}

.specialization-tags .tag-link:hover {
  transform: translateY(-1px);
}

.specialization-tags .badge {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.specialization-tags .badge:hover {
  background-color: var(--primary-color) !important;
  color: white !important;
}

.department-actions .btn {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.department-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark theme adjustments for department cards */
[data-theme="dark"] .department-card,
.dark-theme .department-card {
  background: var(--bg-secondary);
  border-color: var(--border-dark);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .department-card:hover,
.dark-theme .department-card:hover {
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.4),
    0 4px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .department-card::before,
.dark-theme .department-card::before {
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.02) 0%, 
    rgba(0, 0, 0, 0.05) 50%,
    rgba(255, 255, 255, 0.02) 100%);
}

[data-theme="dark"] .department-card .card-body,
.dark-theme .department-card .card-body {
  background: linear-gradient(145deg, 
    rgba(40, 44, 52, 0.95) 0%, 
    rgba(33, 37, 43, 0.98) 100%);
}

/* Responsive adjustments for department cards */
@media (max-width: 768px) {
  .department-card .card-body {
    padding: 20px;
  }
  
  .department-icon {
    width: 50px;
    height: 50px;
  }
  
  .department-icon i {
    font-size: 20px;
  }
  
  .department-stats .stat-value {
    font-size: 20px;
  }
  
  .department-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .department-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== NOTIFICATION BADGE STYLES ===== */
.notification-badge {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.2s ease;
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

.notification-badge.show {
    animation-name: notificationBadgeShow;
}

.notification-badge.hide {
    animation-name: notificationBadgeHide;
}

/* Notification badge animations */
@keyframes notificationBadgeShow {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes notificationBadgeHide {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}

/* Pulsing effect for new notifications */
.notification-badge.pulse {
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Ensure badge is visible above other elements */
.nav-link.position-relative {
    z-index: 1;
}

.nav-link.position-relative .notification-badge {
    z-index: 2;
}

/* Dark theme adjustments for notification badge */
[data-theme="dark"] .notification-badge {
    border-color: var(--bg-dark-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ===== PROFILE PAGE SPECIFIC STYLES ===== */

/* Profile Header Card */
.profile-header-card {
    border: none;
    box-shadow: var(--shadow-medium);
    border-radius: 12px;
    overflow: hidden;
}

/* Profile Avatar Styles */
.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.profile-avatar-large:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-heavy);
}

.profile-avatar-placeholder-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    box-shadow: var(--shadow-medium);
    transition: all 0.3s ease;
}

.profile-avatar-placeholder-large:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-heavy);
}

/* Profile Badges */
.profile-badges .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.profile-actions .btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.profile-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Stat Cards */
.stat-card {
    border: none;
    box-shadow: var(--shadow-light);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.stat-card .card-body {
    padding: 1.5rem;
    position: relative;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Enhanced Media Cards for Profile */
.profile-media-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-light);
}

.profile-media-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.profile-media-card .card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* YouTube Dark Theme Card Styling */
[data-theme="dark"] .card {
    background: #212121 !important;
    border-color: #303030 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .card-body {
    background: #212121 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .card-header {
    background: #1a1a1a !important;
    border-color: #303030 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .stat-card {
    background: #212121 !important;
    border-color: #303030 !important;
}

[data-theme="dark"] .stat-card .card-body {
    background: #212121 !important;
}

[data-theme="dark"] .stat-card h3 {
    color: #ff0000 !important;
}

/* Content Filter Tabs */
.content-filter-tabs {
    padding: 0.5rem 0;
}

.filter-tab {
    border-radius: 20px !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-tab.active {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

[data-theme="dark"] .filter-tab {
    background: #303030 !important;
    border-color: #303030 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .filter-tab:hover:not(.active) {
    background: #404040 !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .filter-tab.active {
    background: #ff0000 !important;
    border-color: #ff0000 !important;
    color: white !important;
}

/* Enhanced Filter Tabs Styling */
.filter-tab {
    border: 2px solid #303030 !important;
    background: transparent !important;
    color: #aaaaaa !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    margin: 0 4px !important;
    transition: all 0.3s ease !important;
    font-weight: 500 !important;
    font-size: 14px !important;
}

.filter-tab:hover {
    border-color: #ff0000 !important;
    color: #ffffff !important;
    background: rgba(255, 0, 0, 0.1) !important;
    transform: translateY(-1px) !important;
}

.filter-tab.active {
    background: #ff0000 !important;
    border-color: #ff0000 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3) !important;
}

.filter-tab.active:hover {
    background: #cc0000 !important;
    border-color: #cc0000 !important;
}

/* Enhanced Media Item Animation and Filtering */
.media-item {
    transition: all 0.3s ease;
    transform-origin: center;
}

.media-item.hidden {
    opacity: 0 !important;
    transform: scale(0.9) !important;
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Grid reflow fix for Bootstrap columns */
#media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Mobile responsive grid */
@media (max-width: 768px) {
    #media-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 992px) {
    #media-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    #media-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

/* Dark Theme Support for Profile */
[data-theme="dark"] .profile-header-card {
    background: var(--bg-dark-secondary);
    border-color: var(--border-dark);
}

[data-theme="dark"] .profile-avatar-large,
[data-theme="dark"] .profile-avatar-placeholder-large {
    border-color: var(--primary-light);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-dark-secondary);
}

[data-theme="dark"] .stat-card h3 {
    color: var(--primary-light);
}

[data-theme="dark"] .profile-media-card {
    background: var(--bg-dark-secondary);
}

/* Responsive Profile Layout */
@media (max-width: 768px) {
    .profile-avatar-large,
    .profile-avatar-placeholder-large {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    
    .profile-actions {
        justify-content: center;
        margin-top: 1rem;
    }
    
    .profile-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .profile-header-card .card-body {
        text-align: center;
    }
    
    .profile-header-card .row {
        flex-direction: column;
        align-items: center;
    }
    
    .profile-badges {
        justify-content: center;
        margin-top: 1rem;
    }
}

/* ===== CONTACT INFORMATION STYLING ===== */
.contact-info-card {
    border: none;
    box-shadow: var(--shadow-medium);
    border-radius: 12px;
    overflow: hidden;
}

.contact-info-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    color: var(--text-on-primary);
    padding: 1rem 1.5rem;
}

.contact-info-card .card-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.contact-links,
.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item,
.social-item {
    transition: all 0.3s ease;
}

.contact-link,
.social-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-link:hover,
.social-link:hover {
    background: var(--primary-color);
    color: var(--text-on-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
    text-decoration: none;
}

.contact-link i,
.social-link i {
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-link:hover i,
.social-link:hover i {
    transform: scale(1.1);
}

.contact-link span,
.social-link span {
    flex: 1;
    font-weight: 500;
}

.social-link.website:hover {
    background: #17a2b8;
    border-color: #17a2b8;
}

.social-link.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.social-link.instagram:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: #e6683c;
}

.social-link.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.social-link.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

/* Dark Theme Contact Styling */
[data-theme="dark"] .contact-info-card {
    background: var(--bg-dark-secondary);
}

[data-theme="dark"] .contact-info-card .card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

[data-theme="dark"] .contact-section-title {
    color: var(--text-on-primary);
    border-color: var(--border-dark);
}

[data-theme="dark"] .contact-link,
[data-theme="dark"] .social-link {
    background: var(--bg-dark-tertiary);
    border-color: var(--border-dark);
    color: var(--text-inverse);
}

[data-theme="dark"] .contact-link:hover,
[data-theme="dark"] .social-link:hover {
    color: var(--text-on-primary);
}

/* Responsive Contact Information */
@media (max-width: 768px) {
    .contact-info-card .row > div {
        margin-bottom: 1.5rem;
    }
    
    .contact-links,
    .social-links {
        gap: 0.5rem;
    }
    
    .contact-link,
    .social-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .contact-info-card .card-header {
        padding: 0.75rem 1rem;
    }
    
    .contact-info-card .card-body {
        padding: 1rem;
    }
    
    .contact-section-title {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
}

/* ===== MORE OPTIONS MODAL STYLING ===== */
.more-options-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.more-options-modal.active {
    opacity: 1;
    visibility: visible;
}

.more-options-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.more-options-container {
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.more-options-modal.active .more-options-container {
    transform: scale(1) translateY(0);
}

.more-options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-on-primary);
}

.more-options-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.more-options-close {
    background: none;
    border: none;
    color: var(--text-on-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.more-options-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.more-options-content {
    padding: 0;
}

.more-options-list {
    display: flex;
    flex-direction: column;
}

.more-option-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.more-option-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.1), transparent);
    transition: left 0.6s ease;
}

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

.more-option-item:hover::before {
    left: 100%;
}

.more-option-item:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-on-primary);
    transform: translateX(4px) translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3);
    border-color: var(--primary-light);
}

.more-option-item:active {
    transform: translateX(4px) scale(0.98);
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.4);
}

.more-option-item i:first-child {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.more-option-item span {
    flex: 1;
    font-weight: 500;
}

.more-option-item i:last-child {
    opacity: 0.6;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    color: var(--primary-color);
}

.more-option-item:hover i:last-child {
    opacity: 1;
    transform: translateX(4px);
    color: var(--text-on-primary);
}

/* Dark Theme Support */
[data-theme="dark"] .more-options-container {
    background: var(--bg-dark-secondary);
}

[data-theme="dark"] .more-options-header {
    border-color: var(--border-dark);
}

[data-theme="dark"] .more-option-item {
    background: linear-gradient(135deg, var(--bg-dark-secondary), var(--bg-dark-tertiary));
    color: var(--text-inverse);
    border-color: var(--border-dark);
}

[data-theme="dark"] .more-option-item:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--text-on-primary);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .more-options-overlay {
        padding: 16px;
        align-items: flex-end;
    }
    
    .more-options-container {
        max-width: none;
        border-radius: 16px 16px 0 0;
        margin-bottom: 0;
    }
    
    .more-options-header {
        padding: 16px 20px;
    }
    
    .more-options-title {
        font-size: 1.1rem;
    }
    
    .more-option-item {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* ===== MOBILE BOTTOM NAVIGATION ===== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: none; /* Hidden by default, shown on mobile */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.bottom-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 500;
    min-width: 60px;
    transition: all 0.2s ease;
    border-radius: 12px;
    position: relative;
}

.bottom-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
}

.bottom-nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
    transition: transform 0.2s ease;
}

.bottom-nav-item:active i {
    transform: scale(0.9);
}

.bottom-nav-item span {
    font-size: 0.65rem;
    line-height: 1;
    margin-top: 2px;
}

/* Special styling for logout button */
.bottom-nav-item.logout {
    color: var(--error-color);
}

.bottom-nav-item.logout:hover {
    background: rgba(255, 51, 51, 0.1);
    color: var(--error-color);
}

/* Add bottom padding to main content when bottom nav is visible */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    .main-wrapper {
        padding-bottom: 80px; /* Add space for bottom nav */
    }
    
    /* Hide the mobile sidebar toggle when bottom nav is active */
    .sidebar-toggle.mobile-only {
        display: none;
    }
    
    /* Ensure sidebar is properly hidden on mobile when bottom nav is active */
    .sidebar {
        transform: translateX(-100%);
    }
}

/* Larger phones */
@media (max-width: 480px) {
    .bottom-nav-container {
        padding: 0 4px;
    }
    
    .bottom-nav-item {
        min-width: 50px;
        padding: 6px 2px;
    }
    
    .bottom-nav-item i {
        font-size: 1.1rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.6rem;
    }
}

/* Very small screens - hide text labels */
@media (max-width: 360px) {
    .bottom-nav-item span {
        display: none;
    }
    
    .bottom-nav-item {
        padding: 10px 4px;
    }
    
    .bottom-nav-item i {
        font-size: 1.3rem;
        margin-bottom: 0;
    }
}

/* Prevent bounce effect on iOS */
.mobile-bottom-nav {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.bottom-nav-item {
    -webkit-tap-highlight-color: transparent;
}

/* Animation for active state */
@keyframes bottomNavPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.bottom-nav-item.active i {
    animation: bottomNavPulse 0.3s ease;
}

/* Document Viewer Styles */
.document-viewer {
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    height: 100%;
}

/* Force the document viewer to expand to fill available space */
.document-viewer .pdf-viewer-container {
    width: 100%;
    height: 100%;
}

/* Ensure document viewer takes full space when inside video player container */
.youtube-video-player .document-viewer {
    height: 100%;
    min-height: 800px;
}

/* Make the entire video player container take more space for documents */
.col-lg-8 .youtube-video-player.has-document-viewer {
    margin-bottom: 0;
}

/* Ensure the main content column takes full height for documents */
.col-lg-8:has(.document-viewer) {
    min-height: calc(100vh - 120px);
}

/* Override aspect ratio for document viewers */
.youtube-video-player:has(.document-viewer),
.youtube-video-player.has-document-viewer {
    aspect-ratio: unset !important;
    height: calc(100vh - 120px) !important;
    min-height: 800px !important;
}

/* Specific override for PDF containers */
.youtube-video-player.has-document-viewer .pdf-viewer-container {
    height: 100% !important;
    min-height: 750px !important;
}

/* PDF Viewer */
.pdf-viewer-container {
    height: calc(100vh - 120px);
    min-height: 800px;
    display: flex;
    flex-direction: column;
}

.pdf-viewer-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdf-controls {
    display: flex;
    gap: 8px;
}

.pdf-control-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pdf-control-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.pdf-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.pdf-title {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.pdf-size {
    color: var(--text-muted);
    font-size: 12px;
}

.pdf-viewer-wrapper {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    min-height: 700px;
    height: 100%;
}

.pdf-viewer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: block;
}

/* Fullscreen styles */
.pdf-viewer-wrapper:fullscreen,
.pdf-viewer-wrapper:-webkit-full-screen,
.pdf-viewer-wrapper:-moz-full-screen,
.pdf-viewer-wrapper:-ms-fullscreen {
    background: #000;
    padding: 0;
    margin: 0;
    width: 100vw !important;
    height: 100vh !important;
}

.pdf-viewer-wrapper:fullscreen .pdf-viewer-iframe,
.pdf-viewer-wrapper:-webkit-full-screen .pdf-viewer-iframe,
.pdf-viewer-wrapper:-moz-full-screen .pdf-viewer-iframe,
.pdf-viewer-wrapper:-ms-fullscreen .pdf-viewer-iframe {
    width: 100vw;
    height: 100vh;
}

.pdf-fallback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
}

.pdf-fallback-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
}

.pdf-fallback-icon {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.pdf-fallback-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.pdf-loading-content {
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Office Document Viewer */
.office-doc-viewer {
    padding: 60px 40px;
    text-align: center;
}

.office-doc-preview {
    max-width: 400px;
    margin: 0 auto;
}

.office-doc-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.office-doc-icon.fa-file-word {
    color: #2b579a;
}

.office-doc-icon.fa-file-excel {
    color: #217346;
}

.office-doc-icon.fa-file-powerpoint {
    color: #d24726;
}

.office-doc-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Text File Viewer */
.text-file-viewer {
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.text-file-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.text-file-content {
    flex: 1;
    padding: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: var(--code-bg, #f8f9fa);
    color: var(--text-color);
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-loading {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.text-file-actions {
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* Generic Document Viewer */
.document-preview {
    padding: 60px 40px;
    text-align: center;
}

.document-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pdf-viewer-container {
        height: calc(100vh - 160px);
        min-height: 600px;
    }
    
    .youtube-video-player.has-document-viewer {
        height: calc(100vh - 160px);
        min-height: 600px;
    }
    
    .pdf-viewer-header {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
    }
    
    .pdf-info {
        align-items: center;
        text-align: center;
    }
    
    .pdf-control-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .office-doc-viewer,
    .document-preview {
        padding: 40px 20px;
    }
    
    .pdf-fallback-actions,
    .office-doc-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .text-file-viewer {
        max-height: calc(100vh - 200px);
    }
    
    .text-file-content {
        font-size: 12px;
        padding: 15px;
    }
}

/* Dark Theme Support for Document Viewers */
[data-theme="dark"] .document-viewer {
    background: var(--dark-card-bg);
    border-color: var(--dark-border);
}

[data-theme="dark"] .pdf-viewer-header {
    background: var(--dark-bg-secondary);
    border-bottom-color: var(--dark-border);
}

[data-theme="dark"] .pdf-title {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .pdf-size {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .pdf-viewer-wrapper {
    background: var(--dark-bg-primary);
}

[data-theme="dark"] .pdf-fallback {
    background: var(--dark-card-bg);
}

[data-theme="dark"] .pdf-loading {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .text-file-header {
    border-bottom-color: var(--dark-border);
}

[data-theme="dark"] .text-file-content {
    background: var(--dark-bg-secondary);
    color: var(--dark-text-primary);
}

[data-theme="dark"] .text-file-actions {
    border-top-color: var(--dark-border);
}