/**
 * Writing Correction Modal Styles
 */

.modal-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  overflow: auto;
}

/* Ensure Tippy tooltips appear above modal */
.tippy-box {
  z-index: 10002 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.modal-dialog {
  position: relative;
  background: white;
  border-radius: 15px;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  margin: 2rem auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #666;
  cursor: pointer;
  z-index: 10001;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background-color: #f0f0f0;
  color: #000;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

/* Ensure writing correction component fits in modal */
.modal-body .teacher-view-component {
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Submission pill styles - shared across progress.html and students-writing.html */
.submission-pill {
  padding: 0.3rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: white;
  transition: transform 0.2s ease;
  display: inline-block;
  margin: 0.2rem;
  cursor: pointer;
}

.submission-pill:hover {
  transform: scale(1.05);
}

/* Graduated color scale for pass/fail pills */
.submission-excellent {
  background-color: #4a9b5a; /* Dark green - well above pass mark */
}

.submission-pass {
  background-color: #81c784; /* Light green - pass to pass+10% */
}

.submission-close-miss {
  background-color: #ffb74d; /* Light orange - pass-10% to pass */
}

.submission-fail {
  background-color: #e57373; /* Light red - below pass-10% */
}

.submission-pending {
  background-color: #f39c12;
}

.submission-pending:hover {
  background-color: #e67e22;
}

.submission-pending-grey {
  background-color: #999;
}

.submission-pending-grey:hover {
  background-color: #777;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .modal-dialog {
    width: 98%;
    max-height: 95vh;
    margin: 1rem auto;
    border-radius: 10px;
  }

  .modal-body {
    padding: 1rem;
  }

  .modal-close {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  .modal-dialog {
    width: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }

  .modal-body {
    padding: 0.5rem;
  }
}
