/**
 * E-Scoring Modern Design System
 * Clean, Responsive, High Performance CSS
 */

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;

  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.15);

  --emerald: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.15);

  --gold: #f59e0b;
  --gold-light: rgba(245, 158, 11, 0.15);

  --silver: #94a3b8;
  --bronze: #d97706;

  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.25);
}

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Container & Layout */
.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
}

/* Header & Navbar */
.app-header {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Navigation Badges & Buttons */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-role-tag {
  background: var(--primary);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-success { background: var(--emerald-light); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: var(--gold-light); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger  { background: var(--danger-light); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-primary { background: var(--primary-light); color: #60a5fa; border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-neutral { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); border: 1px solid var(--border-color); }

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

/* Scoring Rubric Input Box (Touch Friendly) */
.rubric-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.rubric-box:focus-within {
  border-color: #3b82f6;
  background: rgba(15, 23, 42, 0.9);
  transform: scale(1.01);
}

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

.rubric-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #f1f5f9;
}

.rubric-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.rubric-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rubric-number-input {
  width: 100%;
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-md);
  background: #090d16;
  border: 2px solid #334155;
  color: #60a5fa;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.rubric-number-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.quick-stepper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-step {
  background: #1e293b;
  border: 1px solid #334155;
  color: #fff;
  width: 44px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.btn-step:active {
  background: var(--primary);
}

/* Modern Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: rgba(15, 23, 42, 0.9);
  padding: 14px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.custom-table td {
  padding: 16px 18px;
  font-size: 0.925rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Alerts */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success { background: var(--emerald-light); border: 1px solid rgba(16, 185, 129, 0.3); color: #a7f3d0; }
.alert-danger  { background: var(--danger-light); border: 1px solid rgba(239, 68, 68, 0.3); color: #fecaca; }
.alert-warning { background: var(--gold-light); border: 1px solid rgba(245, 158, 11, 0.3); color: #fde68a; }
.alert-info    { background: var(--primary-light); border: 1px solid rgba(37, 99, 235, 0.3); color: #bfdbfe; }

/* Grid utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .app-header {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
