/* Base Reset & Core Layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: calc(16px * var(--ui-scale, 1));
  overflow-x: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--deep-black);
  color: var(--soft-white);
  min-height: 100vh;
  overflow-x: hidden; /* ✅ Prevent horizontal scroll */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--deep-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--bantu-blue);
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* Animated Background */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.glow-cycle {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.1;
  animation: float 8s infinite ease-in-out;
}

.glow-1 {
  width: 400px;
  height: 400px;
  background: var(--glow-cycle-1);
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.glow-2 {
  width: 300px;
  height: 300px;
  background: var(--glow-cycle-2);
  top: 60%;
  right: 10%;
  animation-delay: 2s;
}

.glow-3 {
  width: 350px;
  height: 350px;
  background: var(--glow-cycle-3);
  bottom: 10%;
  left: 20%;
  animation-delay: 4s;
}

.glow-4 {
  width: 250px;
  height: 250px;
  background: var(--glow-cycle-4);
  top: 20%;
  right: 20%;
  animation-delay: 6s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 2;
  padding-bottom: 100px;
  overflow-x: hidden; /* ✅ Prevent horizontal scroll */
}

/* Header Base */
.header {
  background: rgba(10, 14, 18, 0.9);
  backdrop-filter: blur(20px);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  max-width: 100vw;
  overflow: visible;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--soft-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.25rem;
  margin-right: 0.5rem;
  border: none;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-0.125rem);
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.logo-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  background: linear-gradient(to right, var(--soft-white), var(--bantu-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.icon-btn {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--soft-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  font-size: 1rem;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-0.125rem);
}

.notification-badge {
  position: absolute;
  top: -0.3125rem;
  right: -0.3125rem;
  background: var(--error-color);
  color: white;
  font-size: 0.625rem;
  font-weight: bold;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--deep-black);
}

.profile-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 2.5rem !important;
  padding: 0.3125rem 1.2rem 0.3125rem 0.5rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  min-width: 160px !important;
  width: auto !important;
  height: 2.75rem !important;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: var(--warm-gold) !important;
}

.profile-placeholder {
  width: 2.25rem !important;
  height: 2.25rem !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: white !important;
  font-size: 0.875rem !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.profile-placeholder img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.profile-name {
  color: var(--soft-white) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: 180px !important;
  display: inline-block !important;
}

.profile-switcher {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  width: 280px;
  z-index: 1000;
  display: none;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.profile-dropdown.active {
  display: block;
  animation: dropdownFadeIn 0.2s ease;
}

.profile-dropdown-header {
  padding: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.profile-dropdown-header h4 {
  font-size: 0.875rem;
  color: var(--slate-grey);
  margin: 0;
}

.profile-list {
  max-height: 300px;
  overflow-y: auto;
}

.profile-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.profile-list-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.profile-list-item.active {
  background: rgba(29, 78, 216, 0.2);
  border-left: 3px solid var(--bantu-blue);
}

.profile-list-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.75rem;
  overflow: hidden;
  flex-shrink: 0;
}

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

.profile-list-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--soft-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-list-email {
  font-size: 0.75rem;
  color: var(--slate-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--card-border);
}

.rsa-badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #007A4D, #FFB81C, #E03C31);
  padding: 0.375rem 0.75rem;
  border-radius: 1.875rem;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Category Tabs Container */
.category-tabs-container {
  background: rgba(10, 14, 18, 0.9);
  backdrop-filter: blur(20px);
  padding: 15px 20px;
  position: sticky;
  top: 60px;
  z-index: 99;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 1px solid var(--card-border);
  scrollbar-width: thin;
  scrollbar-color: var(--bantu-blue) var(--deep-navy);
}

.category-tabs-container::-webkit-scrollbar {
  height: 4px;
}

.category-tabs-container::-webkit-scrollbar-track {
  background: var(--deep-navy);
}

.category-tabs-container::-webkit-scrollbar-thumb {
  background: var(--bantu-blue);
  border-radius: 4px;
}

.category-tabs {
  display: inline-flex;
  gap: 8px;
}

.category-tab {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--slate-grey);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 100px;
  text-align: center;
}

.category-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--warm-gold);
  color: var(--soft-white);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
  border-color: transparent;
  color: var(--soft-white);
  box-shadow: 0 4px 15px rgba(29, 78, 216, 0.4);
}

/* Hero Section */
.hero {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px;
  margin: 30px 0;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--bantu-blue), var(--warm-gold));
  border-radius: 26px;
  z-index: -1;
  opacity: 0.1;
}

.hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  margin-bottom: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--soft-white), var(--warm-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: rgba(248, 250, 252, 0.8);
  margin-bottom: 25px;
  font-size: 18px;
}

.hero-btn {
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
  color: var(--soft-white);
  border: none;
  padding: 15px 30px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(29, 78, 216, 0.4);
}

/* Content Sections Base */
.section {
  margin-bottom: 40px;
}

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

.section-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--soft-white), var(--warm-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.see-all-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--warm-gold);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.see-all-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--warm-gold);
}

/* Content Grid Layout */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* Content Card Detailed Styling */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(10px);
  position: relative;
}

.content-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(245, 158, 11, 0.3);
}

.card-thumbnail {
  position: relative;
  height: 140px;
  overflow: hidden;
}

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

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

.thumbnail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.play-icon {
  width: 50px;
  height: 50px;
  background: rgba(245, 158, 11, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--deep-black);
  font-size: 1.5rem;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.content-card:hover .play-icon {
  transform: scale(1);
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.card-badge {
  padding: 4px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  color: var(--soft-white);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.badge-trending {
  background: rgba(245, 158, 11, 0.9);
}

.badge-new {
  background: rgba(29, 78, 216, 0.9);
}

.card-badge.badge-duration {
  background: rgba(0, 0, 0, 0.7);
  color: var(--soft-white);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.card-content {
  padding: 15px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  color: var(--soft-white);
  line-height: 1.4;
}

.creator-btn {
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
  color: var(--soft-white);
  border: none;
  padding: 8px 15px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.creator-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4);
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--slate-grey);
  margin-top: 5px;
}

.card-rating i {
  font-size: 10px;
}

.card-stats {
  display: flex;
  gap: 15px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--slate-grey);
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-stat i {
  color: var(--bantu-blue);
  font-size: 12px;
}

/* Skeleton Loading States */
.skeleton-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-thumbnail {
  height: 140px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.05) 25%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
}

.skeleton-title {
  height: 20px;
  width: 80%;
  margin: 15px 15px 10px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.05) 25%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-creator {
  height: 16px;
  width: 60%;
  margin: 0 15px 10px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.05) 25%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-stats {
  height: 14px;
  width: 40%;
  margin: 0 15px 15px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.05) 25%, 
    rgba(255,255,255,0.1) 50%, 
    rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.8; }
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--slate-grey);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 20px;
  color: var(--warm-gold);
  opacity: 0.5;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 15px 25px;
  border-radius: 12px;
  color: var(--soft-white);
  font-weight: 500;
  animation: slideIn 0.3s ease;
  max-width: 300px;
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.toast i {
  font-size: 18px;
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
}

.toast.success {
  background: rgba(16, 185, 129, 0.9);
}

.toast.warning {
  background: rgba(245, 158, 11, 0.9);
}

.toast.info {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
}

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

/* Footer Base */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  padding: 30px 20px;
  margin-top: 50px;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
}

.footer p {
  text-align: center;
  color: var(--slate-grey);
  margin-bottom: 15px;
  font-size: 14px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--slate-grey);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 14px;
}

.footer-links a:hover {
  color: var(--warm-gold);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
  color: var(--soft-white);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 99;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(29, 78, 216, 0.4);
}

/* Sidebar Menu */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-menu {
  position: fixed;
  top: 0;
  left: -20rem;
  width: 18rem;
  height: 100vh;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--card-border);
  z-index: 1001;
  transition: left 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.25rem;
}

.sidebar-menu.active {
  left: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 1.25rem;
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.sidebar-logo-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--soft-white), var(--bantu-blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-close {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  color: var(--soft-white);
  cursor: pointer;
  transition: all 0.3s ease;
}

.sidebar-close:hover {
  background: var(--error-color);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  cursor: pointer;
  transition: background 0.3s ease;
  flex-shrink: 0;
  min-width: 0;
}

.sidebar-profile:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-profile-avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

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

.sidebar-profile-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-profile-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--soft-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-email {
  font-size: 0.75rem;
  color: var(--slate-grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--warm-gold);
  border-radius: 3px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  color: var(--soft-white);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(0.25rem);
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, var(--bantu-blue), var(--warm-gold));
}

.sidebar-nav-item i {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-nav-item .badge {
  margin-left: auto;
  background: var(--error-color);
  color: white;
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
  border-radius: 0.625rem;
  flex-shrink: 0;
}

.sidebar-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--card-border);
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.3s ease;
  margin-bottom: 0.75rem;
}

.sidebar-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-scale-control {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.scale-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.scale-control-row:last-child {
  margin-bottom: 0;
}

.scale-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--soft-white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  flex-shrink: 0;
  font-size: 0.875rem;
  padding: 0;
  white-space: nowrap;
}

.scale-control-row:last-child .scale-btn {
  width: 100%;
  border-radius: 0.5rem;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.5rem;
  height: auto;
  min-height: 2.5rem;
}

.scale-value {
  font-size: 0.875rem;
  color: var(--soft-white);
  min-width: 3rem;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================ */
/* 🎯 NAVIGATION BUTTON - CENTERED & MOBILE FIXES */
/* ============================================ */
.navigation-button-container {
  position: fixed;
  bottom: 15px;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom);
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.navigation-button {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 60px;
  padding: 10px 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  gap: 12px;
  width: auto;
  min-width: 280px;
  max-width: 420px;
  margin: 0 auto;
  pointer-events: auto;
  overflow: visible;
}

.nav-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--soft-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}

.nav-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.nav-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--error-color);
  color: white;
  font-size: 10px;
  font-weight: bold;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--deep-black);
}

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

/* ============================================ */
/* 🎯 MOBILE FIXES - Content Library Page Only */
/* ============================================ */

/* ✅ Prevent horizontal scrolling on mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  
  .container {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  
  /* ✅ Header: Compact size, hide profile dropdown entirely */
  .header {
    padding: 0.5rem 1rem !important;
    min-height: 3rem !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  
  .menu-toggle {
    width: 2rem !important;
    height: 2rem !important;
    margin-right: 0.375rem !important;
  }
  
  .logo-icon {
    width: 1.75rem !important;
    height: 1.75rem !important;
  }
  
  .logo-text {
    font-size: 0.75rem !important;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* ✅ HIDE profile switcher entirely on mobile (no dropdown) */
  .profile-switcher {
    display: none !important;
  }
  
  /* Hide analytics button on mobile */
  #analytics-btn {
    display: none !important;
  }
  
  /* Ensure header actions wrap and stay within bounds */
  .header-actions {
    flex-wrap: nowrap !important;
    gap: 0.375rem !important;
    justify-content: flex-end !important;
  }
  
  .icon-btn {
    width: 2rem !important;
    height: 2rem !important;
    font-size: 0.8125rem !important;
    flex-shrink: 0 !important;
  }
  
  /* Keep RSA badge visible but compact */
  .rsa-badge {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.6875rem !important;
    margin-left: 0.25rem !important;
  }
  
  /* ✅ Navigation Button: Centered, proper sizing, no overflow */
  .navigation-button-container {
    bottom: 12px !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  .navigation-button {
    min-width: 260px !important;
    max-width: 380px !important;
    padding: 8px 16px !important;
    gap: 10px !important;
    margin: 0 auto !important;
  }
  
  .nav-icon {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
  
  /* Content grid adjustments */
  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 12px !important;
  }
  
  .card-thumbnail {
    height: 110px !important;
  }
  
  /* Sidebar mobile width */
  .sidebar-menu {
    width: 16rem !important;
  }
  
  /* Category tabs adjustments */
  .category-tabs-container {
    padding: 10px 12px !important;
    top: 48px !important;
  }
  
  .category-tab {
    padding: 8px 14px !important;
    font-size: 12px !important;
    min-width: 80px !important;
  }
}

/* Small mobile devices - further adjustments */
@media (max-width: 480px) {
  .header {
    padding: 0.4rem 0.75rem !important;
    min-height: 2.75rem !important;
  }
  
  .menu-toggle {
    width: 1.875rem !important;
    height: 1.875rem !important;
  }
  
  .logo-icon {
    width: 1.5rem !important;
    height: 1.5rem !important;
  }
  
  .logo-text {
    font-size: 0.6875rem !important;
    max-width: 90px;
  }
  
  .icon-btn {
    width: 1.875rem !important;
    height: 1.875rem !important;
    font-size: 0.75rem !important;
  }
  
  .header-actions {
    gap: 0.25rem !important;
  }
  
  .rsa-badge {
    font-size: 0.5625rem !important;
    padding: 0.125rem 0.375rem !important;
  }
  
  /* ✅ Navigation Button: Even smaller screens */
  .navigation-button-container {
    bottom: 10px !important;
  }
  
  .navigation-button {
    min-width: 240px !important;
    max-width: 340px !important;
    padding: 6px 12px !important;
    gap: 8px !important;
  }
  
  .nav-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
  }
  
  .content-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  
  .card-thumbnail {
    height: 90px !important;
  }
  
  .card-title {
    font-size: 13px !important;
  }
  
  .creator-btn {
    padding: 6px 10px !important;
    font-size: 10px !important;
  }
}

/* Ultra-small screens */
@media (max-width: 360px) {
  .header {
    padding: 0.375rem 0.625rem !important;
    min-height: 2.625rem !important;
  }
  
  .logo-text {
    font-size: 0.625rem !important;
    max-width: 80px;
  }
  
  .icon-btn {
    width: 1.75rem !important;
    height: 1.75rem !important;
    font-size: 0.6875rem !important;
  }
  
  .navigation-button {
    min-width: 220px !important;
    max-width: 300px !important;
    gap: 6px !important;
  }
  
  .nav-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 14px !important;
  }
  
  .rsa-badge {
    font-size: 0.5rem !important;
    padding: 0.125rem 0.25rem !important;
  }
  
  .card-thumbnail {
    height: 80px !important;
  }
}

/* Accessibility & Touch Targets */
@media (hover: none) and (pointer: coarse) {
  .icon-btn, .profile-btn, .nav-icon {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  
  .header, .navigation-button {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
}
