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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  color: #333;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Login Screen */
.login-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container h1 {
  color: white;
  margin-bottom: 40px;
  font-size: 32px;
}

#login-form {
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.error-message {
  color: #e74c3c;
  margin-top: 10px;
  font-size: 14px;
}

/* Buttons */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #667eea;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background-color: #5568d3;
}

.btn-secondary {
  background-color: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background-color: #d0d0d0;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-info {
  background-color: #3498db;
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-info:hover {
  background-color: #2980b9;
}

.btn-warning {
  background-color: #f39c12;
  color: white;
  padding: 6px 12px;
  font-size: 12px;
}

.btn-warning:hover {
  background-color: #e67e22;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 4px;
  background-color: white;
  padding: 0 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn {
  padding: 14px 20px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  color: #333;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Charts */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}

.chart-card {
  background-color: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 15px;
}

.chart-card h2 {
  font-size: 16px;
  margin-bottom: 12px;
}

.chart-empty-msg {
  text-align: center;
  color: #999;
  padding: 40px 0;
}

.insights-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 500px;
}

.insights-summary-grid .stat-item {
  padding: 10px 12px;
}

.insights-summary-grid .stat-count {
  font-size: 16px;
}

/* Main Screen */
.header {
  background-color: white;
  padding: 20px 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 24px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.container {
  display: flex;
  gap: 20px;
  padding: 20px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  flex: 0 0 250px;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  height: fit-content;
}

.sidebar h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

.stats-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: #f9f9f9;
  border-radius: 4px;
  border-left: 4px solid #667eea;
}

.stat-label {
  font-weight: 500;
  font-size: 14px;
}

.stat-count {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
}

.main-content {
  flex: 1;
}

.filters {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.filters h2 {
  font-size: 18px;
  margin-bottom: 15px;
}

.filter-group {
  margin-bottom: 12px;
}

.filter-group label {
  display: inline-block;
  width: 100px;
  font-weight: 500;
  font-size: 14px;
}

.filter-group select {
  width: 200px;
}

#apply-filters-btn {
  width: auto;
  margin-top: 10px;
}

.exercises {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exercises h2 {
  font-size: 18px;
  margin-bottom: 20px;
}

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.exercise-group {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fff;
}

.exercise-group > summary {
  cursor: pointer;
  padding: 12px 15px;
  font-weight: 600;
  text-transform: capitalize;
}

.exercise-group[open] > summary {
  border-bottom: 1px solid #e0e0e0;
}

.exercise-group .exercise-item {
  border: none;
  border-top: 1px solid #eee;
  border-radius: 0;
}

.exercise-group .exercise-item:first-of-type {
  border-top: none;
}

.exercise-item {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 15px;
  background-color: #fafafa;
  transition: all 0.2s;
}

.exercise-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.exercise-meta {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: #666;
  flex-wrap: wrap;
}

.exercise-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  background-color: #e0e0e0;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pending {
  background-color: #fff3cd;
  color: #856404;
}

.badge-reviewed {
  background-color: #d4edda;
  color: #155724;
}

.badge-ambiguous {
  background-color: #f8d7da;
  color: #721c24;
}

.badge-deleted {
  background-color: #d3d3d3;
  color: #505050;
}

.badge-premium {
  background-color: #d4edda;
  color: #155724;
}

.badge-premium_plus {
  background-color: #e7d9fb;
  color: #4a2a82;
}

.badge-free {
  background-color: #d3d3d3;
  color: #505050;
}

.badge-admin {
  background-color: #cce5ff;
  color: #004085;
}

.badge-learner {
  background-color: #d3d3d3;
  color: #505050;
}

.exercise-instruction {
  font-size: 13px;
  font-style: italic;
  color: #999;
  margin-bottom: 6px;
}

.exercise-review-reason {
  font-size: 13px;
  color: #721c24;
  background-color: #f8d7da;
  border-radius: 3px;
  padding: 6px 10px;
  margin-bottom: 6px;
}

.exercise-prompt {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.exercise-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}

.exercise-option {
  padding: 6px 10px;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 3px;
}

.exercise-option.correct {
  background-color: #d4edda;
  border-color: #155724;
  font-weight: 500;
}

.exercise-answer-info {
  display: flex;
  gap: 20px;
  font-size: 13px;
  margin-bottom: 12px;
}

.exercise-answer-info span {
  display: flex;
  flex-direction: column;
}

.exercise-answer-info strong {
  font-weight: 600;
  color: #333;
}

.exercise-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

#page-info {
  font-size: 14px;
  font-weight: 500;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h2 {
  font-size: 20px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
}

.close-btn:hover {
  color: #000;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  flex: 1;
}
