/* ACTOE Review UI Styles */

:root {
  --primary-color: #3b82f6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --background: #f9fafb;
  --surface: #ffffff;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

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

/* Header */
.header {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.header-content {
  margin-bottom: 20px;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

.back-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.8;
}

/* Statistics Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-color), #2563eb);
  color: white;
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.empty-state svg {
  color: var(--success-color);
  margin-bottom: 20px;
}

.empty-state h2 {
  font-size: 1.75rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.hidden {
  display: none !important;
}

/* Progress Bar */
.progress-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--success-color));
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}

/* Review Card */
.review-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  min-height: 600px;
}

.visualization-panel,
.decision-panel {
  padding: 30px;
}

.visualization-panel {
  background: #f8f9fa;
  border-right: 1px solid var(--border-color);
}

.visualization-panel h3,
.decision-panel h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Visualization Canvas */
.viz-container {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#vizCanvas {
  max-width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

.word-highlight {
  background: #fef3c7;
  border-left: 4px solid var(--warning-color);
  padding: 15px;
  border-radius: var(--radius-sm);
}

.word-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-left: 10px;
}

/* Assignment Info */
.assignment-info {
  background: #f8f9fa;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 25px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.info-value {
  font-weight: 500;
  color: var(--text-primary);
}

.probability-badge {
  background: var(--warning-color);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Alternatives Section */
.alternatives-section {
  margin-bottom: 25px;
}

.alternatives-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.alternatives-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alternative-item {
  background: #f8f9fa;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alternative-item:hover {
  border-color: var(--primary-color);
  background: #eff6ff;
}

.alternative-info {
  flex: 1;
}

.alternative-id {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.alternative-type {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.alternative-probability {
  background: var(--primary-color);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Action Buttons */
.action-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.25rem;
}

.btn-shortcut {
  position: absolute;
  top: 5px;
  right: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-correct {
  background: var(--success-color);
  color: white;
}

.btn-correct:hover {
  background: #059669;
}

.btn-reassign {
  background: var(--warning-color);
  color: white;
}

.btn-reassign:hover {
  background: #d97706;
}

.btn-remove {
  background: var(--danger-color);
  color: white;
}

.btn-remove:hover {
  background: #dc2626;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #2563eb;
}

.btn-secondary {
  background: var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: #d1d5db;
}

.navigation-buttons {
  display: flex;
  gap: 10px;
}

.navigation-buttons .btn {
  flex: 1;
}

/* Keyboard Hints */
.keyboard-hints {
  background: #111827;
  color: white;
  padding: 15px 20px;
  border-radius: var(--radius-md);
  margin-top: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.keyboard-hints strong {
  margin-right: 10px;
}

.keyboard-hints span {
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}

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

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 500px;
  width: 90%;
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

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

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

.modal-body {
  padding: 30px;
}

.modal-body label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
}

.input-field {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
}

.modal-hint {
  margin-top: 15px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
  .review-card {
    grid-template-columns: 1fr;
  }

  .visualization-panel {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .action-buttons {
    grid-template-columns: 1fr;
  }

  .keyboard-hints {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
