/* Lab Archive Styles */

#archive-app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header */
.archive-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

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

.archive-header .header-center {
  text-align: center;
  flex: 1;
}

.archive-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.archive-header .subtitle {
  margin: 0.5rem 0 0;
  opacity: 0.9;
  font-size: 1rem;
}

.back-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: white;
}

.user-status {
  background: rgba(255,255,255,0.15);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.btn-logout {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.2);
}

/* Login Gate */
.login-gate {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.login-card {
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.login-card h2 {
  color: #1a1a2e;
  margin: 0 0 0.5rem;
}

.login-card p {
  color: #666;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4361ee;
}

.btn-primary {
  background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.btn-large {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

.error-message {
  color: #dc3545;
  background: #ffe6e6;
  padding: 0.75rem;
  border-radius: 8px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Archive Content */
.archive-content {
  animation: fadeIn 0.3s ease;
}

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

/* Tabs */
.archive-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: #f8f9fa;
  padding: 0.5rem;
  border-radius: 12px;
}

.archive-tab {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  background: transparent;
  color: #666;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.archive-tab:hover {
  background: rgba(67, 97, 238, 0.1);
  color: #4361ee;
}

.archive-tab.active {
  background: white;
  color: #4361ee;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Archive Sections */
.archive-section {
  display: none;
}

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

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  color: #1a1a2e;
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.section-header p {
  color: #666;
  margin: 0;
}

/* Archive List */
.archive-list {
  display: grid;
  gap: 1rem;
}

.archive-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #eee;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.archive-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.archive-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.archive-card-date {
  font-size: 0.85rem;
  color: #888;
}

.archive-card-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-trivia {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-presentation {
  background: #e3f2fd;
  color: #1565c0;
}

.archive-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 0.5rem;
}

.archive-card-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: #666;
}

.archive-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.archive-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #4361ee;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
}

.archive-card-link:hover {
  background: #3a0ca3;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #888;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Admin Panel */
.admin-panel {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  border: 2px dashed #ddd;
}

.admin-panel h3 {
  color: #1a1a2e;
  margin: 0 0 1rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

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

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-large {
  max-width: 700px;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #333;
}

/* Trivia Detail */
.trivia-detail-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #eee;
}

.trivia-detail-header h2 {
  margin: 0 0 0.5rem;
  color: #1a1a2e;
}

.trivia-detail-meta {
  display: flex;
  gap: 1.5rem;
  color: #666;
  font-size: 0.9rem;
}

.trivia-questions-list {
  margin-bottom: 1.5rem;
}

.trivia-question-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.trivia-question-item .question-number {
  font-weight: 600;
  color: #4361ee;
  margin-bottom: 0.3rem;
}

.trivia-question-item .question-text {
  color: #333;
  margin-bottom: 0.5rem;
}

.trivia-question-item .correct-answer {
  color: #2e7d32;
  font-size: 0.9rem;
}

.trivia-leaderboard h3 {
  color: #1a1a2e;
  margin: 0 0 1rem;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.leaderboard-rank {
  font-weight: 600;
  color: #4361ee;
  width: 30px;
}

.leaderboard-name {
  flex: 1;
  color: #333;
}

.leaderboard-score {
  font-weight: 600;
  color: #2e7d32;
}

.leaderboard-item:nth-child(1) .leaderboard-rank { color: #ffd700; }
.leaderboard-item:nth-child(2) .leaderboard-rank { color: #c0c0c0; }
.leaderboard-item:nth-child(3) .leaderboard-rank { color: #cd7f32; }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  z-index: 2000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Loading */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #4361ee;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

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

/* Responsive */
@media (max-width: 768px) {
  .archive-header .header-content {
    flex-direction: column;
    text-align: center;
  }

  .archive-header .header-left,
  .archive-header .header-right {
    width: 100%;
    justify-content: center;
  }

  .archive-tabs {
    flex-direction: column;
  }
}
