:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --light: #f8fafc;
  --dark: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --sidebar-width: 256px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(120, 41, 190, 0.1) 0%,
    rgba(53, 71, 125, 0.1) 50%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: -1;
  animation: backgroundShift 30s linear infinite;
}

@keyframes backgroundShift {
  0% {
    background: radial-gradient(
      circle at 50% 50%,
      rgba(120, 41, 190, 0.1) 0%,
      rgba(53, 71, 125, 0.1) 50%,
      rgba(0, 0, 0, 0) 100%
    );
  }
  33% {
    background: radial-gradient(
      circle at 30% 70%,
      rgba(233, 30, 99, 0.1) 0%,
      rgba(81, 45, 168, 0.1) 50%,
      rgba(0, 0, 0, 0) 100%
    );
  }
  66% {
    background: radial-gradient(
      circle at 70% 30%,
      rgba(76, 175, 80, 0.1) 0%,
      rgba(32, 119, 188, 0.1) 50%,
      rgba(0, 0, 0, 0) 100%
    );
  }
  100% {
    background: radial-gradient(
      circle at 50% 50%,
      rgba(120, 41, 190, 0.1) 0%,
      rgba(53, 71, 125, 0.1) 50%,
      rgba(0, 0, 0, 0) 100%
    );
  }
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  display: none;
}

.mobile-overlay.show {
  display: block;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: white;
  border-right: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.sidebar.hidden {
  transform: translateX(-100%);
}

@media (max-width: 767.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
}

.sidebar-search {
  padding: 0.75rem 1rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  overflow-y: auto;
}

.creativehub-logo h1 {
  font-family: "Poppins", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #2c3e50;
  margin: 0;
}

.creativehub-logo h1 span {
  color: #6366f1;
}

.creativehub-logo:hover h1 {
  color: #1f2d3d;
}

.creativehub-logo:hover h1 span {
  color: #3b82f6;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-link {
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  color: var(--dark);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-link:hover {
  background-color: var(--light);
  color: var(--dark);
}

.nav-item.active .nav-link {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.nav-link i {
  margin-right: 0.75rem;
  font-size: 1.125rem;
}

.submenu {
  margin-top: 0.25rem;
  margin-left: 1.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

.submenu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 16px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.submenu-link:hover {
  background-color: var(--light);
  color: var(--dark);
}

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

.avatar img {
  width: 32px;
  height: 32px;
}

/* Hero Card Styles */
.hero-card {
  position: relative;
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  color: white;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(30, 41, 59, 0.18);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(30, 30, 30, 0.55) 0%,
    rgba(30, 30, 30, 0.25) 100%
  );
  z-index: 1;
}

.hero-card > * {
  position: relative;
  z-index: 2;
}

.hero-card {
  background-image: url("https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=1600&q=80");
}
.apps-hero {
  background-image: url("https://images.unsplash.com/photo-1561070791-2526d30994b5?w=1600&q=80");
}
.files-hero {
  background-image: url("https://images.unsplash.com/photo-1614624532983-4ce03382d63d?w=1600&q=80");
}
.projects-hero {
  background-image: url("https://images.unsplash.com/photo-1531403009284-440f080d1e12?w=1600&q=80");
}
.learn-hero {
  background-image: url("https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=1600&q=80");
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: 0;
}

@media (max-width: 767.98px) {
  .main-content {
    margin-left: 0;
  }
}

.main-header {
  position: sticky;
  top: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Header avatar spacing */
.main-header .avatar {
  margin-left: 0.75rem;
}

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

.content-area {
  padding: 1.5rem;
}

@media (max-width: 767.98px) {
  .content-area {
    padding: 1rem;
  }
}

.btn {
  border-radius: 50px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-ghost {
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  color: var(--muted);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

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

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  z-index: 5;
}

.search-input {
  padding-left: 2.5rem;
  border-radius: 50px;
  background-color: var(--light);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background-color: white;
}

.notification-badge {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-tabs {
  display: flex;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 #f8fafc;
}

.custom-tabs .nav-item {
  flex: 0 0 auto;
  margin-right: 1.25rem;
}

.custom-tabs .nav-item:last-child {
  margin-right: 0;
}

.custom-tabs .nav-link {
  position: relative;
  overflow: hidden;
  transition: background 0.2s, color 0.2s, font-weight 0.2s;
}

.custom-tabs .nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1 0%, #3b82f6 100%);
  border-radius: 2px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.custom-tabs .nav-link:hover,
.custom-tabs .nav-link:focus {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.1);
}

.custom-tabs .nav-link:hover::after,
.custom-tabs .nav-link:focus::after {
  width: 80%;
  left: 10%;
}

/* Optional: Hide scrollbar for cleaner look */
.custom-tabs::-webkit-scrollbar {
  height: 4px;
  background: transparent;
}
.custom-tabs::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 2px;
}

.custom-card {
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

/* Progress Bars */
.progress {
  height: 8px;
  border-radius: 12px;
  background-color: var(--light);
}

.progress-bar {
  border-radius: 12px;
}

/* Badges */
.badge {
  border-radius: 12px;
  font-weight: 500;
}

.bg-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.hover-lift {
  transition: transform 0.2s ease;
}

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

/* Video Thumbnail */
.video-thumbnail {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button {
  position: absolute;
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.play-button:hover {
  background: white;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Template Cards */
.template-card {
  aspect-ratio: 16/9;
  border-radius: 16px;
  padding: 1.5rem;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.template-brand {
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
}
.template-marketing {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}
.template-website {
  background: linear-gradient(135deg, #10b981, #0d9488);
}
.template-product {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.backdrop-blur {
  backdrop-filter: blur(10px);
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.9) !important;
}

.bg-opacity-20 {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Custom Button Styles */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

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

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

.btn-light {
  background-color: white;
  border-color: white;
  color: var(--dark);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-light:hover {
  background-color: #f8f9fa;
  border-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-light {
  border-color: white;
  color: white;
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-outline-secondary {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-outline-secondary:hover {
  background-color: var(--secondary);
  color: white;
}

.btn-outline-secondary.active {
  background-color: var(--secondary);
  color: white;
}

@media (max-width: 767.98px) {
  .hero-card {
    padding: 1.5rem;
    text-align: center;
  }

  .hero-animation {
    display: none !important;
  }

  .custom-tabs {
    width: 100%;
  }

  .custom-tabs .nav-link {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Table Styles */
.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* List Group Styles */
.list-group-item {
  border: none;
  padding: 1rem;
  transition: background-color 0.2s ease;
}

.list-group-item:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Utility Classes */
.backdrop-blur {
  backdrop-filter: blur(10px);
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.9) !important;
}

.bg-opacity-20 {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Custom Button Styles */
.btn {
  border-radius: 50px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

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

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

.btn-light {
  background-color: white;
  border-color: white;
  color: var(--dark);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-light:hover {
  background-color: #f8f9fa;
  border-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-light {
  border-color: white;
  color: white;
}

.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn-outline-secondary {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-outline-secondary:hover {
  background-color: var(--secondary);
  color: white;
}

.btn-outline-secondary.active {
  background-color: var(--secondary);
  color: white;
}

.app-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: block;
}

/* Extra small devices (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .hero-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-card .btn {
    width: 100%;
  }

  .sidebar.show {
    width: 80%;
  }

  .main-header {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .main-header > .d-flex.align-items-center.gap-3 {
    gap: 0.25rem !important;
  }

  .btn-ghost {
    padding: 0.45rem 0.55rem;
  }
}

/* Table Responsiveness */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-tabs .nav-link.active {
  background: #6366f1;
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
  font-weight: 600;
}

.category-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .category-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
  }
  .search-box {
    width: 100%;
  }
}
