/**
 * ExploreX Admin Dashboard Styles
 * 
 * Styling for admin components including:
 * - Admin toolbar and navigation
 * - Content management interface
 * - User management dashboard
 * - System monitoring displays
 * - Analytics and reporting views
 */

/* =============================================================================
   ADMIN TOOLBAR
   ============================================================================= */

.admin-toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  padding: 10px 20px;
  z-index: 10000;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.admin-toolbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-toolbar-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.admin-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.admin-user {
  font-size: 0.9rem;
  font-weight: 500;
}

.admin-toolbar-center {
  display: flex;
  gap: 10px;
}

.admin-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.admin-btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

.admin-btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.admin-btn-success {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.3);
}

.admin-btn-success:hover {
  background: rgba(16, 185, 129, 0.3);
}

.admin-btn-warning {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.3);
}

.admin-btn-warning:hover {
  background: rgba(245, 158, 11, 0.3);
}

/* =============================================================================
   ADMIN MODAL
   ============================================================================= */

.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease-out;
}

.admin-modal-content {
  background: white;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  width: 1000px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.admin-modal-header {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.admin-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.admin-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-modal-body {
  padding: 30px;
  max-height: calc(90vh - 80px);
  overflow-y: auto;
}

/* =============================================================================
   ADMIN DASHBOARD
   ============================================================================= */

.admin-dashboard {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.admin-metric-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
}

.admin-metric-card h3 {
  margin: 0 0 15px 0;
  color: #1e293b;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.metric-value {
  font-weight: 600;
  color: #1e293b;
  font-size: 1.1rem;
}

.admin-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  padding-top: 20px;
  border-top: 2px solid #f1f5f9;
}

.admin-action-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* =============================================================================
   CONTENT MANAGEMENT
   ============================================================================= */

.admin-content-manager {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-tabs {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
}

.admin-tab {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.admin-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.admin-tab:hover {
  color: #1e293b;
  background: #f8fafc;
}

.admin-tab-content {
  min-height: 400px;
}

.pending-content h3 {
  margin: 0 0 20px 0;
  color: #1e293b;
}

.content-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 15px;
}

.content-info h4 {
  margin: 0 0 8px 0;
  color: #1e293b;
}

.content-info p {
  margin: 4px 0;
  color: #64748b;
  font-size: 0.9rem;
}

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

/* =============================================================================
   USER MANAGEMENT
   ============================================================================= */

.admin-user-manager {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.user-search {
  display: flex;
  gap: 15px;
  align-items: center;
}

.user-search input {
  flex: 1;
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
}

.user-search select {
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
}

.user-info h4 {
  margin: 0 0 8px 0;
  color: #1e293b;
}

.user-info p {
  margin: 4px 0;
  color: #64748b;
  font-size: 0.9rem;
}

.user-actions {
  display: flex;
  gap: 10px;
}

/* =============================================================================
   SYSTEM MONITOR
   ============================================================================= */

.admin-system-monitor {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.system-status h3 {
  margin: 0 0 20px 0;
  color: #1e293b;
}

.status-healthy {
  color: #10b981;
}

.status-warning {
  color: #f59e0b;
}

.status-critical {
  color: #ef4444;
}

.system-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.system-alerts h3 {
  margin: 0 0 20px 0;
  color: #1e293b;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid;
}

.alert-low {
  background: rgba(59, 130, 246, 0.1);
  border-left-color: #3b82f6;
}

.alert-medium {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #f59e0b;
}

.alert-high {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
}

.alert-info h4 {
  margin: 0 0 5px 0;
  color: #1e293b;
  font-size: 0.9rem;
}

.alert-info p {
  margin: 0 0 5px 0;
  color: #64748b;
  font-size: 0.85rem;
}

.alert-info small {
  color: #9ca3af;
  font-size: 0.75rem;
}

.acknowledged {
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 500;
}

/* =============================================================================
   ACCESS DENIED
   ============================================================================= */

.access-denied {
  text-align: center;
  padding: 40px;
}

.access-denied h3 {
  color: #ef4444;
  margin-bottom: 15px;
}

.access-denied p {
  color: #64748b;
  margin: 10px 0;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
  .admin-toolbar-content {
    flex-direction: column;
    gap: 10px;
  }
  
  .admin-toolbar-center {
    order: -1;
  }
  
  .admin-modal-content {
    width: 95vw;
    margin: 20px;
  }
  
  .admin-modal-body {
    padding: 20px;
  }
  
  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .content-item,
  .user-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .content-actions,
  .user-actions {
    width: 100%;
    justify-content: flex-end;
  }
  
  .user-search {
    flex-direction: column;
    align-items: stretch;
  }
  
  .system-metrics {
    grid-template-columns: 1fr;
  }
  
  .alert-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* =============================================================================
   DARK THEME SUPPORT
   ============================================================================= */

body.dark .admin-modal-content {
  background: #1e293b;
  color: #f8fafc;
}

body.dark .admin-modal-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.dark .admin-metric-card {
  background: #334155;
  border-color: #475569;
}

body.dark .admin-metric-card h3 {
  color: #f8fafc;
}

body.dark .metric-item {
  border-bottom-color: #475569;
}

body.dark .metric-value {
  color: #f8fafc;
}

body.dark .content-item,
body.dark .user-item {
  background: #334155;
  border-color: #475569;
}

body.dark .content-info h4,
body.dark .user-info h4 {
  color: #f8fafc;
}

body.dark .content-info p,
body.dark .user-info p {
  color: #cbd5e1;
}

body.dark .user-search input,
body.dark .user-search select {
  background: #334155;
  border-color: #475569;
  color: #f8fafc;
}

body.dark .admin-tab {
  color: #cbd5e1;
}

body.dark .admin-tab.active {
  color: #60a5fa;
}

body.dark .admin-tab:hover {
  color: #f8fafc;
  background: #334155;
}

body.dark .system-status h3,
body.dark .system-alerts h3,
body.dark .pending-content h3 {
  color: #f8fafc;
}

body.dark .alert-info h4 {
  color: #f8fafc;
}

body.dark .alert-info p {
  color: #cbd5e1;
}

body.dark .access-denied p {
  color: #cbd5e1;
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.admin-toolbar {
  animation: slideDown 0.3s ease-out;
}

.admin-metric-card,
.content-item,
.user-item,
.alert-item {
  transition: all 0.2s ease;
}

.admin-metric-card:hover,
.content-item:hover,
.user-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* =============================================================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================================================= */

.admin-btn:focus,
.admin-action-btn:focus,
.admin-tab:focus,
.admin-modal-close:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.user-search input:focus,
.user-search select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .admin-toolbar {
    border-bottom: 2px solid;
  }
  
  .admin-modal-content {
    border: 2px solid;
  }
  
  .admin-metric-card,
  .content-item,
  .user-item {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .admin-toolbar,
  .admin-modal,
  .admin-btn,
  .admin-action-btn,
  .admin-metric-card,
  .content-item,
  .user-item {
    animation: none;
    transition: none;
  }
}