/* =========================================
   Dashboard Layout
   ========================================= */

.dashboard-content {
  padding: 24px;
  background: #f8f9fa;
  min-height: calc(100vh - 70px);
  overflow-y: auto;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  transition: all 0.3s ease;
}

.btn i {
  font-size: 16px;
}

.btn-primary {
  background: #2E7D32;
  color: white;
}

.btn-primary:hover {
  background: #1B5E20;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.btn-outline {
  background: white;
  border: 1px solid #e0e0e0;
  color: #666;
}

.btn-outline:hover {
  background: #f5f5f5;
  border-color: #2E7D32;
  color: #2E7D32;
}

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

/* Date Range Selector */
.date-range {
  margin-bottom: 24px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.date-range-selector {
  display: flex;
  gap: 8px;
}

.date-range-btn {
  padding: 8px 16px;
  border: 1px solid #e0e0e0;
  background: white;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.date-range-btn:hover {
  border-color: #2E7D32;
  color: #2E7D32;
}

.date-range-btn.active {
  background: #2E7D32;
  color: white;
  border-color: #2E7D32;
}

.date-picker {
  margin-top: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.date-picker.hidden {
  display: none;
}

.date-input {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

/* =========================================
   Skeleton Loader
   ========================================= */

.skeleton-loader {
  animation: skeleton-loading 1.5s infinite ease-in-out;
}

.skeleton-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.skeleton-title {
  width: 200px;
  height: 36px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
}

.skeleton-actions {
  width: 200px;
  height: 40px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.skeleton-card {
  height: 120px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 12px;
}

.skeleton-chart {
  margin-bottom: 24px;
}

.skeleton-chart-header {
  width: 100%;
  height: 40px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  margin-bottom: 16px;
}

.skeleton-chart-body {
  width: 100%;
  height: 300px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.skeleton-table {
  height: 200px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
}

.skeleton-activity {
  height: 200px;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

/* =========================================
   Metrics Cards
   ========================================= */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #2E7D32;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.15);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-title {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(46, 125, 50, 0.1);
  color: #2E7D32;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.metric-trend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.trend-up {
  color: #4CAF50;
}

.trend-down {
  color: #f44336;
}

.trend-neutral {
  color: #FFC107;
}

.trend-badge {
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(76, 175, 80, 0.1);
  color: #4CAF50;
  font-weight: 500;
}

/* =========================================
   Charts
   ========================================= */

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

.chart-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.chart-select {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* =========================================
   Activity & Top Content
   ========================================= */

.activity-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.activity-card, .top-content-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.view-all-link {
  color: #2E7D32;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-all-link:hover {
  text-decoration: underline;
}

.content-select {
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 13px;
}

/* Activity Feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8f9fa;
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: #f0f0f0;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.activity-icon.user { background: rgba(33, 150, 243, 0.1); color: #2196F3; }
.activity-icon.post { background: rgba(76, 175, 80, 0.1); color: #4CAF50; }
.activity-icon.report { background: rgba(244, 67, 54, 0.1); color: #f44336; }
.activity-icon.scholar { background: rgba(255, 152, 0, 0.1); color: #FF9800; }

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: #999;
}

/* Top Content List */
.top-content-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.top-content-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f8f9fa;
}

.top-content-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2E7D32;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.top-content-info {
  flex: 1;
}

.top-content-title {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.top-content-meta {
  font-size: 12px;
  color: #999;
  display: flex;
  gap: 12px;
}

.top-content-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2E7D32;
  font-size: 13px;
  font-weight: 500;
}

/* =========================================
   Quick Actions
   ========================================= */

.quick-actions {
  margin-bottom: 24px;
}

.quick-actions h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
}

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

.action-card {
  background: white;
  border: none;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.15);
  border-color: #2E7D32;
}

.action-card i {
  font-size: 32px;
  color: #2E7D32;
}

.action-card span {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}

.action-card .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #f44336;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 20px;
  min-width: 24px;
  text-align: center;
}

/* =========================================
   System Health
   ========================================= */

.system-health {
  margin-bottom: 24px;
}

.system-health h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.health-item {
  background: white;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.health-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 auto 8px;
}

.health-status.operational { background: #4CAF50; box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2); }
.health-status.degraded { background: #FFC107; box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.2); }
.health-status.down { background: #f44336; box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.2); }

.health-label {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.health-value {
  font-size: 12px;
  color: #666;
}

/* =========================================
   Utilities
   ========================================= */

.hidden {
  display: none !important;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .health-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-content {
    padding: 16px;
  }
  
  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .charts-row,
  .activity-row {
    grid-template-columns: 1fr;
  }
  
  .date-range-selector {
    flex-wrap: wrap;
  }
  
  .date-picker {
    flex-direction: column;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .health-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


