/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-body: #1a1a2e;
  --bg-sidebar: #16213e;
  --bg-sidebar-hover: #1a2744;
  --bg-topbar: #0f3460;
  --bg-content: #1a1a2e;
  --bg-widget: #16213e;
  --bg-widget-header: #0f3460;
  --bg-input: #0d1b2a;
  --bg-welcome: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --accent-magenta: #ff00ff;
  --accent-magenta-hover: #ff44ff;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0b0;
  --text-muted: #6c6c7e;
  --border-color: #2a2a4a;
  --border-widget: #2a2a4a;
  --link-color: #ff00ff;
  --link-hover: #ff44ff;
  --sidebar-width: 160px;
  --sidebar-collapsed: 36px;
  --topbar-height: 32px;
  --success: #00e676;
  --warning: #ffc107;
  --chart-bar1: #7c3aed;
  --chart-bar2: #a855f7;
  --chart-bar3: #c084fc;
}

html,
body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-body);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color .2s;
}

a:hover {
  color: var(--link-hover);
}

/* ===== TOP ADMIN BAR ===== */
#wpadminbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: #1d2327;
  color: #c3c4c7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 1000;
  font-size: 13px;
  border-bottom: 1px solid #333;
}

#wpadminbar .ab-left,
#wpadminbar .ab-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

#wpadminbar .ab-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  height: var(--topbar-height);
  color: #c3c4c7;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-size: 13px;
}

#wpadminbar .ab-item:hover {
  background: #32373c;
  color: #00b9eb;
}

#wpadminbar .ab-item .dashicon {
  font-size: 16px;
}

#wpadminbar .ab-site-name {
  font-weight: 600;
}

#wpadminbar .ab-item.ab-user {
  gap: 8px;
}

#wpadminbar .ab-item.ab-user .user-name {
  color: var(--accent-magenta);
  font-weight: 500;
}

#wpadminbar .ab-item.ab-user .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-magenta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.notif-badge {
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

/* ===== LEFT SIDEBAR ===== */
#adminmenuwrap {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: #1d2327;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 999;
  transition: width .25s ease;
  border-right: 1px solid #333;
}

#adminmenuwrap::-webkit-scrollbar {
  width: 4px;
}

#adminmenuwrap::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #c3c4c7;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-size: 13px;
  position: relative;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: #32373c;
  color: #fff;
}

.menu-item.active {
  background: var(--accent-magenta);
  color: #fff;
  border-left-color: #fff;
}

.menu-item .menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.menu-item .menu-label {
  white-space: nowrap;
}

.menu-item .menu-badge {
  margin-left: auto;
  background: var(--accent-magenta);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  min-width: 18px;
  text-align: center;
}

.menu-item.active .menu-badge {
  background: #fff;
  color: var(--accent-magenta);
}

/* Submenu */
.submenu {
  background: #2c3338;
  overflow: hidden;
  transition: max-height .3s ease;
}

.submenu.collapsed {
  max-height: 0 !important;
}

.submenu a {
  display: block;
  padding: 5px 12px 5px 40px;
  color: #b4b9be;
  font-size: 12px;
  transition: color .15s;
}

.submenu a:hover,
.submenu a.active {
  color: var(--accent-magenta);
}

/* Separator */
.menu-separator {
  height: 1px;
  background: #333;
  margin: 6px 0;
}

/* Collapse button */
.collapse-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #a7aaad;
  cursor: pointer;
  font-size: 12px;
  border-top: 1px solid #333;
  transition: background .15s;
}

.collapse-btn:hover {
  background: #32373c;
  color: #fff;
}

/* Collapsed state */
body.sidebar-collapsed #adminmenuwrap {
  width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .menu-label,
body.sidebar-collapsed .menu-badge,
body.sidebar-collapsed .submenu,
body.sidebar-collapsed .collapse-btn .collapse-text {
  display: none;
}

body.sidebar-collapsed #wpcontent {
  margin-left: var(--sidebar-collapsed);
}

/* ===== MAIN CONTENT ===== */
#wpcontent {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 20px;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left .25s ease;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 400;
}

.page-header h1 span {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 8px;
}

.page-header-actions {
  display: flex;
  gap: 8px;
}

.btn-outline {
  padding: 4px 12px;
  border: 1px solid #646970;
  color: #c3c4c7;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
  transition: all .15s;
}

.btn-outline:hover {
  border-color: var(--accent-magenta);
  color: var(--accent-magenta);
}

/* ===== WELCOME BANNER ===== */
.welcome-panel {
  background: #1d2327;
  border: 1px solid #333;
  padding: 20px 24px;
  margin-bottom: 20px;
  position: relative;
  border-radius: 4px;
}

.welcome-panel h2 {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 6px;
}

.welcome-panel p {
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.welcome-panel .dismiss-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #a7aaad;
  cursor: pointer;
  font-size: 18px;
  transition: color .15s;
}

.welcome-panel .dismiss-btn:hover {
  color: #fff;
}

.welcome-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 6px 16px;
  background: var(--accent-magenta);
  color: #fff;
  border: 1px solid var(--accent-magenta);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  border-radius: 3px;
  transition: all .2s;
}

.btn-primary:hover {
  background: var(--accent-magenta-hover);
  border-color: var(--accent-magenta-hover);
}

.btn-link {
  color: var(--accent-magenta);
  font-size: 13px;
  cursor: pointer;
  background: none;
  border: none;
}

.btn-link:hover {
  color: var(--accent-magenta-hover);
}

/* ===== WIDGET GRID ===== */
.dashboard-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-widgets-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-widgets-full {
  margin-bottom: 16px;
}

/* Widget card */
.widget {
  background: #1d2327;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  user-select: none;
}

.widget-header h3 {
  font-size: 13px;
  font-weight: 600;
}

.widget-toggle {
  background: none;
  border: none;
  color: #a7aaad;
  cursor: pointer;
  font-size: 14px;
  transition: transform .3s, color .15s;
}

.widget-toggle:hover {
  color: #fff;
}

.widget-toggle.collapsed {
  transform: rotate(180deg);
}

.widget-body {
  padding: 14px;
  transition: max-height .3s ease, padding .3s;
  overflow: hidden;
}

.widget-body.collapsed {
  max-height: 0 !important;
  padding: 0 14px;
}

/* ===== AT A GLANCE ===== */
.glance-list {
  list-style: none;
}

.glance-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
}

.glance-list li .icon {
  font-size: 16px;
}

.glance-list li .count {
  font-weight: 700;
  color: #fff;
}

.glance-meta {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.glance-meta strong {
  color: var(--text-primary);
}

/* ===== QUICK DRAFT ===== */
.quick-draft-form .form-field {
  margin-bottom: 10px;
}

.quick-draft-form input[type="text"],
.quick-draft-form textarea {
  width: 100%;
  padding: 7px 10px;
  background: #2c3338;
  border: 1px solid #3c4148;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  border-radius: 3px;
  transition: border-color .2s;
}

.quick-draft-form input[type="text"]:focus,
.quick-draft-form textarea:focus {
  outline: none;
  border-color: var(--accent-magenta);
}

.quick-draft-form textarea {
  min-height: 80px;
  resize: vertical;
}

.btn-save-draft {
  padding: 5px 14px;
  background: transparent;
  color: var(--accent-magenta);
  border: 1px solid var(--accent-magenta);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border-radius: 3px;
  transition: all .2s;
}

.btn-save-draft:hover {
  background: var(--accent-magenta);
  color: #fff;
}

/* ===== ACTIVITY ===== */
.activity-section {
  margin-bottom: 14px;
}

.activity-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.activity-item {
  padding: 4px 0;
  font-size: 12px;
}

.activity-item .time {
  color: var(--text-muted);
  margin-right: 8px;
}

.activity-item .title {
  color: var(--accent-magenta);
}

.activity-item .category {
  color: var(--text-muted);
  margin-left: 12px;
  font-size: 11px;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-magenta);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.comment-meta {
  color: var(--text-muted);
}

.comment-meta a {
  color: var(--accent-magenta);
}

.comment-text {
  color: var(--text-secondary);
  font-style: italic;
  font-size: 11px;
  margin-top: 2px;
}

/* ===== VIDEO PERFORMANCE ===== */
.perf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: #2c3338;
  border: 1px solid #3c4148;
  border-radius: 6px;
  padding: 14px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 2px;
}

.stat-value.magenta {
  color: var(--accent-magenta);
}

.stat-value.green {
  color: var(--success);
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.chart-container {
  width: 100%;
  height: 120px;
}

.chart-container canvas {
  width: 100%;
  height: 100%;
}

/* ===== PLATFORM NEWS ===== */
.news-item {
  padding: 8px 0;
  border-bottom: 1px solid #2c3338;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item a {
  color: var(--accent-magenta);
  font-size: 13px;
  font-weight: 500;
}

.news-item p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== RECENT UPLOADS TABLE ===== */
.uploads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #333;
}

.uploads-header h3 {
  font-size: 13px;
  font-weight: 600;
}

.uploads-header a {
  font-size: 12px;
  color: var(--accent-magenta);
}

.uploads-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.uploads-table th {
  text-align: left;
  padding: 8px 14px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #333;
}

.uploads-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a3a;
}

.uploads-table tr:hover td {
  background: #2c3338;
}

.uploads-table .video-title {
  color: var(--accent-magenta);
  font-weight: 500;
}

.uploads-table .video-status {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.uploads-table .status-published {
  background: rgba(0, 230, 118, .15);
  color: var(--success);
}

.uploads-table .status-draft {
  background: rgba(255, 193, 7, .15);
  color: var(--warning);
}

.uploads-table .status-pending {
  background: rgba(255, 0, 255, .15);
  color: var(--accent-magenta);
}

/* Stats in table */
.video-stats {
  display: flex;
  gap: 12px;
}

.video-stats span {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .dashboard-widgets {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {

  .dashboard-widgets,
  .dashboard-widgets-2col {
    grid-template-columns: 1fr;
  }

  #adminmenuwrap {
    width: var(--sidebar-collapsed);
  }

  .menu-label,
  .menu-badge,
  .submenu,
  .collapse-btn .collapse-text {
    display: none;
  }

  #wpcontent {
    margin-left: var(--sidebar-collapsed);
  }
}

/* Page content areas */
.page-content {
  background: #1d2327;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 30px;
}

.page-content h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

.page-content p {
  color: var(--text-secondary);
}

/* Videos page table */
.video-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.video-list-table th {
  text-align: left;
  padding: 10px 14px;
  background: #2c3338;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid #333;
}

.video-list-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a3a;
}

.video-list-table tr:hover td {
  background: #2c3338;
}

.video-list-table .title-col a {
  color: var(--accent-magenta);
  font-weight: 500;
}

.row-actions {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.row-actions a {
  color: var(--text-muted);
}

.row-actions a:hover {
  color: var(--accent-magenta);
}

.row-actions span {
  margin: 0 4px;
}

/* Tablenav */
.tablenav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.tablenav select,
.tablenav input[type="text"] {
  background: #2c3338;
  border: 1px solid #3c4148;
  color: var(--text-primary);
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
}

.tablenav .btn-sm {
  padding: 4px 10px;
  background: #2c3338;
  border: 1px solid #3c4148;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
}

.tablenav .btn-sm:hover {
  border-color: var(--accent-magenta);
  color: var(--accent-magenta);
}

.search-box {
  display: flex;
  gap: 6px;
}

.search-box input {
  width: 180px;
}

/* ===== WORDPRESS-STYLE EDIT FORM LAYOUT ===== */
.edit-form-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .edit-form-layout {
    grid-template-columns: 1fr;
  }
}

/* Meta box card */
.metabox {
  background: #1d2327;
  border: 1px solid #333;
  border-radius: 4px;
  margin-bottom: 16px;
}

.metabox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #333;
  cursor: pointer;
  user-select: none;
}

.metabox-header h3 {
  font-size: 13px;
  font-weight: 600;
}

.metabox-body {
  padding: 14px;
}

/* Title input — full-width prominent field */
.title-input {
  width: 100%;
  padding: 10px 12px;
  background: #2c3338;
  border: 1px solid #3c4148;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 400;
  border-radius: 3px;
  transition: border-color .2s;
}

.title-input:focus {
  outline: none;
  border-color: var(--accent-magenta);
}

#metabox-title {
  padding: 0;
  border: none;
  background: none;
}

/* Meta field common styles */
.meta-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.meta-input {
  width: 100%;
  padding: 7px 10px;
  background: #2c3338;
  border: 1px solid #3c4148;
  color: var(--text-primary);
  font-size: 13px;
  border-radius: 3px;
  font-family: inherit;
  transition: border-color .2s;
}

.meta-input:focus {
  outline: none;
  border-color: var(--accent-magenta);
}

.meta-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.meta-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Thumbnail preview */
.thumbnail-preview {
  background: #12151a;
  border: 1px solid #3c4148;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}

/* Publish box */
.publish-info {
  margin-bottom: 14px;
}

.publish-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid #2a2a3a;
}

.publish-row:last-child {
  border-bottom: none;
}

.publish-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.publish-edit {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent-magenta);
  cursor: pointer;
}

.publish-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #333;
}

/* Taxonomy checklist (Genres) */
.taxonomy-checklist {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 0;
}

.taxonomy-checklist::-webkit-scrollbar {
  width: 4px;
}

.taxonomy-checklist::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.taxonomy-checklist label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 13px;
  cursor: pointer;
}

.taxonomy-checklist label:hover {
  color: var(--accent-magenta);
}

.taxonomy-checklist input[type="checkbox"] {
  accent-color: var(--accent-magenta);
  width: 14px;
  height: 14px;
}

.taxonomy-checklist .child {
  padding-left: 18px;
}

.taxonomy-add {
  padding-top: 8px;
  border-top: 1px solid #2a2a3a;
  margin-top: 8px;
}

.taxonomy-add-toggle {
  font-size: 12px;
  color: var(--accent-magenta);
}

/* Tag chips */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #2c3338;
  border: 1px solid #3c4148;
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--text-primary);
}

.tag-chip button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.tag-chip button:hover {
  color: var(--accent);
}

/* Extra button style for meta boxes */
.metabox .btn-sm {
  padding: 4px 10px;
  background: #2c3338;
  border: 1px solid #3c4148;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  border-radius: 3px;
}

.metabox .btn-sm:hover {
  border-color: var(--accent-magenta);
  color: var(--accent-magenta);
}