/**
 * Admin Dashboard Styles
 * Uses design-tokens.css for theming
 */

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.header {
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.stat-card {
  background-color: var(--color-surface);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--spacing-xs);
}

.stat-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.search-input {
  flex: 1;
}

/* Bulk Actions Toolbar */
.bulk-actions-toolbar {
  background-color: var(--color-surface-variant);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-lg);
  border: 2px solid var(--color-primary);
}

/* States */
.loading {
  text-align: center;
  padding: var(--spacing-3xl);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto var(--spacing-md);
  border: 3px solid var(--color-surface-variant);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error-state,
.empty-state {
  text-align: center;
  padding: var(--spacing-3xl);
}

/* Table Enhancements */
.table-container {
  margin-bottom: var(--spacing-lg);
}

.table th {
  position: sticky;
  top: 0;
  z-index: 10;
}

.table td {
  vertical-align: middle;
}

.table .checkbox-cell {
  width: 40px;
  text-align: center;
}

.table .checkbox-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.table .actions {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.table .slug-cell {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: var(--font-size-xs);
  color: var(--color-primary);
}

.table .slug-cell a {
  color: var(--color-primary);
  text-decoration: none;
}

.table .slug-cell a:hover {
  text-decoration: underline;
}

.table .title-cell {
  font-weight: var(--font-weight-medium);
}

.table .views-cell {
  text-align: center;
  font-weight: var(--font-weight-medium);
}

.table .size-cell {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

.table .date-cell {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
}

/* Expiration Badge Colors */
.badge-expiring-soon {
  background-color: rgba(245, 158, 11, 0.2);
  color: var(--color-warning);
}

.badge-expiring-normal {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

/* Analytics Badges */
.badge-popular {
  background-color: rgba(74, 144, 226, 0.2);
  color: var(--color-primary);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--spacing-lg);
}

.modal-content {
  background-color: var(--color-surface);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
  }

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

  .table {
    min-width: 800px;
  }
}
