:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --text-dark: #2c3e50;
  --text-span: #0000cf;
  --background-light: #f4f6f7;
  --border-color: #e0e6ed;
  --white: #ffffff;
}

/* Container Styling */
.container {
  max-width: 1400px;
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-top: 25px;
  border: 1px solid var(--border-color);
}

/* Main Heading Styling */
.main-heading,
.heading {
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 25px;
  font-weight: 600;
  position: relative;
  padding-bottom: 10px;
}

.main-heading::after,
.heading::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color)
  );
}

/* Form Styling */
#submitForm,
form {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Select and Input Styling */
.selectClass,
.selectExam,
.searchfield {
  width: 100%;
  padding: 12px 15px !important;
  border: 2px solid var(--border-color) !important;
  border-radius: 8px !important;
  font-size: 16px;
  transition: all 0.3s ease !important;
}

.selectClass:focus,
.selectExam:focus,
.searchfield:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Table Styling */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 20px;
}

.table tr {
  transition: background-color 0.3s ease;
}

.table tr:nth-child(even) {
  background-color: #f9f9fc;
}

.table tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
}

.mark-table {
  text-align: center;
}

.title-tr {
  background-color: transparent;
}

.title-tr td {
  padding: 12px 15px;
  vertical-align: middle;
}

.title-tr td:first-child {
  font-weight: 600;
  color: var(--text-dark);
}

/* Submit Button Styling */
.submit-btn,
.btn-primary,
.btn-danger {
  background: linear-gradient(135deg, var(--primary-color), #2980b9);
  color: white;
  border: none;
  padding: 12px 25px;
  margin-top: 12px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.submit-btn:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn.btn-danger {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  outline: none;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.btn.btn-danger:hover {
  background: linear-gradient(135deg, #c82333, #a71d2a);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn.btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #a71d2a, #dc3545);
}

.btn.btn-danger:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}

.button-div {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 10px;
}

/* Loading Indicator */
#loading {
  color: var(--primary-color);
  font-style: italic;
  margin-left: 10px;
  display: inline-block;
}

/* Students Container */
.students-container {
  background-color: var(--background-light);
  border-radius: 12px;
  padding: 25px;
  margin-top: 25px;
}

.span-text {
  color: var(--text-span);
}

.mark-table td.subject-cell {
  min-width: 200px;
  white-space: normal;
  line-height: 1.4;
  padding: 8px 12px;
}
.mark-table td.subject-cell small {
  color: #6c757d;
  font-size: 90%;
}

/* Custom Message */
.custom-message {
  position: relative;
  margin: 15px 0;
  padding: 15px;
  border: 1px solid #d6e9c6;
  background-color: #dff0d8;
  border-radius: 4px;
}

.custom-message .close-message {
  position: absolute;
  top: 5px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #000;
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container,
  .students-container {
    padding: 15px;
  }

  .table {
    font-size: 14px;
  }

  .selectClass,
  .selectExam,
  .searchfield {
    font-size: 14px;
    padding: 10px;
  }

  .submit-btn,
  .btn-primary {
    width: 100%;
  }
}

/* Accessibility Enhancements */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* For Download Marksheet page */
.marksheet-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}
.marksheet-table th,
.marksheet-table td {
  border: 1px solid #ccc;
  padding: 5px;
  text-align: center;
}
.marksheet-table th {
  background: #f5f5f5;
}
.marksheet-table .marksheet-header {
  background: linear-gradient(135deg, #e6e6e6, #e1e1f1) !important;
  color: #2b2b2b !important;
}
.marksheet-table .marksheet-subheader {
  background: linear-gradient(135deg, #143d58, #043f66) !important;
  color: #fff !important;
}

/* Hiding Student ID */
.student-id-header {
  display: none;
}
