/* ============================================
   Pen Cloud Academy — Admin Dashboard Styles
   ============================================ */

.admin-layout .main-content {
  background: var(--color-gray-100);
}

.admin-tabs {
  display: flex;
  gap: 4px;
  padding: 0 40px;
  background: var(--color-white);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  overflow-x: auto;
}

.admin-tab {
  padding: 16px 24px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
}

.admin-tab:hover {
  color: var(--color-dark);
}

.admin-tab.active {
  color: var(--color-orange);
  border-bottom-color: var(--color-orange);
}

.admin-panel {
  display: none;
  padding: 32px 40px;
}

.admin-panel.active {
  display: block;
  animation: fadeIn var(--transition-base) ease;
}

/* Data tables */
.admin-table-wrapper {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.admin-table th,
.admin-table td {
  padding: 14px 20px;
  text-align: left;
  font-size: 0.9375rem;
}

.admin-table th {
  background: var(--color-cream);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-gray-500);
  border-bottom: 1px solid var(--color-gray-100);
}

.admin-table td {
  border-bottom: 1px solid var(--color-gray-100);
  color: var(--color-gray-700);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(254, 248, 224, 0.5);
}

.admin-table .user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-table .user-cell .user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

/* Toggle switch for paid status */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-gray-300);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-success);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Admin stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-dark);
}

.admin-stat-label {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
  margin-top: 4px;
}

/* Admin forms */
.admin-form-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.admin-form-card h3 {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-gray-100);
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* Question admin cards */
.admin-question-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.admin-question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--color-gray-500);
  margin-bottom: 8px;
}

.admin-question-text {
  color: var(--color-gray-700);
  line-height: 1.6;
}

/* Submission cards */
.submission-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.submission-info {
  flex: 1;
}

.submission-info h4 {
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.submission-info span {
  font-size: 0.8125rem;
  color: var(--color-gray-500);
}

/* Search bar */
.admin-search {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-search input {
  flex: 1;
  max-width: 400px;
  padding: 10px 16px 10px 40px;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  background: var(--color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23737373' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 14px center;
}

.admin-search input:focus {
  outline: none;
  border-color: var(--color-orange);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-panel {
    padding: 24px 16px;
  }

  .admin-tabs {
    padding: 0 16px;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }

  .admin-table-wrapper {
    overflow-x: auto;
  }

  .admin-table {
    min-width: 600px;
  }
}
