/**
 * Essays View Styles
 * Styling for essay list and essay results views
 */

/* ========================================
   ESSAY LIST STYLES
   ======================================== */

.essays-table-header {
  display: grid;
  grid-template-columns: 60px 2fr 180px 100px 140px 140px;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  font-weight: 600;
  font-size: 0.875rem;
  color: #495057;
}

.essay-row {
  display: grid;
  grid-template-columns: 60px 2fr 180px 100px 140px 140px;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #dee2e6;
  align-items: center;
  transition: background 0.2s ease;
  cursor: pointer;
}

.essay-row:hover {
  background: #f8f9fa;
}

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

/* In-progress essays with animation */
.essay-in-progress {
  background: linear-gradient(90deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Essay row elements */
.essay-num {
  text-align: center;
  font-weight: 600;
  color: #6c757d;
}

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

.essay-icon {
  width: 40px;
  height: 40px;
  background: #f1f3f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.essay-date {
  font-size: 0.875rem;
  color: #6c757d;
}

.essay-score {
  text-align: center;
}

.essay-status {
  text-align: center;
}

.essay-action {
  text-align: center;
}

/* Score badge */
.score-badge {
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

/* Pagination */
.pagination-container {
  padding: 1rem;
  border-top: 1px solid #dee2e6;
}

/* ========================================
   ESSAY RESULTS STYLES
   ======================================== */

/* Overall score card */
.overall-score-card {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: white;
  border: none;
}

.overall-score-card h5 {
  color: rgba(255, 255, 255, 0.9);
}

.overall-score-display {
  margin: 1rem 0;
}

.score-circle {
  display: inline-block;
  width: 120px;
  height: 120px;
  line-height: 120px;
  text-align: center;
  border-radius: 50%;
  background: white;
  color: #0d9488;
  font-weight: 700;
  font-size: 3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Criteria cards */
.criteria-card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.criteria-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.criteria-score-badge {
  display: inline-block;
  min-width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: white;
  font-weight: 700;
  font-size: 1.125rem;
}

.criteria-feedback {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #495057;
}

.criteria-feedback p {
  margin-bottom: 0.75rem;
}

.criteria-feedback p:last-child {
  margin-bottom: 0;
}

/* Essay content */
.essay-content {
  font-size: 1rem;
  line-height: 1.8;
  color: #212529;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Feedback content */
.feedback-content {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #495057;
}

.feedback-content p {
  margin-bottom: 1rem;
}

.feedback-content p:last-child {
  margin-bottom: 0;
}

.feedback-content ul,
.feedback-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.feedback-content li {
  margin-bottom: 0.5rem;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 991px) {
  .essays-table-header,
  .essay-row {
    grid-template-columns: 50px 1fr 100px 100px;
    gap: 0.75rem;
    padding: 1rem;
  }

  /* Hide date and status columns on medium screens */
  .essays-table-header .essay-date,
  .essay-row .essay-date,
  .essays-table-header .essay-status,
  .essay-row .essay-status {
    display: none;
  }

  .score-circle {
    width: 100px;
    height: 100px;
    line-height: 100px;
    font-size: 2.5rem;
  }
}

@media (max-width: 767px) {
  .essays-table-header {
    display: none; /* Hide header on mobile */
  }

  .essay-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
  }

  .essay-row .essay-num {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
  }

  .essay-row .essay-title {
    padding-right: 3rem; /* Make room for number */
  }

  .essay-row .essay-score,
  .essay-row .essay-action {
    text-align: left;
  }

  .score-circle {
    width: 90px;
    height: 90px;
    line-height: 90px;
    font-size: 2.25rem;
  }

  .criteria-score-badge {
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    font-size: 1rem;
  }
}

/* ========================================
   EMPTY STATE
   ======================================== */

#essays-empty {
  padding: 4rem 2rem;
}

#essays-empty i {
  font-size: 5rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .btn,
  .pagination-container,
  .card-header {
    display: none !important;
  }

  .overall-score-card {
    border: 2px solid #14b8a6 !important;
    color: #000 !important;
  }

  .score-circle {
    border: 2px solid #14b8a6;
  }

  .criteria-card {
    break-inside: avoid;
  }
}

/* ========================================
   BEFORE/AFTER HIGHLIGHTING
   For suggestions and action plan
   ======================================== */

/* Before text - what needs to be changed */
.before-text {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Georgia', serif;
  font-style: italic;
  text-decoration: line-through;
  text-decoration-color: #dc2626;
}

/* After text - the improved version */
.after-text {
  background-color: #d1fae5;
  color: #065f46;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Georgia', serif;
  font-weight: 500;
}

/* Labels for Before/After */
.before-label {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.875em;
}

.after-label {
  color: #059669;
  font-weight: 600;
  font-size: 0.875em;
}

/* Arrow between before and after */
.feedback-content .before-text + span,
.feedback-content .after-text {
  display: inline;
}

/* ========================================
   SEMANTIC FEEDBACK HIGHLIGHTING
   For criteria feedback and comments
   ======================================== */

/* Band descriptor quotes - highlighted as reference */
.band-descriptor {
  background-color: #e0f2fe;
  color: #0369a1;
  padding: 1px 4px;
  border-radius: 3px;
  font-style: italic;
}

/* "To reach Band X" advice - call to action */
.band-advice {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
  margin: 2px 0;
}

/* Error examples - what's wrong */
.error-example {
  background-color: #fee2e2;
  color: #991b1b;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'Georgia', serif;
}

/* Correction hint - the fix suggestion */
.correction-hint {
  color: #6b7280;
  font-size: 0.9em;
}

/* Correction text - the correct version */
.correction-text {
  background-color: #d1fae5;
  color: #065f46;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'Georgia', serif;
  font-weight: 500;
}

/* Statistics highlight - word counts, etc. */
.stat-highlight {
  background-color: #f3e8ff;
  color: #7c3aed;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* Error type labels - (spelling), (grammar), etc. */
.error-type {
  color: #dc2626;
  font-size: 0.85em;
  font-weight: 500;
}

/* Transition markers - First, Second, Third */
.transition-marker {
  color: #0d9488;
}

/* Improvement section - starts with "However" */
.improvement-section {
  padding-left: 0;
  margin-left: 0;
}

.improvement-marker {
  color: #d97706;
}

/* Band advice callout box - "To reach Band X" */
.band-advice-box {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-weight: 500;
  color: #065f46;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.band-advice-box i {
  color: #059669;
  font-size: 1.1em;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Improve criteria feedback readability */
.criteria-feedback {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #374151;
}

.criteria-feedback p {
  margin-bottom: 0.875rem;
}

.criteria-feedback p:last-child {
  margin-bottom: 0;
}

/* Print styles for highlighting */
@media print {
  .before-text {
    background-color: #f5f5f5;
    color: #666;
    text-decoration: line-through;
  }

  .after-text {
    background-color: #e8e8e8;
    color: #333;
    font-weight: bold;
  }

  .band-descriptor {
    background-color: #f0f0f0;
  }

  .band-advice {
    background: #f5f5f5;
    border: 1px solid #999;
  }

  .stat-highlight {
    background-color: #f0f0f0;
  }
}
