/* Students Page Styling */

/* Institute Header */
.institute-name-display {
  font-size: 1.4rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-info-display .badge {
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
}

/* Student Summary Card */
.student-summary-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(40, 167, 69, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(15px);
}

.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.summary-stat:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(5px);
}

.summary-stat .stat-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.summary-stat .stat-info {
  flex-grow: 1;
}

.summary-stat .stat-number {
  font-size: 1.5rem;
  line-height: 1.2;
}

.summary-stat .stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
}

/* Student Filter Container */
.student-filter-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
  border-radius: 15px;
  padding: 1.25rem;
  border: 1px solid rgba(40, 167, 69, 0.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}

.filter-controls-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.search-input-group {
  display: flex;
  align-items: center;
  position: relative;
  flex-grow: 1;
  min-width: 300px;
}

.search-icon-student {
  position: absolute;
  left: 1rem;
  z-index: 3;
  font-size: 1rem;
}

.student-search-input {
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid rgba(40, 167, 69, 0.2);
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  flex-grow: 1;
}

.student-search-input:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
  background: rgba(255, 255, 255, 1);
}

.student-search-btn {
  margin-left: 0.75rem;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.status-filter-group,
.gender-filter-group {
  min-width: 150px;
}

.status-filter-select,
.gender-filter-select {
  border: 2px solid rgba(40, 167, 69, 0.2);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.status-filter-select:focus,
.gender-filter-select:focus {
  border-color: #28a745;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.filter-info {
  text-align: center;
}

/* Students Table Container */
.students-table-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid rgba(40, 167, 69, 0.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(15px);
}

.table-header h4 {
  color: #2d3748;
  font-weight: 700;
}

/* Students Table */
.students-table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
}

.table-header-custom {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.9) 0%, rgba(34, 139, 58, 1) 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

.table-header-custom th {
  padding: 1rem 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: none;
  position: relative;
  vertical-align: middle;
}

.table-header-custom th:first-child {
  border-radius: 12px 0 0 0;
}

.table-header-custom th:last-child {
  border-radius: 0 12px 0 0;
}

.sortable {
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.sortable:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sort-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.sort-icon.active {
  opacity: 1;
  color: #fff;
}

/* Student Rows */
.student-row {
  transition: all 0.3s ease;
  animation: studentRowFadeIn 0.6s ease-out forwards;
  opacity: 0;
  border: none;
}

.student-row:hover {
  background: rgba(40, 167, 69, 0.05);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.certified-row {
  border-left: 4px solid #28a745;
}

.pending-row {
  border-left: 4px solid #ffc107;
}

.student-row td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
}

/* Student Info Cell */
.student-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-avatar {
  font-size: 2rem;
  color: #28a745;
  opacity: 0.8;
}

.student-details {
  flex-grow: 1;
}

.student-name {
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.student-email {
  font-size: 0.8rem;
  color: #6c757d;
  font-style: italic;
}

/* CNIC Cell */
.cnic-number {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #495057;
  background: rgba(248, 249, 250, 0.8);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Gender Cell */
.bg-pink {
  background-color: rgba(255, 192, 203, 0.2) !important;
}

.text-danger {
  color: #dc3545 !important;
}

/* Contact Cell */
.contact-link {
  color: #28a745;
  font-weight: 500;
  transition: all 0.3s ease;
}

.contact-link:hover {
  color: #1e7e34;
  text-decoration: underline !important;
}

/* Status and Employment Badges */
.badge {
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Date Cell */
.cert-date {
  font-weight: 500;
  color: #495057;
}

/* Actions Cell */
.actions-cell .btn {
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  margin: 0 0.2rem;
  transition: all 0.3s ease;
}

.actions-cell .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Certificate Modal */
.certificate-container {
  max-width: 100%;
  text-align: center;
}

.certificate-container img {
  max-width: 100%;
  height: auto;
  border: 3px solid #28a745;
  border-radius: 12px;
}

.certificate-info {
  background: rgba(40, 167, 69, 0.05);
  border-radius: 10px;
  padding: 1rem;
}

/* Animations */
@keyframes studentRowFadeIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 1200px) {
  .filter-controls-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input-group {
    min-width: auto;
  }
  
  .status-filter-group,
  .gender-filter-group {
    min-width: auto;
  }
}

@media (max-width: 768px) {
  .student-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .student-avatar {
    font-size: 1.5rem;
  }
  
  .student-name {
    font-size: 0.9rem;
  }
  
  .student-email {
    font-size: 0.75rem;
  }
  
  .students-table {
    font-size: 0.8rem;
  }
  
  .table-header-custom th {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .student-row td {
    padding: 0.75rem 0.5rem;
  }
  
  .actions-cell .btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
    margin: 0.1rem;
  }
}

@media (max-width: 576px) {
  .institute-name-display {
    font-size: 1.2rem;
  }
  
  .course-info-display .badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.6rem;
  }
  
  .summary-stats {
    gap: 0.75rem;
  }
  
  .summary-stat {
    padding: 0.5rem;
  }
  
  .summary-stat .stat-number {
    font-size: 1.3rem;
  }
  
  .students-table-container {
    padding: 1rem;
  }
  
  .filter-controls-group {
    gap: 0.75rem;
  }
  
  .student-search-input {
    padding: 0.6rem 1rem 0.6rem 2.2rem;
  }
  
  /* Hide some columns on mobile */
  .students-table .cnic-cell,
  .students-table .date-cell {
    display: none;
  }
  
  .table-header-custom th:nth-child(2),
  .table-header-custom th:nth-child(6) {
    display: none;
  }
}

/* Print Styles */
@media print {
  .student-filter-section,
  .actions-cell {
    display: none !important;
  }
  
  .students-table-container {
    background: white !important;
    border: 2px solid #000 !important;
    box-shadow: none !important;
  }
  
  .table-header-custom {
    background: #000 !important;
    color: white !important;
  }
  
  .student-row {
    background: white !important;
    border-left: 2px solid #000 !important;
  }
  
  .badge {
    background: #000 !important;
    color: white !important;
    border: 1px solid #000;
  }
}

/* Loading States */
.students-table.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading-row {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
  background-size: 200% 100%;
  animation: loadingShimmer 1.5s infinite;
}

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