/* ==========================================================================
   SKB FORUM & DIGITAL ASSET PLATFORM - ADMIN PANEL STYLES
   ========================================================================== */

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-4);
  margin-bottom: var(--space-10);
  width: 100%;
  max-width: 100%;
}

/* 1. Admin Sidebar Navigation */
.admin-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  height: fit-content;
  position: sticky;
  top: 90px;
  box-sizing: border-box;
}

.admin-sidebar-header {
  padding: var(--space-3) var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-3);
}

.admin-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.admin-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: left;
  white-space: nowrap;
}

.admin-nav-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.admin-nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.admin-nav-btn .icon {
  font-size: 1.15rem;
}

/* 2. Admin Content Panel */
.admin-main {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
  min-height: 600px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.admin-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.admin-subheading {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* 3. Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  width: 100%;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
}

.stat-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon-blue { background: var(--primary-light); color: var(--primary); }
.stat-icon-amber { background: var(--warning-light); color: var(--warning-text); }
.stat-icon-emerald { background: var(--success-light); color: var(--success-text); }
.stat-icon-purple { background: #f5f3ff; color: #7c3aed; }

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-title {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 4. Admin Data Tables */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  display: block;
}

.admin-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.admin-table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: #f8fafc;
}

/* 5. Drag & Drop Cloud Uploader Box */
.cloud-dropzone {
  border: 2px dashed var(--primary-border);
  background: var(--primary-light);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-4);
  position: relative;
}

.cloud-dropzone * {
  pointer-events: none;
}

.cloud-dropzone:hover {
  border-color: var(--primary);
  background: #e0f2fe;
}

.cloud-dropzone.dragover {
  border-color: var(--primary) !important;
  border-style: solid !important;
  background: rgba(37, 99, 235, 0.12) !important;
  transform: scale(1.01);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.18);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.uploaded-files-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.uploaded-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

/* 6. Permissions / ACL Matrix Badge */
/* 7. WYSIWYG Rich Text Editor */
.rich-editor-wrapper {
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: visible;
  position: relative;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rich-editor-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.rich-editor-toolbar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  position: relative;
  z-index: 50;
}

.editor-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.editor-btn:hover {
  background: #ffffff;
  border-color: var(--border-light);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.editor-btn:active {
  transform: scale(0.95);
}

.editor-separator {
  width: 1px;
  height: 20px;
  background: var(--border-light);
  margin: 0 4px;
}

.rich-editor-content {
  min-height: 180px;
  max-height: 380px;
  overflow-y: auto;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  outline: none;
}

.rich-editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-light);
  pointer-events: none;
}

.rich-editor-content h2, .rich-editor-content h3 {
  color: var(--text-primary);
  margin: 10px 0 6px;
  font-weight: 700;
}

.rich-editor-content ul, .rich-editor-content ol {
  padding-left: 24px;
  margin: 8px 0;
}

.rich-editor-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  margin: 8px 0;
}

.rich-editor-content blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Emoji Picker Floating Panel */
.emoji-picker-container {
  position: relative;
  display: inline-block;
}

.emoji-picker-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  width: 320px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  z-index: 1050;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInDown 0.18s ease;
}

.emoji-picker-popover.active {
  display: flex;
}

.emoji-picker-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.emoji-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  background: #ffffff;
  outline: none;
}

.emoji-search-input:focus {
  border-color: var(--primary);
}

.emoji-category-tabs {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.emoji-category-tabs::-webkit-scrollbar {
  display: none;
}

.emoji-tab-btn {
  padding: 3px 7px;
  font-size: 0.74rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.emoji-tab-btn.active, .emoji-tab-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.emoji-grid-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
}

.emoji-category-section {
  margin-bottom: 10px;
}

.emoji-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.emoji-item-btn {
  width: 36px;
  height: 36px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
  user-select: none;
}

.emoji-item-btn:hover {
  background: var(--bg-subtle);
  transform: scale(1.22);
}

.editor-btn-pill {
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.editor-btn-pill:hover, .editor-btn-pill.active {
  background: #ffffff;
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-xs);
}

/* 8. Searchable Select Combobox with Dropdown Search */
.searchable-combo-container {
  position: relative;
  width: 100%;
}

.combo-trigger {
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-size: 0.92rem;
  color: var(--text-primary);
  box-sizing: border-box;
}

.combo-trigger:hover {
  border-color: var(--primary-border);
  background: var(--bg-subtle);
}

.searchable-combo-container.active .combo-trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.combo-trigger-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  font-weight: 500;
}

.combo-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.searchable-combo-container.active .combo-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.combo-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
  z-index: 1060;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInDown 0.18s ease;
}

.searchable-combo-container.active .combo-dropdown-menu {
  display: flex;
}

.combo-search-wrapper {
  padding: 10px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.combo-search-input {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.combo-search-input:focus {
  border-color: var(--primary);
}

.combo-options-list {
  max-height: 250px;
  overflow-y: auto;
  padding: 4px 0;
}

.combo-group-header {
  padding: 6px 14px 4px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  background: #f8fafc;
}

.combo-option {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.combo-option:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.combo-option.selected {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 700;
}

.combo-option.sub-level {
  padding-left: 28px;
}

.combo-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   Branding & Media Customizer Styles
   ========================================================================== */
.branding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.branding-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-xs);
}

.branding-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-light);
}

.branding-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-preview-box {
  background: #f8fafc;
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.favicon-preview-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.favicon-icon-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.favicon-icon-preview img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.slide-item-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  transition: all var(--transition-fast);
}

.slide-item-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-xs);
}

.slide-thumbnail {
  width: 120px;
  height: 56px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0f172a;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.slide-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.slide-title-text {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.slide-link-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}


