@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0B0F19;
  --bg-card: rgba(22, 28, 45, 0.7);
  --bg-card-hover: rgba(30, 39, 63, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.25);
  
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --secondary: #06B6D4;
  --secondary-hover: #0891B2;
  
  --accent: #F59E0B;
  --accent-glow: rgba(245, 158, 11, 0.2);
  
  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.15);
  
  --danger: #EF4444;
  --danger-hover: #DC2626;
  
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients */
body::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Typography & Layouts */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-title {
  font-size: 1.5rem;
  background: linear-gradient(to right, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  border-bottom: 2px solid var(--primary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: rgba(99, 102, 241, 0.08);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.05);
}

/* Main Content Area */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Login Page Glass Panel */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
}

.login-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(95deg, var(--primary), var(--secondary));
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-role-select {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.role-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.role-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239CA3AF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
}

.btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.btn:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  box-shadow: 0 4px 15px var(--success-glow);
}
.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), var(--danger-hover));
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
}

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

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: fit-content;
}

.instructor-info {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.instructor-info h3 {
  font-size: 1.35rem;
  color: var(--text-primary);
}

.instructor-info p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.gugus-badge {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--border-glow);
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  display: inline-block;
  margin-top: 0.5rem;
}

.stat-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Tab Panels */
.main-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title h2 {
  font-size: 1.75rem;
  font-family: var(--font-display);
}

.panel-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

.tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: fit-content;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.6rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Kelompok Grid */
.kelompok-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.kelompok-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kelompok-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.kelompok-card.top-nominated {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.15);
}

.kelompok-card.top-nominated::after {
  content: '★ TERBAIK';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.kelompok-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.kelompok-title {
  font-size: 1.25rem;
  font-weight: bold;
}

.kelompok-score {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--secondary);
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  margin-bottom: 1.5rem;
}

.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
}

.member-role {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.member-name {
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-score {
  font-weight: 700;
  color: var(--text-primary);
}

.member-empty {
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.member-empty-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.member-empty-btn:hover {
  text-decoration: underline;
}

/* Student Cards (For grouping assignments) */
.student-assignment-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

@media (max-width: 1024px) {
  .student-assignment-grid {
    grid-template-columns: 1fr;
  }
}

.student-list-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.student-table-wrapper {
  overflow-x: auto;
  max-height: 600px;
}

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

.student-table th {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.student-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

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

/* Table score display and status badges */
.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: var(--transition);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Rubric Form Sliders */
.rubric-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.rubric-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.rubric-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.rubric-item-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  max-width: 80%;
}

.rubric-item-weight {
  font-size: 0.8rem;
  color: var(--secondary);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  height: fit-content;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.rubric-slider {
  flex: 1;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.rubric-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 10px var(--primary-glow);
}

.rubric-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--secondary);
}

.slider-value {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.grading-summary {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid var(--primary-glow);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grading-total-label {
  font-weight: 600;
  font-size: 1.1rem;
}

.grading-total-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary);
}

/* Juri Dashboard Layout */
.juri-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.juri-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-x: auto;
}

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

.juri-table th, .juri-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.juri-table th {
  color: var(--text-secondary);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
}

.juri-input-score {
  width: 80px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  color: white;
  font-family: inherit;
  font-weight: 600;
  text-align: center;
}

.juri-input-score:focus {
  border-color: var(--secondary);
  outline: none;
}

/* Leaderboard Page */
.leaderboard-ranks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.rank-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.rank-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Distinctive styling for podiums (Juara 1, 2, 3) */
.rank-card.juara-1 {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(22, 28, 45, 0.7) 0%, rgba(245, 158, 11, 0.05) 100%);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.1);
}

.rank-card.juara-1::before {
  content: '👑 JUARA 1';
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--accent);
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
}

.rank-card.juara-2 {
  border-color: #E2E8F0;
  background: linear-gradient(135deg, rgba(22, 28, 45, 0.7) 0%, rgba(226, 232, 240, 0.03) 100%);
}

.rank-card.juara-2::before {
  content: '🥈 JUARA 2';
  position: absolute;
  top: 16px;
  right: 16px;
  background: #E2E8F0;
  color: #000;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
}

.rank-card.juara-3 {
  border-color: #B45309;
  background: linear-gradient(135deg, rgba(22, 28, 45, 0.7) 0%, rgba(180, 83, 9, 0.03) 100%);
}

.rank-card.juara-3::before {
  content: '🥉 JUARA 3';
  position: absolute;
  top: 16px;
  right: 16px;
  background: #B45309;
  color: #fff;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
}

.rank-card.juara-4::before { content: '4th Place'; position: absolute; top: 16px; right: 16px; font-size: 0.75rem; color: var(--text-muted); font-weight: bold;}
.rank-card.juara-5::before { content: '5th Place'; position: absolute; top: 16px; right: 16px; font-size: 0.75rem; color: var(--text-muted); font-weight: bold;}
.rank-card.juara-6::before { content: '6th Place'; position: absolute; top: 16px; right: 16px; font-size: 0.75rem; color: var(--text-muted); font-weight: bold;}

.rank-number {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-display);
  line-height: 1;
  color: rgba(255, 255, 255, 0.05);
  margin-bottom: 0.5rem;
}

.rank-gugus-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.rank-group-num {
  font-size: 0.95rem;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.rank-scores-block {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

.rank-score-item {
  text-align: center;
}

.rank-score-lbl {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.rank-score-val {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.rank-score-val.highlight {
  color: var(--accent);
}

.leaderboard-table-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.leaderboard-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

/* Visualization Panel */
.chart-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  height: 340px;
}

/* Admin controls */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
@media(max-width:768px){
  .admin-grid { grid-template-columns: 1fr; }
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.admin-card h3 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.admin-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

/* Alert notifications banner */
.alert-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #FCA5A5;
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-banner.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #A7F3D0;
}

.alert-close {
  background: transparent;
  border: none;
  color: inherit;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.1rem;
}
