:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --acierto: #10b981;
  --pista: #f59e0b;
  --error: #ef4444;
  --metodo: #3b82f6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
header {
  background-color: #0f172a;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #3b82f6;
  z-index: 100;
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand span {
  font-size: 0.82rem;
  color: #94a3b8;
  font-weight: normal;
}

.student-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

select#studentSelect {
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.btn-icon {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #334155;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #334155;
  color: #fff;
}
.btn-secondary:hover {
  background: #475569;
}

.btn-success {
  background: #10b981;
  color: #fff;
}
.btn-success:hover {
  background: #059669;
}

/* App Main Container */
.app-container {
  display: flex;
  flex: 1;
  height: calc(100vh - 58px);
  overflow: hidden;
}

/* Left Pane: Image Viewer */
.viewer-pane {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  background: #1e293b;
  position: relative;
  border-right: 1px solid var(--border);
}

.page-tabs-bar {
  background: #0f172a;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #334155;
}

.page-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.page-tab {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.page-tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #3b82f6;
}

.viewer-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  color: #94a3b8;
  font-size: 0.8rem;
}

.canvas-viewport {
  flex: 1;
  overflow: auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  background: #1e293b;
}

.image-canvas-container {
  position: relative;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  background: #fff;
  line-height: 0;
  user-select: none;
}

#examImage {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: auto;
  cursor: crosshair;
}

/* Pin Badges */
.pin-badge {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  cursor: grab;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 10;
}

.pin-badge:hover {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.pin-badge.pin-acierto { background: var(--acierto); }
.pin-badge.pin-pista { background: var(--pista); }
.pin-badge.pin-error { background: var(--error); }
.pin-badge.pin-metodo { background: var(--metodo); }

/* Right Pane: Feedback Panel */
.editor-pane {
  flex: 0.9;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px 20px;
  gap: 16px;
}

.student-card {
  background: #fff;
  border-radius: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-info h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.student-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.status-badge.reviewed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.status-badge.pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* General Feedback Box */
.card-section {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

textarea.general-fb-input {
  width: 100%;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  color: #1e293b;
  outline: none;
}

textarea.general-fb-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Quick Snippets Chips */
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.75rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Annotation Items */
.annotations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ann-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 12px 14px;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s;
}

.ann-card.highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

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

.ann-badge-pill {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  margin-right: 8px;
}

.ann-type-select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.ann-title-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  outline: none;
}

.ann-text-input {
  width: 100%;
  height: 65px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  color: #334155;
  outline: none;
}

.ann-delete-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
}

.ann-delete-btn:hover {
  color: #ef4444;
}

.save-indicator {
  font-size: 0.8rem;
  color: #10b981;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}

.save-indicator.visible {
  opacity: 1;
}

/* Empty State */
.empty-ann-state {
  text-align: center;
  padding: 25px 15px;
  color: #94a3b8;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  font-size: 0.85rem;
}
