@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Base Styles */
#astgdrmsys-search-form,
#print {
  font-family: 'Inter', sans-serif;
  color: #334155;
}

::placeholder {
  color: #94a3b8 !important;
  opacity: 1;
}

/* Print Overrides */
@page {
  size: A4;
  margin: 5mm;
}

@media print {
  /* Hide non-printable areas */
  header,
  footer,
  .sidebar,
  .no-print,
  #astgdrmsys-search-form,
  #printResult,
  #downloadResult,
  .searchtable {
    display: none !important;
  }
  body {
    margin: 0;
  }
  #print {
    display: block;
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    box-shadow: none !important;
    border: none !important;
  }
  .result-container {
    width: 100%;
    max-width: none;
    padding: 0;
    box-shadow: none !important;
  }
}

/* Search Form Styling */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

table.table.searchtable {
  max-width: 650px;
  margin: 15px auto 40px auto;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

table.table.searchtable:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
}

table.table.searchtable tr {
  border-bottom: 1px solid #f1f5f9;
}

table.table.searchtable td {
  padding: 16px 24px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}
table.table.searchtable tr:last-child td {
  border-bottom: none;
}

table.table.searchtable td strong {
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

/* Inputs and Selects */
table.table.searchtable select,
table.table.searchtable input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background-color: #f8fafc;
  color: #1e293b;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
  box-sizing: border-box;
}

table.table.searchtable select:focus,
table.table.searchtable input[type="text"]:focus {
  border-color: #3b82f6;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Search Button */
table.table.searchtable .btn {
  display: inline-block;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  font-family: 'Inter', sans-serif;
}

table.table.searchtable .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

table.table.searchtable td center {
  display: block;
  margin-top: 10px;
}

/* Marksheet Wrapper */
#print {
  width: 100%;
  max-width: 900px;
  margin: 40px auto;
  border: none;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06), 0 4px 15px rgba(0, 0, 0, 0.03);
  position: relative;
  box-sizing: border-box;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: box-shadow 0.4s ease;
}

#print:hover {
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.08), 0 4px 20px rgba(0, 0, 0, 0.04);
}

.result-container {
  width: 100%;
  padding: 20px 40px;
  background-color: #ffffff;
  box-sizing: border-box;
  overflow-x: auto;
}

/* Header Container */
.result-header {
  text-align: center;
  padding: 20px 0 30px;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 30px;
}

.result-header .logo-img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  margin-bottom: 15px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
  background: #f8fafc;
}

.result-header .logo-img:hover {
  transform: scale(1.03);
}

.result-header h1 {
  font-size: 26px !important;
  color: #0f172a;
  margin: 10px 0 5px;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#address {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 15px;
}

#result-title {
  font-size: 18px;
  color: #2563eb;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#result-subtitle {
  font-size: 15px;
  color: #475569;
  font-weight: 500;
}

/* Photo */
.student-image {
  width: 110px;
  height: auto;
  margin-right: 10px;
  border: 3px solid #f8fafc;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.image-cell {
  text-align: center;
  vertical-align: middle;
  padding: 15px !important;
}

/* Tables General */
.table-style {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 30px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.table-style th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 600;
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  text-align: center;
}

.table-style td {
  padding: 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  color: #475569;
  font-size: 13.5px;
  text-align: center;
  word-wrap: break-word;
  transition: all 0.2s ease;
}

/* Align names to the left instead of center */
.table-style td:first-child,
.table-style th:first-child {
  text-align: left;
}

.table-style th:last-child,
.table-style td:last-child {
  border-right: none;
}
.table-style tr:last-child td {
  border-bottom: none;
}

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

.table-style tr:hover td {
  background-color: #f1f5f9;
  transition: background-color 0.2s ease;
}

.table-style tr td:first-child {
  font-weight: 500;
  color: #1e293b;
}

/* Specific Highlights */
.average-gpa {
  background: linear-gradient(to right, #e0f2fe, #bae6fd) !important;
  font-weight: 600 !important;
  color: #0369a1 !important;
}

.fourth-sub-row td {
  background-color: #f0fdf4 !important;
}
.fourth-sub-row:hover td {
  background-color: #dcfce7 !important;
}

.additional-subject-label {
  font-weight: 600;
  color: #0f172a;
  background-color: #f8fafc;
  padding: 14px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
}

.table-style .added_gpa {
  color: #ef4444 !important;
  font-style: italic;
  font-weight: 500;
  text-align: right;
  font-size: 13px;
}

.table-style tr .result-td {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  font-weight: 800;
  color: #0f172a;
  text-align: center;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.finalgpa {
  font-size: 1.3em;
  font-weight: 800;
  color: #2563eb;
}

/* Signatures */
.signature-area {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 40px;
  padding: 0 10px;
  flex-wrap: wrap;
}

.signature-box {
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signature-box img {
  display: block;
  margin-bottom: 12px;
}

.office-seal img {
  max-width: 90px;
  max-height: 90px;
}

.principal-signature img {
  max-width: 180px;
  max-height: 70px;
}

.signature-caption {
  display: block;
  width: 100%;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
  text-align: center;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

#result-footer {
  text-align: right;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 20px;
  padding: 10px 0;
  border-top: 1px solid #f1f5f9;
}

/* Action Buttons (Print / Download) */
#printResult, #downloadResult {
  margin: 10px 5px;
  padding: 12px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#printResult {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}
#printResult:hover {
  background: #f1f5f9;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#downloadResult {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}
#downloadResult:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.3);
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.watermark {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  max-width: 400px;
  opacity: 0.04;
  z-index: 0;
  pointer-events: none;
  filter: grayscale(100%);
}

.result-container {
  position: relative;
  z-index: 1;
}

.result-qrcode img {
  width: 90px;
  height: 90px;
  margin-top: 15px;
  border-radius: 8px;
  padding: 5px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

/* Responsive */
@media screen and (max-width: 768px) {
  table.table.searchtable {
    width: 95%;
    padding: 0;
    margin: 20px auto;
  }
  table.table.searchtable td {
    display: block;
    width: 100%;
    padding: 10px 20px;
    border: none;
    box-sizing: border-box;
  }
  table.table.searchtable td:last-child {
    padding-bottom: 20px;
  }
  #print {
    width: 100%;
    margin: 10px 0;
    border-radius: 0;
    box-shadow: none;
  }
  .result-container {
    padding: 10px;
    overflow-x: auto;
  }
  .table-style {
    font-size: 12px;
  }
  .table-style th, .table-style td {
    padding: 8px;
  }
  .signature-area {
    padding: 0 10px;
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
}
