* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@page {
  size: A4;
  margin: 0.5cm;
}

body, html {
  font-family: 'Calibri', 'Segoe UI', Arial, sans-serif;
  background: #f7f9fc;
  color: #2c3e50;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

/* Main Container */
.container_marksheet_template1 {
  width: auto;
  height: auto;
  margin: 10px;
  padding: 20px;
  border: 1px solid black;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
  font-size: 14px;
}

.logo_div_img_template1 img {
  width: 70px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

/* Header */
.header_template1 {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  text-align: center;
}

.header_details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #636e72;
}

.header_institution h2 {
  font-size: 20px;
  font-weight: 700;
  color: #000000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.header_institution p {
  font-size: 14px;
  color: #000000;
}

/* Report Title */
.heading_report_template1 {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 10px 0;
  color: #000000;
  text-transform: uppercase;
  position: relative;
}

/* Session Info */
.aligncenter {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #000000;
  margin: 5px 0 15px;
}

/* Student Info */
.student_info_table_template1 {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-bottom: 15px;
  font-size: 14px;
  border: 1px solid gray;
}

.student_info_table_template1 td {
  padding: 8px 10px;
}

.student_info_table_template1 tr:nth-child(odd) {
  background: #f1f2f6;
}

/* Marks Table */
.table1_template1 tbody .subject-row td:first-child {
  text-transform: uppercase;
}

.table1_container_template1 {
  margin-top: 15px;
}

.table1_template1 {
  width: 100%;
  border-collapse: collapse;
  font-size: 10pt;
  overflow: hidden;
  page-break-inside: avoid;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.table1_template1 th {
  background: #6c5ce7;
  color: #fff;
  padding: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.table1_template1 td {
  padding: 8px;
  border: 1px solid #dfe6e9;
  text-align: center;
  text-transform: uppercase;
}

.table1_template1 tbody .subject-row:nth-child(odd) {
  background-color: #eef0f3;
}

/* Notes Section */
.margintop20 { margin-top: 15px; }
.margintop35 { margin-top: 25px; }
.margintop50 { margin-top: 35px; }
.flex-row-info {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.flex-row-info p {
  margin: 0;
  font-size: 12pt;
  flex: 1;
}

.congratulate_message {
  font-size: 12pt;
  font-weight: 600;
  margin: 10px 0;
  padding: 10px 15px 0px 15px;
}

.new_session {
    padding: 0px 15px;
}

/* Signatures */
.flexbox-row-spacearound-start {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  margin-top: 30px;
  gap: 20px;
}

.signature_div {
  width: 28%;
  text-align: center;
  font-size: 10pt;
  color: #2d3436;
  border-top: 1px solid #636e72;
  margin-top: 20px;
}

/* Footer Note */
.fontsize11 {
  font-size: 10pt;
  color: #ff0505;
  margin-top: 20px;
  text-align: center;
  font-style: italic;
}

/* Utility Classes */
.flexbox-row-center-start {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
}

.transparent_table td, .transparent_table th {
  background: none !important;
  border: none !important;
  color: #000 !important;
}

.transparent_table tr:nth-child(odd) {
  background: none !important;
}

.fullstretch { width: 100%; }

/* Color combination for the main information block */
.margintop35.flex-row-info {
  background-color: #dfe6e9;
  color: black;
  padding: 20px;
  border-radius: 8px;
  margin-top: 35px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 40px;
}

/* Style for input fields and select dropdowns */
.margintop35.flex-row-info input[type="text"],
.margintop35.flex-row-info select {
  background-color: white;
  border: 1px solid #6c5ce7;
  color: black;
  padding: 8px;
  border-radius: 4px;
  font-size: 14px;
  width: auto;
}

/* Specific styling for the date input to control its width */
input[type="date"] {
  background-color: white;
  border: 1px solid #6c5ce7;
  color: black;
  padding: 8px;
  border-radius: 4px;
  font-size: 14px;
  width: 200px;
}

.date-input {
  width: 150px;
}

/* Style for the 'Update' button */
.btn-primary {
  background-color: #6c5ce7;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: #4e3fc9;
  color: white;
}

/* Print Styling */
@media print {
  .container_marksheet_template1 {
    width: auto !important;   
    height: 100% !important; 
    margin: 0 !important;
    padding: 8px !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    background: #fff !important;
    page-break-after: always !important;
  }
  
  body, html {
    font-size: 10px !important;
    width: 100% !important;
    height: 100% !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .header_template1 { margin-bottom: 8px !important; }
  .header_institution h2 { font-size: 16px !important; }
  .heading_report_template1 { font-size: 16px !important; margin: 2px 0 !important; }
  .aligncenter { font-size: 13px !important; margin: 2px 0px !important; }
    
    .header_template1 {
    margin: 8px 0 !important;
    padding: 4px 0 !important;
  }
    .logo_div_img_template1 {
    margin-right: 8px !important; 
    width: 70px !important; 
  }

  .header_institution h1 {
    font-size: 16pt !important; 
    margin-bottom: 1px !important; 
    line-height: 1.2 !important;
  }
   .header_details {
    gap: 4px !important; 
  }
  .header_details p {
    font-size: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .header_institution h2 {
    font-size: 16px !important;
    margin-bottom: 2px !important;
  }
  .table1_template1 tbody .subject-row td:first-child {
    text-transform: uppercase !important;
  }
  /* Student Info - more padding for height */
  .student_info_table_template1 td {
    padding: 10px 12px !important;
    font-size: 11px !important;
    min-height: 22px !important;
  }

  /* Marks Table - more padding/margin */
  .table1_template1 {
    width: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 10px 0 !important;
    font-size: 11px !important;
  }

  .table1_template1 th, .table1_template1 td {
    padding: 8px 6px !important;
    border: 1px solid #000 !important;
    word-wrap: break-word !important;
    text-align: center;
    min-height: 25px !important;
  }
  
  .table1_template1 th {
    background: #6c5ce7 !important;
    color: white !important;
  }

  /* Refined column widths */
  .table1_template1 th:nth-child(1), .table1_template1 td:nth-child(1) { width: 28% !important; }
  .table1_template1 th:nth-child(2), .table1_template1 td:nth-child(2) { width: 10% !important; }
  .table1_template1 th:nth-child(3), .table1_template1 td:nth-child(3) { width: 10% !important; }
  .table1_template1 th:nth-child(4), .table1_template1 td:nth-child(4) { width: 10% !important; }
  .table1_template1 th:nth-child(5), .table1_template1 td:nth-child(5) { width: 10% !important; }
  .table1_template1 th:nth-child(6), .table1_template1 td:nth-child(6) { width: 16% !important; }
  .table1_template1 th:nth-child(7), .table1_template1 td:nth-child(7) { width: 16% !important; }

  /* Form elements inside table */
  .table1_template1 input[type="text"], .table1_template1 input[type="number"] {
    width: 95% !important;
    font-size: 9px !important;
    padding: 2px !important;
    text-align: center;
  }
  
  .table1_template1 td:first-child input[type="text"] {
    width: 90% !important;
    text-align: left;
  }
  
  .table1_template1 input[type="checkbox"] {
    transform: scale(0.8);
    margin: 0 auto;
  }
  
  .additional-subject {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    font-size: 10px !important;
  }
  
  .additional-subject input[type="checkbox"] {
    transform: scale(0.8);
  }
  
  .margintop20 { margin-top: 5px !important; }
  .margintop35, .margintop50 { margin-top: 10px !important; }
  .congratulate_message { font-size: 11px !important; margin: 8px 0 !important; padding: 8px 10px !important; }
  
  .flexbox-row-spacearound-start {
    justify-content: space-between !important;
    gap: 10px !important;
    margin-top: 15px !important;
  }
  /*changes*/
  .congratulate_message,
  .flex-row-info,
  .flexbox-row-spacearound-start,
  .fontsize11 {
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    padding: 10px 8px !important;
  }

  .congratulate_message {
    font-size: 12pt !important;
    margin: 0px !important;
    padding: 10px 12px 0px 12px !important;
  }

   .new_session {
    font-size: 10pt !important;
    padding: 0px 12px !important;
  }

  .flex-row-info {
    padding: 12px !important;
    margin: 15px 0 !important;
  }

  .flexbox-row-spacearound-start {
    justify-content: space-between !important;
    gap: 15px !important;
    margin: 20px 0 !important;
    padding: 10px 0 !important;
  }

  .signature_div {
    width: 30% !important;
    font-size: 11px !important;
    padding-top: 10px !important;
    margin-top: 10px !important;
  }

  .fontsize11 {
    font-size: 11px !important;
    margin: 15px 0 !important;
    padding: 8px 0 !important;
  }
  .signature_div {
    width: 30% !important;
    font-size: 11px !important;
    padding-top: 6px !important;
  }
  
  .fontsize11 { font-size: 11px !important; margin-top: 10px !important; }
  
  .transparent_table td, .transparent_table th { padding: 4px !important; border: none !important; }
  
  .table1_container_template1, .student_info_table_template1 { page-break-inside: avoid !important; }
  
  .flex-row-info { flex-wrap: nowrap !important; justify-content: space-between !important; }
  .flex-row-info p { flex: 1 1 30% !important; margin: 0 4px !important; font-size: 12px !important; }
  
  hr { border: none; border-top: 1px solid #000; height: 1px; width: 100%; margin: 8px 0 !important; display: block !important; }
}