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

:root {
  --primary-color: #8B5CF6;
  --primary-gradient: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  --bg-color: #050505;
  --sidebar-bg: #000000;
  --surface-color: #0F1116;
  --border-color: #2D3039;
  --text-main: #FFFFFF;
  --text-secondary: #9CA3AF;

  --youtube: #FF0000;
  --tiktok: #FFFFFF;
  --instagram: #E1306C;
  --twitch: #9146FF;

  --radius-xl: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* --- Layout --- */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem 3rem;
}

/* --- Header & Title --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.page-title-section {
  margin-bottom: 2.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.page-title {
  font-size: 1.5rem;
  /* Larger title */
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

/* --- Sidebar --- */
.sidebar {
  width: 260px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  z-index: 100;
  border-right: 1px solid var(--border-color);
}

/* Logo */
.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 3rem;
  padding-left: 0.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  color: white;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: white;
}

.logo-subtitle {
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 2px;
  color: #6B7280;
  text-transform: uppercase;
}

/* Nav */
.nav-links {
  margin-top: 1rem;
  list-style: none;
  padding: 0;
}

.nav-links li {
  margin-bottom: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 0.85rem 1.25rem;
  color: #9CA3AF;
  font-weight: 500;
  border-radius: var(--radius-xl);
  transition: all 0.2s;
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary-color);
  box-shadow: none;
  font-weight: 600;
}

.nav-link-icon {
  margin-right: 12px;
  font-size: 20px;
}

/* Submenu */
.nav-group .nav-submenu {
  list-style: none;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-group.open .nav-submenu {
  max-height: 200px;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-sublink {
  padding: 0.6rem 1.25rem 0.6rem 3.25rem !important;
  font-size: 0.825rem !important;
}

.nav-sublink .nav-link-icon {
  margin-right: 10px;
}

/* --- Forms & Search --- */
.search-bar {
  background: #13151b;
  /* Darker/Specific bg */
  border: 1px solid #2D3039;
  border-radius: 99px;
  padding: 0.6rem 1.25rem;
  /* Larger padding */
  width: 400px;
  /* Wider */
  display: flex;
  align-items: center;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #E5E7EB;
  margin-left: 10px;
  width: 100%;
  font-size: 0.9rem;
}

.form-control {
  background: #13151b;
  border: 1px solid #2D3039;
  color: #E5E7EB;
  border-radius: 8px;
  /* Slightly more rounded */
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* --- Unified Button Design System --- */

/* Button Design Tokens */
:root {
  /* Button Colors */
  --btn-primary-bg: #7C3AED;
  --btn-primary-hover: #6D28D9;
  --btn-secondary-bg: rgba(124, 58, 237, 0.08);
  --btn-secondary-hover: rgba(124, 58, 237, 0.15);
  --btn-secondary-border: rgba(124, 58, 237, 0.15);
  --btn-icon-bg: rgba(0, 0, 0, 0.6);
  --btn-icon-hover: rgba(124, 58, 237, 0.8);
  --btn-destructive-bg: #EF4444;
  --btn-destructive-hover: #DC2626;

  /* Button Sizing */
  --btn-padding-sm: 6px 16px;
  --btn-padding-md: 8px 20px;
  --btn-padding-lg: 10px 24px;
  --btn-icon-size: 36px;
  --btn-icon-sm: 28px;

  /* Button Typography */
  --btn-font-sm: 0.75rem;
  --btn-font-md: 0.8rem;
  --btn-font-lg: 0.9rem;

  /* Button Radius */
  --btn-radius: 12px;
  --btn-radius-sm: 8px;
  --btn-radius-pill: 20px;
  --btn-radius-circle: 50%;

  /* Button Effects */
  --btn-transition: all 0.2s ease;
  --btn-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
  --btn-shadow-hover: 0 6px 16px rgba(124, 58, 237, 0.4);
}

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--btn-transition);
  border: none;
  font-family: inherit;
  text-decoration: none;
  justify-content: center;
}

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

/* Primary Button */
.btn-primary {
  padding: var(--btn-padding-md);
  background: var(--btn-primary-bg);
  color: white;
  border-radius: var(--btn-radius);
  font-size: var(--btn-font-md);
  box-shadow: var(--btn-shadow);
}

.btn-primary:hover {
  background: var(--btn-primary-hover);
  transform: scale(1.02);
  box-shadow: var(--btn-shadow-hover);
}

/* Secondary Button */
.btn-secondary {
  padding: var(--btn-padding-sm);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--btn-secondary-border);
  color: var(--primary-color);
  border-radius: var(--btn-radius);
  font-size: var(--btn-font-sm);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: rgba(124, 58, 237, 0.3);
  transform: scale(1.02);
}

/* Tertiary/Text Button */
.btn-tertiary {
  padding: 0;
  background: transparent;
  color: var(--primary-color);
  font-size: var(--btn-font-sm);
}

.btn-tertiary:hover {
  text-decoration: underline;
  opacity: 1;
}

/* Icon-Only Button */
.btn-icon {
  width: var(--btn-icon-size);
  height: var(--btn-icon-size);
  padding: 0;
  background: var(--btn-icon-bg);
  color: white;
  border-radius: var(--btn-radius-circle);
}

.btn-icon:hover {
  background: var(--btn-icon-hover);
  transform: scale(1.1);
}

.btn-icon-sm {
  width: var(--btn-icon-sm);
  height: var(--btn-icon-sm);
}

/* Destructive Button */
.btn-destructive {
  background: var(--btn-destructive-bg);
  color: white;
}

.btn-destructive:hover {
  background: var(--btn-destructive-hover);
  transform: scale(1.02);
}

/* Button Sizes */
.btn-sm {
  padding: var(--btn-padding-sm);
  font-size: var(--btn-font-sm);
}

.btn-lg {
  padding: var(--btn-padding-lg);
  font-size: var(--btn-font-lg);
}

/* Legacy Support - Keeping for backward compatibility */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.btn-outline:hover {
  border-color: #4B5563;
}

/* --- Directory Table Refined --- */
.directory-container {
  background: #0B0D11;
  border-radius: 16px;
  /* Larger radius */
  border: 1px solid #2D3039;
  overflow: hidden;
  margin-top: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.table-row-header {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1.5fr 1fr 0.5fr;
  padding: 1.25rem 1.5rem;
  /* Larger padding */
  border-bottom: 1px solid #2D3039;
  color: #9CA3AF;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: #0E1015;
}

.table-row-item {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 1.5fr 1fr 0.5fr;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
  transition: background 0.1s;
}

.table-row-item:hover {
  background: #13161C;
}

.table-row-item.active-row {
  background: rgba(139, 92, 246, 0.1);
  border-left: 2px solid var(--primary-color);
}

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

/* Columns */
.col-creator {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.creator-text h6 {
  font-size: 0.95rem;
  font-weight: 600;
  color: inherit;
  /* Inherit from link */
  margin-bottom: 2px;
  -webkit-margin-after: 2px;
}

.creator-link {
  text-decoration: none;
  color: #9CA3AF;
  /* Match nav-link default */
  transition: color 0.2s;
}

.creator-link:hover {
  color: #FFFFFF;
  /* Match nav-link hover */
}

.creator-handle {
  font-size: 0.8rem;
  color: #6B7280;
}

.col-platform {
  display: flex;
  align-items: center;
}

.platform-pill {
  padding: 6px 12px;
  border-radius: 8px;
  /* Slightly more rounded */
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Space for icon */
  border: 1px solid transparent;
}

.pill-youtube {
  background: rgba(255, 68, 68, 0.1);
  color: #FF4444;
  border-color: rgba(255, 68, 68, 0.2);
}

.pill-tiktok {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
}

.pill-instagram {
  background: rgba(225, 48, 108, 0.1);
  color: #E1306C;
  border-color: rgba(225, 48, 108, 0.2);
}

.pill-twitch {
  background: rgba(145, 70, 255, 0.1);
  color: #9146FF;
  border-color: rgba(145, 70, 255, 0.2);
}

.pill-x {
  background: rgba(29, 155, 240, 0.1);
  color: #1D9BF0;
  border-color: rgba(29, 155, 240, 0.2);
}

.col-followers {
  font-weight: 600;
  font-size: 0.9rem;
}

.col-engagement {
  padding-right: 2rem;
}

.engage-bar-bg {
  height: 6px;
  background: #2D3039;
  border-radius: 3px;
  position: relative;
  width: 100%;
  margin-top: 6px;
}

.engage-bar-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  position: absolute;
  left: 0;
  top: 0;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.engage-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #D1D5DB;
  margin-bottom: 2px;
}

.col-category {
  color: #D1D5DB;
  font-size: 0.85rem;
}

.col-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.action-icon {
  color: #6B7280;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s;
}

.action-icon:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* --- DataTables Dark Overrides --- */
/* Base Text */
table.dataTable tbody tr {
  background-color: transparent !important;
}

table.dataTable {
  color: #9CA3AF !important;
  border-collapse: collapse !important;
}

table.dataTable thead th {
  border-bottom: 1px solid #2D3039 !important;
  color: #9CA3AF;
  padding: 1rem !important;
}

table.dataTable tbody td {
  padding: 1rem !important;
  border-bottom: 1px solid #2D3039 !important;
}

/* Search Input & Length Select */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  background-color: #13161C !important;
  border: 1px solid #2D3039 !important;
  color: #E5E7EB !important;
  border-radius: 8px !important;
  padding: 0.4rem 0.8rem !important;
  outline: none !important;
}

/* Info & Pagination */
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  color: #9CA3AF !important;
  padding-top: 1rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #9CA3AF !important;
  border: none !important;
  /* Remove borders */
  border-radius: 4px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--primary-color) !important;
  color: white !important;
  border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  border: none !important;
}

/* Remove default stripe */
table.dataTable.display tbody tr.odd>.sorting_1,
table.dataTable.order-column.stripe tbody tr.odd>.sorting_1 {
  background-color: transparent !important;
}

table.dataTable.display tbody tr.even>.sorting_1,
table.dataTable.order-column.stripe tbody tr.even>.sorting_1 {
  background-color: transparent !important;
}

table.dataTable.display tbody tr:hover>.sorting_1,
table.dataTable.display tbody tr:hover {
  background-color: #13161C !important;
}

/* --- Creator Page: Profile Card Design --- */
.profile-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

.profile-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  overflow: hidden;
  /* This is key, but inner content needs to respect it */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  /* Ensure vertical stacking */
  width: 100%;
  /* Ensure it takes full width of wrapper */
}

.profile-card-body {
  padding: 80px 40px 40px;
  width: 100%;
  /* Ensure body takes full width */
  box-sizing: border-box;
  /* Include padding in width */
  overflow-x: hidden;
  /* Prevent horizontal spillover */
}

.creator-hero {
  position: relative;
  background: var(--primary-gradient);
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  margin-bottom: 0;
}

.creator-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
}

.creator-avatar-hero {
  position: absolute;
  left: 40px;
  bottom: -60px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 8px solid var(--surface-color);
  object-fit: cover;
  background: var(--surface-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 20;
}

.creator-hero-content {
  position: absolute;
  left: 220px;
  bottom: 30px;
  right: 2rem;
  z-index: 10;
}

.creator-hero-name {
  font-size: 3rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.creator-hero-bio {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  max-width: 600px;
  margin-bottom: 1rem;
}

.creator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-top: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.section-title {
  font-size: 2rem;
  font-weight: 400;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.about-text {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.875rem;
  opacity: 0.9;
}

.contact-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-row {
  display: flex;
  gap: 1.5rem;
}

.btn-contact {
  flex: 1;
  padding: 1rem 2rem;
  border: 1px solid var(--text-secondary);
  border-radius: 99px;
  background: transparent;
  color: var(--text-main);
  font-weight: 500;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-contact:hover {
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.social-icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  background: var(--bg-color);
}

.social-icon-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.profile-section-header {
  margin-bottom: 3rem;
  padding-left: 200px;
}

.profile-section-label {
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-section-line {
  width: 20px;
  height: 1px;
  background: var(--primary-color);
  display: inline-block;
}

@media (max-width: 768px) {
  .profile-wrapper {
    padding: 1rem;
  }

  .profile-card {
    border-radius: 0;
    margin: -1rem;
    /* Full width on mobile */
  }

  .creator-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .creator-hero {
    height: auto;
    padding: 3rem 1.5rem 6rem;
    flex-direction: column;
    text-align: center;
  }

  .creator-avatar-hero {
    position: relative;
    left: auto;
    bottom: auto;
    margin-bottom: 1rem;
    border-width: 4px;
    width: 120px;
    height: 120px;
  }

  .creator-hero-content {
    position: relative;
    left: auto;
    bottom: auto;
    right: auto;
    text-align: center;
    padding: 0 1rem;
  }

  .profile-card-body {
    padding: 2rem 1.5rem;
  }

  .profile-section-header {
    padding-left: 0;
    justify-content: center;
    display: flex;
  }
}

/* --- Utilities --- */
.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-pill-sm {
  border-radius: 99px;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
}

/* --- Breadcrumbs --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-link:hover {
  color: white;
}

.breadcrumb-separator {
  color: var(--text-secondary);
  font-size: 0.8rem;
  opacity: 0.6;
}

.breadcrumb-active {
  color: var(--primary-color);
  font-weight: 600;
}

/* --- Tom Select Dark Theme Customization --- */
.ts-wrapper.form-control,
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
  background: #13151b !important;
  border: 1px solid #2D3039 !important;
  color: #E5E7EB !important;
  border-radius: 8px !important;
  padding: 0.6rem 1rem !important;
  font-size: 0.85rem !important;
  min-height: auto !important;
}

.ts-wrapper.single .ts-control {
  padding-right: 2.5rem !important;
}

.ts-wrapper.focus .ts-control,
.ts-wrapper.single.focus .ts-control {
  border-color: var(--primary-color) !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Dropdown */
.ts-dropdown {
  background: #13151b !important;
  border: 1px solid #2D3039 !important;
  border-radius: 8px !important;
  margin-top: 4px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* Options */
.ts-dropdown .option {
  color: #E5E7EB !important;
  padding: 0.6rem 1rem !important;
  font-size: 0.85rem !important;
  border-radius: 4px !important;
  margin: 2px 4px !important;
}

.ts-dropdown .option:hover,
.ts-dropdown .option.active {
  background: rgba(139, 92, 246, 0.15) !important;
  color: var(--primary-color) !important;
}

.ts-dropdown .option.selected {
  background: rgba(139, 92, 246, 0.1) !important;
  color: var(--primary-color) !important;
  font-weight: 500 !important;
}

/* Search input in dropdown */
.ts-dropdown .ts-dropdown-content {
  padding: 4px !important;
}

.ts-control input {
  color: #E5E7EB !important;
}

.ts-control input::placeholder {
  color: #6B7280 !important;
}

/* Arrow icon */
.ts-wrapper.single .ts-control:after {
  border-color: #9CA3AF transparent transparent !important;
  border-width: 6px 6px 0 !important;
  margin-top: -3px !important;
}

.ts-wrapper.single.dropdown-active .ts-control:after {
  border-color: transparent transparent #9CA3AF !important;
  border-width: 0 6px 6px !important;
  margin-top: -3px !important;
}

/* Loading state */
.ts-wrapper.loading .ts-control:after {
  border-color: var(--primary-color) transparent transparent !important;
}

/* Disabled state */
.ts-wrapper.disabled .ts-control,
.ts-wrapper.disabled .ts-control * {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* Clear button */
.ts-wrapper .clear-button {
  color: #9CA3AF !important;
  font-size: 1.2rem !important;
  margin-right: 0.5rem !important;
}

.ts-wrapper .clear-button:hover {
  color: #E5E7EB !important;
}