.main {
  display: flex;
  gap: 20px;
  align-items: flex-start; /* Prevent stretching */
}
.left-col {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 20px;
  height: fit-content; /* Ensure it doesn't take full height if content is short */
}
.right-col {
  width: 500px; /* Increased width for better readability of detailed content */
  flex-shrink: 0;
  overflow-y: auto; /* Enable internal scrolling */
  padding-right: 5px; /* Prevent scrollbar overlap */
}
/* Custom scrollbar for right-col */
.right-col::-webkit-scrollbar {
  width: 6px;
}
.right-col::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.right-col::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.right-col::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}
.box-title-result-task {
}
.box-title-result-task:first-child {
  margin-top: 0;
}
.box-title-result-task span {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
}
.toggle-errors-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: #666;
}
.toggle-errors-label img {
  width: 16px;
  height: 16px;
}
.box {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #eee;
}
.question-box .question-text {
  font-size: 15px;
  line-height: 1.7;
  color: #444;
  margin: 0;
}
.essay-box .essay-text {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
  margin: 0;
}
.score-box {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.score-box .circle {
}
.score-box .circle::before {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 50%;
}
.score-box .circle-text {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 700;
  color: #333;
}
.score-right {
  flex: 1;
}
.score-item {
  margin-bottom: 12px;
}
.score-item:last-child {
  margin-bottom: 0;
}
.score-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.score-value {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
}
.progress {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.error-category-container-result-task {
  display: flex;
  gap: 20px;
}
.error-category-container-result-task .col {
}
.error-category-container-result-task .divider {
  width: 1px;
  background: #eee;
}
.error-category-container-result-task .item {
}
.error-category-container-result-task .dot {
}
.error-category-container-result-task .label {
}
.switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #4caf50;
}
input:checked + .slider:before {
  transform: translateX(16px);
}
.card-wrapper-result-task {
}
.card-result-task {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #eee;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  position: relative;
}
.card-result-task.success-result-task {
  border-color: #4caf50;
  background: linear-gradient(to bottom, #e8f5e9, #fff);
}
.score-line-result-task {
  margin-bottom: 8px;
}
.score-result-task {
  font-size: 28px;
  font-weight: 700;
  color: #333;
}
.score-red-result-task {
  color: #e90206;
}
.score-yellow-result-task {
  color: #fc0;
}
.check-icon-result-task {
}
.check-icon-result-task img {
  width: 20px;
  height: 20px;
}
.card-result-task .title-result-task {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.card-result-task .target-result-task {
  font-size: 11px;
  color: #999;
}
.view-detail-hint {
  font-size: 10px;
  color: #1976d2;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
  opacity: 0;
  transition: opacity 0.2s;
}
.card-result-task:hover .view-detail-hint {
  opacity: 0;
}
.card-result-task {
  transition: transform 0.2s, box-shadow 0.2s;
}
.card-result-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.criterion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #eee;
}
.criterion-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
}
.criterion-score {
  display: flex;
  align-items: center;
}
.score-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.criterion-feedback {
  background: #f8f9fa;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.criterion-feedback p {
  font-size: 14px;
  line-height: 1.7;
  color: #444;
  margin: 0;
}
.criterion-tips {
  background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid #4caf50;
}
.criterion-tips h4 {
  font-size: 14px;
  font-weight: 600;
  color: #2e7d32;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}
.criterion-tips h4 i {
  margin-right: 6px;
  color: #ffc107;
}
.criterion-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.criterion-tips ul li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 13px;
  color: #555;
}
.criterion-tips ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #4caf50;
  font-weight: bold;
}
.sample-box {
  position: relative;
}
.sample-box .essay-text {
  font-size: 14px;
  line-height: 1.8;
  color: #444;
  max-height: 300px;
  overflow-y: auto;
}
.icons-wrapper-result-task {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.icon-pen-result-task,
.icon-refresh-result-task {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  color: #555;
}
.icon-pen-result-task:hover,
.icon-refresh-result-task:hover {
  background: #e0e0e0;
}
.icon-refresh-result-task {
  position: relative;
}
.icon-refresh-result-task img {
  width: 16px;
  height: 16px;
}
.badge-new-result-task {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff5722;
  color: #fff;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}
.detail-tabs {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
}
.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 12px;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover {
  background: #e0e0e0;
}
.tab-btn.active {
  background: #1976d2;
  color: #fff;
}
.tab-content {
  /* display: none; */
}
.tab-content.active {
  display: block;
}
.section {
  margin-bottom: 24px;
}
.section:last-child {
  margin-bottom: 0;
}
.section h4 {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}
.list-dash {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-dash li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}
.list-dash li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: #999;
}
.grammar-error-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grammar-error-item {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}
.error-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.correction-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.correction-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
}
.correction-original,
.correction-fixed {
  margin-bottom: 8px;
}
.correction-original .label,
.correction-fixed .label,
.correction-reason .label {
  font-weight: 600;
  font-size: 12px;
  color: #888;
  margin-right: 8px;
}
.correction-original del {
  background: #ffcdd2;
  padding: 2px 6px;
  border-radius: 3px;
  text-decoration: line-through;
  color: #c62828;
}
.correction-fixed ins {
  background: #c8e6c9;
  padding: 2px 6px;
  border-radius: 3px;
  text-decoration: none;
  color: #2e7d32;
}
.correction-arrow {
  color: #999;
  margin: 4px 0;
}
.correction-reason {
  margin-top: 8px;
  font-size: 13px;
  color: #666;
  font-style: italic;
}
.overall-comment {
  background: #e3f2fd;
  padding: 16px;
  border-radius: 8px;
}
.overall-comment h5 {
  margin-bottom: 8px;
  color: #1565c0;
}
.action-bar {
  padding: 20px 0;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
.table th {
  background: #f5f5f5;
  font-weight: 600;
  font-size: 13px;
  color: #555;
}
.table tbody tr:hover {
  background: #fafafa;
}
@media (max-width: 1024px) {
  .main {
    flex-direction: column;
  }
  .right-col {
    width: 100%;
  }
  .score-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .card-wrapper-result-task {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 768px) {
  .card-wrapper-result-task {
    grid-template-columns: repeat(2, 1fr);
  }
  .error-category-container-result-task {
    flex-direction: column;
  }
  .error-category-container-result-task .divider {
    width: 100%;
    height: 1px;
  }
  .tab-nav {
    flex-wrap: wrap;
  }
  .tab-btn {
    flex: 1;
    min-width: 120px;
  }
}
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}
.alert-warning {
  background: #fff3e0;
  border: 1px solid #ffb74d;
  color: #e65100;
}
.alert-danger {
  background: #ffebee;
  border: 1px solid #ef5350;
  color: #c62828;
}
.processing-alert {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Deep Analysis Enhancements */
.badge.category-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  color: #6c757d;
}

.grammar-error-item {
  position: relative; /* For badge positioning */
  background: white;
  border: 1px solid #eee;
  border-left: 4px solid #ffc107;
  margin-bottom: 12px;
  padding: 16px;
  border-radius: 8px;
  transition: all 0.2s;
}

.grammar-error-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background: #fffdf5;
}

/* Structure Analysis Acetone Style */
.accordion-item {
  border: 1px solid #f0f0f0;
  margin-bottom: 12px;
  border-radius: 8px !important;
  overflow: hidden;
}
.accordion-button {
  background-color: #fff;
  color: #333;
  font-weight: 600;
  box-shadow: none !important;
  padding: 16px 20px;
}
.accordion-button:not(.collapsed) {
  background-color: #f8fbff;
  color: #1976d2;
}
.accordion-body {
  padding: 20px;
  font-size: 14px;
  line-height: 1.7;
  background-color: #fcfcfc;
  border-top: 1px solid #f0f0f0;
}

/* Improvement Text Styling */
.custom-improvement-text {
  display: block;
  margin-top: 4px;
  font-size: 0.95em;
  color: #333;
  line-height: 1.5;
  background: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #e0e0e0;
}

/* Evidence Quote Highlighting */
.evidence-quote {
  font-style: italic;
  color: #2c3e50;
  font-weight: 500;
  background-color: rgba(0, 0, 0, 0.03);
  padding: 0 4px;
  border-radius: 4px;
}

/* === TAB INTERFACE css structure === */
.detail-tabs .tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 25px;
  background: #fff;
  position: sticky;
  top: 60px;
  /* Below fixed header */
  z-index: 90;
  padding-top: 10px;
}

.detail-tabs .tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s;
  font-size: 0.95rem;
  border-radius: 5px 5px 0 0;
}

.detail-tabs .tab-btn:hover {
  color: #1e293b;
  background-color: #f1f5f9;
}

.detail-tabs .tab-btn.active {
  color: #e90206;
  border-bottom-color: #e90206;
  font-weight: 700;
  background-color: #fff;
}

/* Content Animation */
.detail-tabs .tab-content {
  display: none;
  animation: fadeSlideUp 0.4s ease-out;
}

.detail-tabs .tab-content.active {
  display: block;
}

/* Fix for NESTED tab contents (like in Sample Essays) */
.detail-tabs .tab-content .tab-content {
  display: block !important; /* Reset display to default bootstrap behavior */
  animation: none;
}
.detail-tabs .tab-content .tab-pane {
  display: none; /* Bootstrap standard */
}
.detail-tabs .tab-content .tab-pane.active {
  display: block; /* Bootstrap standard */
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === BADGES & VISUALS === */
.score-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 50px;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.sub-criterion-item {
  transition: transform 0.2s, box-shadow 0.2s;
  border-left-width: 5px !important;
}

.sub-criterion-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  background-color: #fff !important;
}

.badge {
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* === DEEP COACH STYLES === */
.deep-coach-card {
  border-left: 5px solid #8b5cf6;
  /* Violet */
}

.accordion-button:not(.collapsed) {
  background-color: #f5f3ff;
  color: #7c3aed;
  font-weight: 700;
}

.accordion-button:focus {
  box-shadow: none;
  border-color: rgba(139, 92, 246, 0.1);
}

/* Improvement Text */
.custom-improvement-text {
  font-family: "Inter", system-ui, sans-serif;
  color: #334155 !important;
  line-height: 1.6;
}
