/* Admin Panel Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  overflow-x: hidden;
}

/* Login Overlay Styles */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.login-overlay.hidden {
  display: none;
}

/* Analytics styles */
#analytics-section .analytics-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px;
}
#analytics-section .analytics-grid {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  #analytics-section .analytics-grid {
    grid-column: 1 / -1;
  }
}
@media (min-width: 1200px) {
  #analytics-section .analytics-grid {
    grid-template-columns: repeat(12, 1fr);
  }
}
#analytics-section .analytics-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
#analytics-section .analytics-card h3 {
  margin: 0 0 8px;
}
#analytics-section .analytics-card {
  grid-column: span 6;
}
#analytics-section .analytics-card.overview {
  grid-column: 1 / -1;
}
#analytics-section .analytics-card.span-2 {
  grid-column: span 6;
}

#analytics-section .bar-chart .bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
#analytics-section .overview-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
#analytics-section .bar-chart .label {
  width: 120px;
  font-size: 0.9rem;
  color: #374151;
}
#analytics-section .bar-chart .bar {
  flex: 1;
  background: #f3f4f6;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}
#analytics-section .bar-chart .fill {
  height: 100%;
  background: #3b82f6;
}
#analytics-section .bar-chart .value {
  width: 50px;
  text-align: right;
  font-size: 0.85rem;
  color: #6b7280;
}
#analytics-section .line-chart {
  overflow-x: auto;
}

@media (min-width: 900px) {
  /* keep auto-fit; span-2 will occupy two tracks */
}
@media (min-width: 1200px) {
  /* layout scales naturally with auto-fit */
}

/* Enhanced Analytics UI */
#analytics-section .analytics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
}
#analytics-section .analytics-toolbar .toolbar-title {
  font-weight: 600;
  color: #111827;
  margin-right: 8px;
}
#analytics-section .analytics-toolbar .toolbar-subtitle {
  color: #6b7280;
  font-size: 0.9rem;
}
#analytics-section .analytics-toolbar .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#analytics-section .analytics-card .card-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #111827;
}
#analytics-section .analytics-card.overview .overview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
#analytics-section .analytics-card .kpi {
  background: #f9fafb;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 12px;
}
#analytics-section .analytics-card .kpi-label {
  display: block;
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 4px;
}
#analytics-section .analytics-card .kpi-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
}
#analytics-section .analytics-card .kpi-value.success {
  color: #059669;
}

#analytics-section .top-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
#analytics-section .top-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px dashed #e5e7eb;
}
#analytics-section .top-list li:last-child {
  border-bottom: none;
}
#analytics-section .top-list .item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
#analytics-section .top-list .avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
#analytics-section .top-list .name {
  font-weight: 600;
  color: #111827;
}
#analytics-section .top-list .item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
}
#analytics-section .top-list .dot {
  opacity: 0.6;
}
#analytics-section .chart-hint {
  margin-top: 6px;
  color: #6b7280;
  font-size: 0.85rem;
}

/* Small UI helpers */
#analytics-section .select-sm {
  height: 28px;
  padding: 2px 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  margin-right: 8px;
}
#analytics-section .analytics-card .empty {
  color: #6b7280;
  font-size: 0.9rem;
}

.login-form-container {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  margin: 20px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h2 {
  color: #333;
  /* Phone-focused micro-breakpoints for admin panel */
  @media (max-width: 640px) {
    .admin-header {
      padding: 10px 12px;
      gap: 8px;
    }
    .admin-actions {
      flex-wrap: wrap;
      gap: 8px;
    }
    .admin-table {
      font-size: 12px;
    }
    .admin-sidebar {
      position: static;
      width: 100%;
    }
  }

  @media (max-width: 480px) {
    .admin-header h1 {
      font-size: 18px;
    }
    .admin-controls {
      flex-direction: column;
      align-items: stretch;
      gap: 8px;
    }
    .admin-table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
    }
    .admin-card,
    .panel-card {
      padding: 12px;
      border-radius: 12px;
    }
    .modal .modal-content {
      width: calc(100% - 24px);
      margin: 12px;
      border-radius: 14px;
    }
  }
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.login-header h2 i {
  color: #667eea;
  margin-right: 10px;
}

.login-header p {
  color: #666;
  font-size: 0.9rem;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
}

.login-form input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e1e1e1;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
}

.login-btn:active {
  transform: translateY(0);
}

.error-message {
  color: #e74c3c;
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
  padding: 10px;
  background: #fdf2f2;
  border-radius: 4px;
  border-left: 4px solid #e74c3c;
  display: none;
}

.error-message.show {
  display: block;
}

.admin-container {
  display: flex;
  min-height: 100vh;
}

.admin-container.hidden {
  display: none;
}

/* CSP-safe helpers */
.hidden {
  display: none !important;
}
.ml-auto {
  margin-left: auto !important;
}
.ml-5 {
  margin-left: 5px !important;
}
.text-center {
  text-align: center !important;
}
.grid-full {
  grid-column: 1 / -1;
}
.p-40 {
  padding: 40px !important;
}
.icon-lg {
  font-size: 3rem !important;
}
.text-success {
  color: #28a745 !important;
}
.mb-16 {
  margin-bottom: 16px !important;
}

/* Modal content helpers */
.content-meta-box {
  margin-bottom: 20px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 5px;
}
.content-scroll-box {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #ddd;
  padding: 15px;
  border-radius: 5px;
}

/* Analytics bar SVG helpers */
.bar-svg {
  width: 100%;
  height: 10px;
  display: block;
}
.bar-bg {
  fill: #f3f4f6;
}
.bar-fill {
  fill: #3b82f6;
}

/* Sidebar Styles */
.admin-sidebar {
  width: 250px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  transition: transform 0.3s ease;
  z-index: 1000;
}

.admin-sidebar.collapsed {
  transform: translateX(-250px);
}

.admin-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.admin-logo h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

.admin-nav ul {
  list-style: none;
  padding: 20px 0;
}

.admin-nav li {
  margin: 5px 0;
}

.admin-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  border-left-color: #ffd700;
}

.admin-nav .nav-link i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

/* Approval Badge Styles */
.approval-badge {
  background-color: #ff4757;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.nav-link {
  position: relative;
  justify-content: space-between;
}

.admin-logout {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
}

.logout-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
.admin-main {
  margin-left: 250px;
  width: calc(100% - 250px);
  min-height: 100vh;
  transition: margin-left 0.3s ease, width 0.3s ease;
}

.admin-main.expanded {
  margin-left: 0;
  width: 100%;
}

/* Header */
.admin-header {
  background: white;
  padding: 15px 30px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left {
  display: flex;
  align-items: center;
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  margin-right: 20px;
  padding: 5px;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

.sidebar-toggle:hover {
  background-color: #f0f0f0;
}

#page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

.header-right {
  display: flex;
  align-items: center;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-username {
  font-weight: 500;
  color: #666;
}

.admin-avatar {
  font-size: 2rem;
  color: #667eea;
}

/* Content Area */
.admin-content {
  padding: 30px;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.stat-card:nth-child(1) .stat-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.stat-card:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.stat-info h3 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 5px;
}

.stat-info p {
  color: #666;
  font-size: 0.9rem;
}

/* Dashboard Charts */
.dashboard-charts {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
  margin-bottom: 20px;
  color: #333;
}

.activity-list {
  max-height: 300px;
  overflow-y: auto;
}

.activity-item {
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 15px;
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  color: #667eea;
}

.activity-details {
  flex: 1;
}

.activity-details h4 {
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #333;
}

.activity-details p {
  font-size: 0.8rem;
  color: #666;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 600;
  color: #333;
}

/* Approval Section Styles */
.approval-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pending-count {
  background: linear-gradient(135deg, #ff7b7b, #ff6b6b);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.approval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.approval-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #ffc107;
  transition: all 0.3s ease;
}

.approval-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.approval-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.approval-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 0;
  line-height: 1.3;
}

.approval-card-type {
  background: #e9ecef;
  color: #495057;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.approval-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: #666;
}

.approval-card-author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.approval-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
}

.approval-card-excerpt {
  color: #555;
  line-height: 1.5;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.approval-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-card-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 6px 12px;
  font-size: 0.8rem;
  min-width: 80px;
}

.approval-card-actions .btn i {
  margin-right: 4px;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Filters */
.content-filters,
.users-filters {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.content-filters select,
.content-filters input,
.users-filters select,
.users-filters input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 0.9rem;
}

.content-filters input[type="text"],
.users-filters input[type="text"] {
  flex: 1;
  min-width: 250px;
}

/* Tables */
.admin-table {
  width: 100%;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
}

.admin-table tbody tr:hover {
  background-color: #f8f9fa;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-published {
  background: #d4edda;
  color: #155724;
}

.status-draft {
  background: #fff3cd;
  color: #856404;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-inactive {
  background: #f8d7da;
  color: #721c24;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.category-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.category-card:hover {
  transform: translateY(-2px);
}

.category-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 15px;
}

.category-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

.category-actions {
  display: flex;
  gap: 5px;
}

.category-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.category-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #999;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}

.modal-close:hover {
  background-color: #f0f0f0;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 0.9rem;
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Loading Spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-250px);
  }
  #analytics-section .analytics-card {
    grid-column: span 3; /* two columns */
  }
  #analytics-section .analytics-card.span-2 {
    grid-column: span 6; /* full width */
  }

  .admin-sidebar.active {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .content-filters,
  .users-filters {
    flex-direction: column;
  }

  .content-filters input[type="text"],
  .users-filters input[type="text"] {
    min-width: auto;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .modal {
    width: 95%;
    margin: 20px;
  }
}

/* Action Buttons in Tables */
.action-buttons {
  display: flex;
  gap: 5px;
}

.action-buttons .btn {
  padding: 5px 8px;
  font-size: 0.7rem;
}

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  font-weight: 500;
  z-index: 4000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.success {
  background: #28a745;
}

.notification.error {
  background: #dc3545;
}

.notification.warning {
  background: #ffc107;
  color: #212529;
}

.notification.info {
  background: #17a2b8;
}

/* Spotlight Management Styles */
.spotlight-current {
  margin-bottom: 40px;
}

.section-description {
  color: #6c757d;
  font-size: 0.9rem;
  margin: 5px 0 0 0;
}

.spotlight-current h3 {
  margin-bottom: 20px;
  color: #333;
  font-size: 1.5rem;
}

.spotlight-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.spotlight-slots-small {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 15px;
}

.spotlight-slot {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.spotlight-slot:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.spotlight-slot.main-slot {
  min-height: 300px;
}

.spotlight-slot.small-slot {
  min-height: 150px;
}

.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e9ecef;
}

.slot-header h4 {
  color: #495057;
  font-size: 1.1rem;
  margin: 0;
}

.slot-header h4 i {
  color: #ffc107;
  margin-right: 8px;
}

.slot-position {
  background: #007bff;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.slot-content {
  height: 100%;
}

.empty-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6c757d;
  text-align: center;
  min-height: 120px;
}

.empty-slot i {
  font-size: 2rem;
  margin-bottom: 10px;
  color: #dee2e6;
}

.empty-slot p {
  margin-bottom: 15px;
  font-style: italic;
}

.assigned-content {
  height: 100%;
}

.content-preview {
  display: flex;
  gap: 15px;
  height: 100%;
}

.content-preview.main {
  flex-direction: column;
}

.content-preview.small {
  flex-direction: row;
}

.content-image {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.content-preview.main .content-image {
  width: 100%;
  height: 150px;
  margin-bottom: 15px;
}

.content-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-preview.main .content-title {
  font-size: 1.1rem;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.content-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.content-type {
  background: #e9ecef;
  color: #495057;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  text-transform: capitalize;
}

.content-type.article {
  background: #d1ecf1;
  color: #0c5460;
}

.content-type.video {
  background: #f8d7da;
  color: #721c24;
}

.content-type.audio {
  background: #d4edda;
  color: #155724;
}

.content-stats {
  font-size: 0.8rem;
  color: #6c757d;
}

.content-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-remove {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-remove:hover {
  background: #c82333;
}

.spotlight-available {
  margin-top: 40px;
}

.available-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.available-header h3 {
  color: #333;
  font-size: 1.4rem;
  margin: 0;
}

.search-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  width: 200px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
}

.available-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.available-item {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
  cursor: pointer;
}

.available-item:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.available-item.selected {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.item-content {
  display: flex;
  gap: 12px;
}

.item-image {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

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

.item-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.item-excerpt {
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.assign-btn {
  background: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.assign-btn:hover {
  background: #218838;
}

.no-content {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #6c757d;
}

/* Pagination Styles */
.pagination {
  margin-top: 20px;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  background: white;
  color: #007bff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.pagination-btn:hover:not(.active) {
  background: #e9ecef;
}

.pagination-btn.active {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spotlight Position Assignment Modal */
.position-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.position-modal.hidden {
  display: none;
}

.position-modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.position-modal h3 {
  margin-bottom: 20px;
  color: #333;
}

.position-options {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.position-option {
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.position-option:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.position-option.selected {
  border-color: #007bff;
  background: #e7f3ff;
}

.position-option.occupied {
  border-color: #dc3545;
  background: #f8d7da;
  cursor: not-allowed;
  opacity: 0.7;
}

.position-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.position-description {
  font-size: 0.9rem;
  color: #6c757d;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-secondary:hover {
  background: #545b62;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .spotlight-grid {
    grid-template-columns: 1fr;
  }
  #analytics-section .analytics-card {
    grid-column: span 6; /* two columns */
  }
  #analytics-section .analytics-card.span-2 {
    grid-column: span 12; /* full width */
  }

  .spotlight-slots-small {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;
  }
}

@media (max-width: 768px) {
  .spotlight-slots-small {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
  }

  .available-header {
    flex-direction: column;
    align-items: stretch;
  }

  .search-filters {
    justify-content: stretch;
  }

  .search-input {
    flex: 1;
    width: auto;
  }

  .available-content-grid {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   Spotlight Management Enhanced
   ============================== */
:root {
  --brand-1: #667eea;
  --brand-2: #764ba2;
  --accent: #ffc107;
  --text: #111827;
  --subtle: #6b7280;
  --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.12);
}

#spotlight-section .section-header h2 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.spotlight-slot {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9eef6;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.spotlight-slot:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d6e1fb;
}

.slot-header {
  border-bottom: 1px dashed #e5e7eb;
}
.slot-header h4 {
  color: var(--text);
}
.slot-header h4 i {
  color: var(--accent);
  margin-right: 8px;
}

.slot-position {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.25);
}

.empty-slot {
  color: var(--subtle);
  border: 2px dashed #e5e7eb;
  border-radius: 10px;
  background: radial-gradient(
        circle at 10px 10px,
        rgba(102, 126, 234, 0.06) 2px,
        transparent 0
      )
      0 0/24px 24px,
    radial-gradient(
        circle at 14px 14px,
        rgba(118, 75, 162, 0.06) 2px,
        transparent 0
      )
      0 0/24px 24px;
}

.content-preview.main .content-image {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  margin-bottom: 15px;
  border: 1px solid #e5e7eb;
  box-shadow: var(--shadow-sm);
}

.content-type {
  background: linear-gradient(135deg, #eef2ff, #e9d5ff);
  color: #5b21b6;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  text-transform: capitalize;
  border: 1px solid #e9e0ff;
}

.content-actions {
  gap: 10px;
}
.btn-remove {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
}
.btn-remove:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.35);
}

.available-item {
  background: linear-gradient(180deg, #ffffff 0%, #fafbff 100%);
  border-radius: 10px;
  padding: 15px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e9eef6;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.available-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.available-item.selected {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.assign-btn {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.25);
}
.assign-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.35);
}

/* ============================
   Settings Section Styles
   Scoped to #settings-section to avoid conflicts
   ============================ */
#settings-section .settings-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px;
}

#settings-section .settings-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  #settings-section .settings-sections {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  #settings-section .settings-sections {
    grid-template-columns: repeat(3, 1fr);
  }
}

#settings-section .settings-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

#settings-section .settings-section h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: #111827;
}

#settings-section .settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#settings-section .settings-form .form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#settings-section .settings-form .form-row label:first-child {
  color: #374151;
  font-weight: 600;
  min-width: 160px;
}

#settings-section .settings-form input[type="text"],
#settings-section .settings-form select {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

#settings-section .settings-form input[type="text"]:focus,
#settings-section .settings-form select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* Toggle switch */
#settings-section .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

#settings-section .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

#settings-section .switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #e5e7eb;
  transition: background 0.2s ease;
  border-radius: 999px;
  border: 1px solid #d1d5db;
}

#settings-section .switch .slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background-color: white;
  transition: transform 0.2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

#settings-section .switch input:checked + .slider {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #6b6eea;
}

#settings-section .switch input:checked + .slider::before {
  transform: translate(20px, -50%);
}

#settings-section .settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  padding: 4px 0;
}
