@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #ec4899;
  --dark: #0f172a;
  --sidebar-bg: #111827;
  --sidebar-color: #9ca3af;
  --sidebar-hover: #ffffff;
  --sidebar-active: #2563eb;
  --bg-light: #f3f4f6;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  
  --stat-blue: #3b82f6;
  --stat-purple: #8b5cf6;
  --stat-green: #10b981;
  --stat-orange: #f59e0b;
  --stat-red: #ef4444;
  --stat-teal: #14b8a6;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

body.public-page {
  background-color: #f8f9fa;
  color: #1f2937;
}

/* Typography */
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
a { text-decoration: none; }

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

/* Sidebar Layout & Responsive Architecture */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg, #0f172a);
  color: var(--sidebar-color, #e2e8f0);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
  white-space: nowrap;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  min-height: 64px;
}

.sidebar-menu {
  flex: 1;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 12px 8px;
  list-style: none;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  -webkit-overflow-scrolling: touch;
}

.sidebar-menu::-webkit-scrollbar {
  width: 5px;
}
.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: calc(100% - 260px);
  max-width: 100%;
}

.top-header {
  height: 70px;
  background: var(--card-bg, #ffffff);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 900;
}

.content-area {
  padding: 24px;
  flex: 1;
}

/* Sidebar Backdrop on Mobile/Tablet */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

/* Desktop Collapsed Rail Mode (>= 992px) */
@media (min-width: 992px) {
  .sidebar.collapsed {
    width: 76px !important;
  }
  .sidebar.collapsed .sidebar-header span,
  .sidebar.collapsed .sidebar-header .seller-badge,
  .sidebar.collapsed .sidebar-header .admin-badge,
  .sidebar.collapsed .sidebar-header .buyer-badge,
  .sidebar.collapsed .sidebar-close-btn,
  .sidebar.collapsed .sidebar-menu li.nav-item-hover > a > span,
  .sidebar.collapsed .sidebar-menu li.nav-item-hover > a > .badge,
  .sidebar.collapsed .sidebar-menu .has-arrow::after,
  .sidebar.collapsed .sidebar-menu .sub-menu,
  .sidebar.collapsed .sidebar-promo-card,
  .sidebar.collapsed .sidebar-verification-banner,
  .sidebar.collapsed .sidebar-footer a span {
    display: none !important;
  }
  .sidebar.collapsed .sidebar-menu li.nav-item-hover > a {
    justify-content: center !important;
    padding: 12px 0 !important;
    margin: 0 4px !important;
  }
  .sidebar.collapsed .sidebar-menu li.nav-item-hover > a i {
    margin-right: 0 !important;
    font-size: 1.25rem !important;
  }
  .sidebar.collapsed .sidebar-header {
    justify-content: center !important;
    padding: 16px 8px !important;
  }
  .sidebar.collapsed .sidebar-header img {
    margin-right: 0 !important;
  }
  .sidebar.collapsed .sidebar-footer {
    text-align: center !important;
    padding: 14px 0 !important;
  }
  .sidebar.collapsed .sidebar-footer a i {
    margin-right: 0 !important;
    font-size: 1.2rem;
  }
  .main-content.collapsed {
    margin-left: 76px !important;
    width: calc(100% - 76px) !important;
  }
}

/* Responsive Dashboard Media Queries (Tablet & Mobile < 992px) */
@media (max-width: 991.98px) {
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    z-index: 1050 !important;
    transform: translateX(-100%) !important;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.45) !important;
  }
  .sidebar.show {
    transform: translateX(0) !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .top-header {
    padding: 0 16px;
    height: 64px;
  }
  .top-header h5 {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .content-area {
    padding: 16px;
  }
}

/* Small Mobile Phones (< 576px) */
@media (max-width: 575.98px) {
  .sidebar {
    width: 88vw !important;
    max-width: 300px !important;
  }
  .top-header {
    padding: 0 12px;
    height: 58px;
  }
  .top-header h5 {
    font-size: 0.95rem !important;
    max-width: 130px;
  }
  .sidebar-toggle {
    width: 36px !important;
    height: 36px !important;
  }
  .content-area {
    padding: 12px 8px;
  }
}

/* Cards & Components */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  margin-bottom: 24px;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #f3f4f6;
  padding: 16px 20px;
  font-weight: 600;
}
.stat-card {
  padding: 24px;
  border-radius: 12px;
  color: white;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.stat-card h3 { font-size: 2rem; margin: 10px 0 0; font-weight: 700; }
.stat-card span { font-size: 0.9rem; opacity: 0.9; }
.stat-card i { position: absolute; right: -10px; bottom: -10px; font-size: 5rem; opacity: 0.2; }
.bg-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-purple { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bg-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }

/* Public Navbar */
.public-nav {
  background: #09090b; /* Very dark navy/black */
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.public-nav .nav-link { color: #cbd5e1; font-weight: 500; font-size: 0.95rem; margin: 0 5px; }
.public-nav .nav-link:hover, .public-nav .nav-link.active { color: #ffffff; }
.public-nav .nav-link.active { border-bottom: 2px solid #8b5cf6; padding-bottom: 6px; }

/* Public Hero */
.hero {
  padding: 100px 0;
  background: #09090b; /* Dark background matching navbar */
  color: white;
}
.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}
.hero .text-purple-gradient {
  background: linear-gradient(to right, #a855f7, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead { color: #cbd5e1; font-size: 1.1rem; }

/* Product Cards */
.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.product-card .cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}
.product-card .info { padding: 12px 15px; }
.product-card .title { font-weight: 700; color: #111827; margin-bottom: 2px; display: block; font-size: 0.95rem; }
.product-card .artist { color: #6b7280; font-size: 0.8rem; }
.product-card .duration { color: #9ca3af; font-size: 0.75rem; margin-top: 2px; }
.product-card .price { font-weight: 800; color: #111827; font-size: 1rem; }
.product-card .btn-cart { background: linear-gradient(135deg, #a855f7, #6366f1); color: white; border: none; padding: 6px 16px; border-radius: 6px; font-weight: 600; font-size: 0.8rem; }

.table-custom { width: 100%; margin-bottom: 0; }
.table-custom th { border-bottom: 2px solid #f3f4f6; color: var(--text-muted); font-weight: 600; padding: 12px 16px; }
.table-custom td { padding: 16px; vertical-align: middle; border-bottom: 1px solid #f3f4f6; }
.table-custom tr:last-child td { border-bottom: none; }

.badge-success { background: #dcfce7; color: #166534; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-warning { background: #fef9c3; color: #854d0e; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-danger { background: #fee2e2; color: #991b1b; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

/* Utilities */
.text-gradient { background: linear-gradient(to right, #4f46e5, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.bg-gradient-purple { background: linear-gradient(135deg, #a855f7, #6366f1) !important; color: white !important; }
.rounded-4 { border-radius: 1rem !important; }
.rounded-pill { border-radius: 50rem !important; }

/* Custom Homepage UI Styles */
.home-hero {
  background: url('https://images.unsplash.com/photo-1598387993281-cecf8b71a8f8?q=80&w=2000') center/cover no-repeat;
  position: relative;
  padding: 100px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(9,9,11,1) 0%, rgba(9,9,11,0.8) 50%, rgba(9,9,11,0.2) 100%);
}
.hero-btn {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
  padding: 12px 30px;
  border-radius: 50px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(168, 85, 247, 0.6);
  color: white;
}
.section-title {
  font-weight: 800;
  font-size: 1.25rem;
  color: #1f2937;
  display: flex;
  align-items: center;
}
.home-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
  transition: transform 0.2s, box-shadow 0.2s;
}
.home-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px -10px rgba(0,0,0,0.08);
}
.cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #f1f5f9;
}
.cover-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.home-card:hover .cover-container img {
  transform: scale(1.05);
}
.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transition: all 0.2s;
  cursor: pointer;
}
.cover-container:hover .play-btn {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.btn-add {
  background: #6366f1;
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}
.btn-add:hover { opacity: 0.9; }
.genre-pill {
  padding: 15px 25px;
  border-radius: 12px;
  color: white;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  flex: 1;
  transition: transform 0.2s;
}
.genre-pill:hover {
  transform: translateY(-3px);
  color: white;
}
.home-list-item {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: background 0.2s;
}
.home-list-item:last-child { border-bottom: none; }
.home-list-item:hover { background: #f8fafc; border-radius: 8px; }
.home-list-item .rank {
  width: 20px;
  text-align: center;
  font-weight: 700;
  color: #94a3b8;
  font-size: 0.85rem;
}
.promo-card {
  background: linear-gradient(135deg, #4f46e5, #a855f7);
  border-radius: 16px;
  padding: 30px 24px;
  color: white;
  height: 100%;
  position: relative;
  overflow: hidden;
}
.promo-card::after {
  content: '\F4B6'; /* bi-music-note */
  font-family: 'bootstrap-icons';
  position: absolute;
  right: -20px;
  bottom: -20px;
  font-size: 10rem;
  opacity: 0.1;
  line-height: 1;
}
.cursor-pointer { cursor: pointer; }

/* Page Hero Banners */
.page-hero {
  border-radius: 0;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  margin-left: -calc(var(--bs-gutter-x) * .5);
  margin-right: -calc(var(--bs-gutter-x) * .5);
  padding: 3rem;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 100 Q 50 50 100 100" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="2"/></svg>') repeat;
  opacity: 0.5;
}

.hero-icon {
  font-size: 4rem;
  background: -webkit-linear-gradient(#fbbf24, #d97706);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.hero-text {
  z-index: 2;
  position: relative;
}

.vibes-text {
  font-family: 'Brush Script MT', cursive;
  font-size: 2.5rem;
  transform: rotate(-5deg);
  color: rgba(255, 255, 255, 0.8);
  z-index: 2;
}

/* ============================================================
   RESPONSIVE DESIGN SYSTEM (HOME / ADMIN / SELLER / BUYER)
   Desktop (>= 992px), Tablet (768px - 991px), Mobile (< 768px)
   ============================================================ */

/* Universal Layout & Overflow Prevention */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

img, canvas, svg, video {
  max-width: 100%;
}

/* Universal Responsive Tables */
.table-responsive {
  width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table-custom {
  min-width: 600px;
}

/* Tablet Breakpoint (768px to 991.98px) */
@media (max-width: 991.98px) {
  /* Public Home & Navbar */
  .home-navbar {
    padding: 0.75rem 1.25rem !important;
  }
  .page-hero {
    padding: 2rem 1.5rem !important;
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  .page-hero .hero-icon, .page-hero .vibes-text {
    display: none;
  }
  .home-hero {
    padding: 60px 0 !important;
  }
  .home-hero h1 {
    font-size: 2.5rem !important;
  }

  /* Admin, Seller, Buyer Dashboards on Tablet */
  .admin-hero-banner,
  .seller-hero-banner,
  .buyer-hero-banner {
    padding: 1.5rem !important;
  }
  .dashboard-card {
    margin-bottom: 1rem;
  }
  .metric-card {
    padding: 1rem !important;
  }
  .metric-card h3 {
    font-size: 1.5rem !important;
  }
}

/* Mobile Breakpoint (<= 767.98px) */
@media (max-width: 767.98px) {
  /* Public Home on Mobile */
  .home-hero {
    padding: 35px 0 !important;
    text-align: center;
  }
  .home-hero h1 {
    font-size: 1.95rem !important;
    line-height: 1.25 !important;
  }
  .home-hero .hero-btn {
    width: 100%;
    text-align: center;
  }
  .home-navbar {
    padding: 0.6rem 0.85rem !important;
  }
  .genre-pill {
    padding: 10px 12px !important;
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
  }
  .genre-pill span {
    font-size: 0.76rem !important;
  }
  .genre-pill i {
    font-size: 1.2rem !important;
  }
  .service-highlight-card {
    padding: 1.25rem !important;
  }

  /* Global Dashboard Containers on Mobile (Admin, Seller, Buyer) */
  .content-area {
    padding: 12px 10px !important;
  }
  .top-header {
    padding: 0 12px !important;
    height: 58px !important;
  }
  .top-header h5 {
    font-size: 0.95rem !important;
    max-width: 140px;
  }

  /* Admin Dashboard on Mobile */
  .admin-hero-banner {
    padding: 1.25rem 1rem !important;
    border-radius: 14px !important;
  }
  .hero-avatar {
    width: 46px !important;
    height: 46px !important;
    font-size: 1.3rem !important;
  }
  .stat-pill {
    padding: 0.3rem 0.75rem !important;
    font-size: 0.72rem !important;
  }
  .metric-card {
    padding: 1rem !important;
  }
  .metric-card h3 {
    font-size: 1.4rem !important;
  }
  .metric-icon {
    font-size: 1.6rem !important;
  }
  .btn-quick-action {
    padding: 0.65rem 0.75rem !important;
    font-size: 0.75rem !important;
  }

  /* Seller Dashboard on Mobile */
  .seller-hero-banner {
    padding: 1.25rem 1rem !important;
    border-radius: 14px !important;
  }
  .creator-avatar {
    width: 48px !important;
    height: 48px !important;
  }
  .seller-stat-box {
    padding: 0.85rem !important;
  }
  .seller-stat-box h4 {
    font-size: 1.25rem !important;
  }

  /* Buyer Dashboard on Mobile */
  .buyer-hero-banner {
    padding: 1.25rem 1rem !important;
    border-radius: 14px !important;
  }
  .buyer-stat-card {
    padding: 0.85rem !important;
  }
  .buyer-stat-card h4 {
    font-size: 1.25rem !important;
  }

  /* Action Buttons & Button Groups on Mobile */
  .btn-group {
    display: inline-flex;
    flex-wrap: wrap;
  }
  .btn-sm {
    font-size: 0.78rem;
    padding: 0.35rem 0.65rem;
  }

  /* Compact Footer on Mobile */
  .home-footer {
    padding: 2rem 1rem 6rem 1rem !important;
  }
}

/* Small Phones Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .top-header h5 {
    max-width: 110px;
    font-size: 0.88rem !important;
  }
  .card-header {
    padding: 12px 14px !important;
  }
  .card-body {
    padding: 12px 14px !important;
  }
  .modal-dialog {
    margin: 0.5rem;
  }
}