/* ClassQuiz Admin Panel Stylesheet */

:root {
  --font-family: 'Outfit', sans-serif;
  
  --bg-dark: #090d16;
  --bg-card: #131926;
  --bg-input: #1b2336;
  --border-color: #263147;
  
  --primary: #6366f1;
  --secondary: #a855f7;
  --success: #10b981;
  --error: #f43f5e;
  --warning: #f59e0b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 40px 20px;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Floating background blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.12;
  z-index: 0;
  pointer-events: none;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background-color: var(--primary);
  top: -10%;
  left: 5%;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background-color: var(--secondary);
  bottom: -10%;
  right: 5%;
}

/* Admin Container */
#admin-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 10;
  position: relative;
}

/* Header styling */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo-icon {
  font-size: 2.2rem;
}

.logo-area h2 {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-area p {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Metrics Dashboard */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.metric-info h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.metric-info h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
}

.metric-info h2.premium-text {
  color: var(--secondary);
}

.metric-icon {
  font-size: 2.5rem;
  background-color: var(--bg-input);
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

/* Split content layouts */
.dashboard-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 30px;
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

.table-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* Custom Table Layouts */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:hover td {
  background-color: rgba(99, 102, 241, 0.05);
  color: white;
}

/* Buttons */
.btn {
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.5);
}

/* Custom badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  text-transform: uppercase;
}

.badge-free {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-premium {
  background-color: rgba(168, 85, 247, 0.1);
  color: var(--secondary);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.text-success { color: var(--success); font-weight: bold; }
.text-error { color: var(--error); font-weight: bold; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Custom Scrollbars */
.table-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Responsive queries */
@media (max-width: 1024px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body { padding: 20px 10px; }
  .admin-header { flex-direction: column; align-items: stretch; gap: 15px; padding: 15px; }
  .logo-area { gap: 10px; }
}
