/**
 * ADMIN DASHBOARD - PREMIUM MONITORING INTERFACE 🛡️
 * Design 11/10 - Enterprise-grade monitoring + Glassmorphism
 */

/* ==================== MAIN DASHBOARD ==================== */
.admin-dashboard {
  padding: 2.5rem;
  max-width: 1600px;
  margin: 0 auto;
  animation: fadeSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== HEADER ==================== */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-header h1 {
  font-size: 2.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ef4444 0%, #f97316 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.admin-subtitle {
  font-size: 1rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  font-weight: 500;
  margin-top: 0.5rem;
}

.btn-refresh {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #ef4444, #f97316);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-refresh:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(239, 68, 68, 0.5);
}

.btn-refresh span {
  font-size: 1.25rem;
  animation: rotate 2s linear infinite paused;
}

.btn-refresh:hover span {
  animation-play-state: running;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==================== REAL-TIME STATS ==================== */
.realtime-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.realtime-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.realtime-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.realtime-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.realtime-card:hover::before {
  opacity: 1;
}

.realtime-icon {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.4));
}

.realtime-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.realtime-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.realtime-warning {
  border-color: rgba(245, 158, 11, 0.5);
}

.realtime-warning .realtime-value {
  color: #f59e0b;
}

.realtime-success {
  border-color: rgba(16, 185, 129, 0.3);
}

.realtime-success .realtime-value {
  color: #10b981;
}

/* ==================== TABS NAVIGATION ==================== */
.admin-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  overflow-x: auto;
}

.admin-tab {
  flex: 1;
  min-width: 180px;
  padding: 1.125rem 1.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
}

.admin-tab::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.1));
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.35s;
}

.admin-tab:hover {
  color: var(--text-color);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateY(-3px);
}

.admin-tab:hover::before {
  opacity: 1;
}

.admin-tab.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(249, 115, 22, 0.18));
  border-color: rgba(239, 68, 68, 0.6);
  color: #ef4444;
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.25);
}

/* ==================== TAB CONTENT ==================== */
.admin-tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.admin-tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== BUGS MONITORING ==================== */
.bugs-section {
  animation: slideIn 0.4s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.bugs-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.bug-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s;
}

.bug-stat-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

.bug-stat-icon {
  font-size: 2.5rem;
}

.bug-stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.bug-stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== CHARTS ==================== */
.chart-container {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(10px);
}

.chart-container h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1.5rem;
}

.chart-container canvas {
  max-height: 350px;
}

.chart-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.chart-card h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ==================== FILTERS ==================== */
.bugs-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.bugs-filters select {
  padding: 0.875rem 2.5rem 0.875rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-color);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.bugs-filters select:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-export {
  padding: 0.875rem 1.75rem;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-export:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

/* ==================== ERRORS TABLE ==================== */
.errors-table-container {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.errors-table {
  width: 100%;
  border-collapse: collapse;
}

.errors-table thead {
  background: rgba(255, 255, 255, 0.06);
}

.errors-table th {
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.errors-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.errors-table tbody tr {
  transition: all 0.25s;
}

.errors-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.errors-table tbody tr.error-resolved {
  opacity: 0.5;
  background: rgba(16, 185, 129, 0.08);
}

.severity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}

.severity-error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.severity-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.severity-info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.error-message {
  font-size: 0.95rem;
  line-height: 1.5;
}

.error-url {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-resolve {
  padding: 0.625rem 1.25rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  color: #10b981;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-resolve:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: scale(1.05);
}

.btn-delete {
  padding: 0.625rem 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #ef4444;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s;
  margin-left: 0.5rem;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.resolved-badge {
  color: #10b981;
  font-weight: 700;
}

/* ==================== ANALYTICS SECTION ==================== */
.analytics-section,
.performance-section,
.system-section {
  animation: slideIn 0.4s ease;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.user-activity-stats,
.feature-engagement,
.endpoints-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  margin-bottom: 2.5rem;
}

.user-activity-stats h3,
.feature-engagement h3,
.endpoints-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.activity-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
}

.activity-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

.activity-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.activity-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ==================== FEATURE ENGAGEMENT ==================== */
.engagement-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.engagement-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
}

.engagement-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.engagement-name {
  font-weight: 700;
  color: var(--text-color);
}

.engagement-users {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.engagement-bar {
  position: relative;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.engagement-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 8px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 1rem;
}

.engagement-percent {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: white;
  font-size: 0.85rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==================== PERFORMANCE SECTION ==================== */
.perf-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.perf-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.3s;
}

.perf-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

.perf-icon {
  font-size: 2.5rem;
}

.perf-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.perf-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 600;
}

.perf-warning {
  border-color: rgba(245, 158, 11, 0.4);
}

.perf-warning .perf-value {
  color: #f59e0b;
}

/* ==================== ENDPOINTS LIST ==================== */
.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.endpoint-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.25s;
}

.endpoint-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.endpoint-rank {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 48px;
  text-align: center;
}

.endpoint-info {
  flex: 1;
}

.endpoint-path {
  font-family: 'Monaco', 'Courier New', monospace;
  font-weight: 700;
  color: var(--text-color);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.endpoint-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==================== SYSTEM SECTION ==================== */
.health-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  backdrop-filter: blur(10px);
}

.health-card.health-healthy {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.health-card.health-degraded {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}

.health-card.health-unhealthy {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.05);
}

.health-status {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.health-emoji {
  font-size: 4rem;
}

.health-status h3 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-color);
}

.health-label {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.health-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.health-item {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.health-icon {
  font-size: 2.5rem;
}

.health-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

.stat-icon {
  font-size: 3rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==================== MEMBERS TABLE ==================== */
.members-table {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.members-table table {
  width: 100%;
  border-collapse: collapse;
}

.members-table thead {
  background: rgba(255, 255, 255, 0.06);
}

.members-table th {
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.members-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-color);
}

.members-table tbody tr {
  transition: all 0.25s;
}

.members-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ==================== EMPTY STATE ==================== */
.empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.125rem;
  font-weight: 500;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.125rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  
  .realtime-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-dashboard {
    padding: 1.5rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .admin-header h1 {
    font-size: 2rem;
  }

  .admin-tabs {
    flex-direction: column;
  }

  .bugs-filters {
    flex-direction: column;
  }

  .errors-table-container {
    overflow-x: auto;
  }
}
