/* =========================================================
   NAAC APPEAL DOCUMENTS SPECIFIC STYLES
   ========================================================= */

/* Appeal Table */
.naac-appeal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}

.naac-appeal-table th {
  background: linear-gradient(135deg, #26428b 0%, #1a3372 100%);
  color: white;
  font-weight: 600;
  padding: 1rem;
  text-align: center;
  font-size: 1.1rem;
  border: none;
}

.naac-appeal-table th[colspan="6"] {
  font-size: 1.2rem;
  letter-spacing: 0.5px;
}

.naac-appeal-table td {
  padding: 0.75rem;
  border: 1px solid #dee2e6;
  vertical-align: top;
  line-height: 1.5;
  text-align: center;
}

.naac-appeal-table td:first-child,
.naac-appeal-table th:first-child {
  text-align: left;
  font-weight: 600;
}

/* Criteria Rows */
.criteria-row th {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #26428b;
  font-weight: 800;
  font-size: 1rem;
  padding: 1rem;
  border-left: 4px solid #26428b;
  text-align: left;
  width: 120px;
}

.criteria-row:hover th {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

.criteria-row:hover td {
  background-color: #f8f9fa;
}

/* Links in Table */
.naac-appeal-table a {
  color: #26428b;
  text-decoration: none;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  margin: 0.1rem 0;
}

.naac-appeal-table a:hover {
  color: white;
  background-color: #26428b;
  text-decoration: none;
  border-color: #26428b;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* PDF Icon for Links */
.naac-appeal-table a[href$=".pdf"]::after {
  content: " 📄";
  font-size: 0.9em;
  margin-left: 3px;
  opacity: 0.8;
}

.naac-appeal-table a:hover[href$=".pdf"]::after {
  opacity: 1;
}

/* Empty Cells */
.naac-appeal-table td:empty::before {
  content: "—";
  color: #999;
  font-style: italic;
}

/* Audit and L-files styling */
.naac-appeal-table a[href*="audit"] {
  color: #2e7d32;
  border-left: 3px solid #2e7d32;
  padding-left: 0.75rem;
}

.naac-appeal-table a[href*="audit"]:hover {
  background-color: #e8f5e9;
  color: #1b5e20;
}

.naac-appeal-table a[href*=".L"] {
  color: #7b1fa2;
  border-left: 3px solid #7b1fa2;
  padding-left: 0.75rem;
  font-size: 0.9em;
}

.naac-appeal-table a[href*=".L"]:hover {
  background-color: #f3e5f5;
  color: #4a148c;
}

/* Appeal Notes */
.appeal-notes .alert {
  border-left: 4px solid #26428b;
  border-radius: 8px;
}

.appeal-notes h5 {
  color: #26428b;
  font-weight: 600;
}

.appeal-notes ul {
  padding-left: 1.5rem;
  margin-bottom: 0;
}

.appeal-notes li {
  margin-bottom: 0.25rem;
  color: #555;
}

.appeal-notes li:last-child {
  margin-bottom: 0;
}

/* Commented Links (disabled) */
.naac-appeal-table td:has(> .commented-link) {
  position: relative;
}

.commented-link {
  color: #999 !important;
  text-decoration: line-through !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

.commented-link:hover {
  background-color: transparent !important;
  color: #999 !important;
  transform: none !important;
  box-shadow: none !important;
}

.commented-link::after {
  content: " (disabled)";
  font-size: 0.8em;
  color: #dc3545;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .naac-appeal-table {
    font-size: 0.9rem;
  }

  .naac-appeal-table th,
  .naac-appeal-table td {
    padding: 0.6rem;
  }

  .criteria-row th {
    width: 100px;
    padding: 0.8rem;
  }
}

@media (max-width: 992px) {
  .naac-appeal-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .naac-appeal-table th,
  .naac-appeal-table td {
    min-width: 120px;
  }

  .criteria-row th {
    min-width: 100px;
    position: sticky;
    left: 0;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    z-index: 5;
  }
}

@media (max-width: 768px) {
  .naac-appeal-table {
    font-size: 0.85rem;
  }

  .naac-appeal-table a {
    padding: 0.15rem 0.3rem;
    font-size: 0.85rem;
    display: block;
    margin: 0.2rem 0;
  }

  .naac-appeal-table th[colspan="6"] {
    font-size: 1rem;
  }

  .criteria-row th {
    font-size: 0.9rem;
    padding: 0.6rem;
  }

  .appeal-notes .alert {
    padding: 1rem;
  }

  .appeal-notes h5 {
    font-size: 1rem;
  }

  .appeal-notes ul {
    padding-left: 1rem;
  }

  .appeal-notes li {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .naac-appeal-table {
    font-size: 0.8rem;
  }

  .naac-appeal-table th,
  .naac-appeal-table td {
    padding: 0.4rem;
  }

  .naac-appeal-table a {
    padding: 0.1rem 0.2rem;
    font-size: 0.8rem;
  }

  .criteria-row th {
    font-size: 0.85rem;
    padding: 0.5rem;
    width: 80px;
  }

  .appeal-notes .alert {
    padding: 0.75rem;
  }
}

/* Animation for table rows */
@keyframes fadeInAppealRow {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.naac-appeal-table tbody tr {
  animation: fadeInAppealRow 0.5s ease forwards;
}

.naac-appeal-table tbody tr:nth-child(1) {
  animation-delay: 0.1s;
}
.naac-appeal-table tbody tr:nth-child(2) {
  animation-delay: 0.2s;
}
.naac-appeal-table tbody tr:nth-child(3) {
  animation-delay: 0.3s;
}
.naac-appeal-table tbody tr:nth-child(4) {
  animation-delay: 0.4s;
}
.naac-appeal-table tbody tr:nth-child(5) {
  animation-delay: 0.5s;
}
.naac-appeal-table tbody tr:nth-child(6) {
  animation-delay: 0.6s;
}
.naac-appeal-table tbody tr:nth-child(7) {
  animation-delay: 0.7s;
}

/* Print Styles */
@media print {
  .naac-header,
  .internal-nav,
  #backToTop,
  .appeal-notes {
    display: none !important;
  }

  .naac-appeal-table {
    box-shadow: none;
    border: 1px solid #ddd;
    font-size: 10pt;
  }

  .naac-appeal-table th {
    background: #f0f0f0 !important;
    color: black !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .criteria-row th {
    background: #e8e8e8 !important;
    color: black !important;
    border-left: 3px solid #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .naac-appeal-table a {
    color: black;
    text-decoration: underline;
    padding: 0;
    border: none;
  }

  .naac-appeal-table a[href$=".pdf"]::after {
    content: " (PDF)";
  }

  .naac-appeal-table a[href*="audit"] {
    color: black;
    border: none;
    padding: 0;
  }

  .naac-appeal-table a[href*=".L"] {
    color: black;
    border: none;
    padding: 0;
  }

  .naac-content {
    padding: 0;
  }

  .section-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    padding: 0 !important;
  }
}

/* Highlight current nav item */
.internal-nav .nav-link.active {
  color: #26428b;
  background: #e3f2fd;
  border-radius: 20px;
  position: relative;
}

.internal-nav .nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 80%;
  height: 3px;
  background: #26428b;
  border-radius: 2px;
  transform: translateX(-50%);
}

/* Criteria Badge for empty cells */
.criteria-empty {
  display: inline-block;
  background: #f8f9fa;
  color: #6c757d;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-style: italic;
  font-size: 0.9em;
  border: 1px dashed #dee2e6;
}

/* Download All Button */
.download-all-container {
  margin-bottom: 1.5rem;
  text-align: right;
}

.download-all-btn {
  background: linear-gradient(135deg, #26428b 0%, #1a3372 100%);
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.download-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(38, 66, 139, 0.3);
  color: white;
}

/* Criteria Counter */
.criteria-counter {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #dc3545;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.criteria-row th {
  position: relative;
}
