.form-control::placeholder {
    font-size: 0.875rem;
    color: #adb5bd;
    font-weight: 400;
}

.required .form-label::after {
    content: " *";
    color: #f5365c;
}

p.form-text > b {
    color: #f5365c;
}

/* Form Styling */
.form-label {
    color: #525f7f;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-control, .form-select {
    height: 46px;
    border: 1px solid #dee2e6;
    color: #32325d;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 3px rgba(50, 50, 93, 0.15), 0 1px 0 rgba(0, 0, 0, 0.02);
}

.form-control:focus, .form-select:focus {
    border-color: #5e72e4;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Ensure dropdown options have normal color even if the select placeholder is light */
.form-select option {
    color: #32325d;
}

.form-select option[value=""] {
    color: #adb5bd;
}

/* Hover tooltip popup styles */
.hover-tooltip-wrapper {
    position: relative;
}

.hover-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    z-index: 1050;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    top: -50%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    margin-top: 5px;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s;
}

.hover-tooltip::before {
  content: "";
    position: absolute;

    /* 1. Move the arrow to the bottom edge of the black box */
    top: 100%; 
    bottom: auto; /* Ensure 'bottom' from previous CSS is cleared */

    /* Center the arrow horizontally */
    left: 50%;
    transform: translateX(-50%);

    /* Define the arrow size */
    border-width: 6px;
    border-style: solid;

    /* 2. Color the TOP border to make the arrow point DOWN */
    /* Syntax: Top(Color) Right(Trans) Bottom(Trans) Left(Trans) */
    border-color: #333 transparent transparent transparent;
}

.hover-tooltip-wrapper:hover .hover-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Captcha styling */
.captcha-wrapper {
    height: 46px !important; /* Match standard input height */
    display: flex !important;
    align-items: stretch !important;
}
.captcha-wrapper .input-group-text {
    height: auto !important;
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #f6f9fc;
    border: 1px solid #dee2e6;
    border-right: none;
    width: 100px;
}
.captcha-wrapper .input-group-text img {
    height: 100% !important;
    width: 100% !important;
    object-fit: fill;
}
.captcha-wrapper .form-control {
    height: 46px !important;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Custom Table Styling */
.custom-table {
    width: 100%;
    background-color: #fff;
    border-collapse: collapse;
}

.custom-table thead th {
    border-bottom: 1px solid #e9ecef;
    border-top: none !important;
    font-weight: 700;
    color: #8898aa;
    padding: 0.75rem 1rem;
    background-color: #f6f9fc;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.custom-table tbody td {
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 1rem;
    vertical-align: middle;
    color: #525f7f;
    font-size: 0.875rem;
}

.custom-table tbody tr:hover td {
    background-color: #f6f9fc;
    cursor: default;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

/* Optional: Adjust button to look more like the target's clean style if desired, 
   but keeping it as a button for now as it is a primary action. 
   If we wanted to match the text links:
*/

/* ============================================================
   SHARED STYLES (Class 10 HSLC & Class 12 HSSLC)
   ============================================================ */

.marksheet-old table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.marksheet-old table th,
.marksheet-old table td {
    padding: 0.35rem 0;
    vertical-align: middle;
    border: none;
}

/* Student Details Table */
.marksheet-old .student-details-table th {
    width: 30%;
    text-align: left;
    color: #1f2937;
    font-weight: 600;
}
.marksheet-old .student-details-table td {
    width: 70%;
    color: #4b5563;
}

/* Column Headers (shared) */
.marksheet-old .marks-table .column-headers th {
    color: #1f2937;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.3rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================================
   CLASS 10 (HSLC) SPECIFIC STYLES
   ============================================================ */

/* 3-column Marks Table — HSLC 1997-2005 */
.marksheet-hslc .marks-table th:nth-child(1),
.marksheet-hslc .marks-table td:nth-child(1) {
    width: 35%;
    text-align: left;
    color: #1f2937;
}

.marksheet-hslc .marks-table th:nth-child(2),
.marksheet-hslc .marks-table td:nth-child(2) {
    width: 45%;
    text-align: left;
    color: #4b5563;
}

.marksheet-hslc .marks-table th:nth-child(3),
.marksheet-hslc .marks-table td:nth-child(3) {
    width: 20%;
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

/* 4-column Marks Table — HSLC 2006-2008 */
.marksheet-hslc .marks-table--4col th:nth-child(1),
.marksheet-hslc .marks-table--4col td:nth-child(1) {
    width: 40%;
    text-align: left;
    color: #1f2937;
}

.marksheet-hslc .marks-table--4col th:nth-child(2),
.marksheet-hslc .marks-table--4col td:nth-child(2) {
    width: 20%;
    text-align: right;
    color: #4b5563;
}

.marksheet-hslc .marks-table--4col th:nth-child(3),
.marksheet-hslc .marks-table--4col td:nth-child(3) {
    width: 20%;
    text-align: right;
    color: #4b5563;
}

.marksheet-hslc .marks-table--4col th:nth-child(4),
.marksheet-hslc .marks-table--4col td:nth-child(4) {
    width: 20%;
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

/* 5-column Marks Table — HSLC 2009-2016 */
.marksheet-hslc .marks-table--5col th:nth-child(1),
.marksheet-hslc .marks-table--5col td:nth-child(1) {
    width: 34%;
    text-align: left;
    color: #1f2937;
}

.marksheet-hslc .marks-table--5col th:nth-child(2),
.marksheet-hslc .marks-table--5col td:nth-child(2) {
    width: 16%;
    text-align: right;
    color: #4b5563;
}

.marksheet-hslc .marks-table--5col th:nth-child(3),
.marksheet-hslc .marks-table--5col td:nth-child(3) {
    width: 16%;
    text-align: right;
    color: #4b5563;
}

.marksheet-hslc .marks-table--5col th:nth-child(4),
.marksheet-hslc .marks-table--5col td:nth-child(4) {
    width: 16%;
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

.marksheet-hslc .marks-table--5col th:nth-child(5),
.marksheet-hslc .marks-table--5col td:nth-child(5) {
    width: 18%;
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

/* Override: column header cells — HSLC */
.marksheet-hslc .marks-table--5col .column-headers th,
.marksheet-hslc .marks-table--4col .column-headers th {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ============================================================
   CLASS 12 (HSSLC) SPECIFIC STYLES
   ============================================================ */

/* 5-column Grouped Marks Table — HSSLC 1998-2006
   Uses explicit .col-* classes instead of nth-child to support rowspan.
   Columns: Category | Subject | Theory | Practical | Total */
.marksheet-hsslc .marks-table--hsslc-grouped .col-category {
    width: 22%;
    text-align: left;
    color: #1f2937;
    font-weight: 600;
}

.marksheet-hsslc .marks-table--hsslc-grouped .col-subject {
    width: 28%;
    text-align: left;
    color: #4b5563;
}

.marksheet-hsslc .marks-table--hsslc-grouped .col-theory {
    width: 16%;
    text-align: center;
    color: #4b5563;
}

.marksheet-hsslc .marks-table--hsslc-grouped .col-practical {
    width: 16%;
    text-align: center;
    color: #4b5563;
}

.marksheet-hsslc .marks-table--hsslc-grouped .col-total {
    width: 18%;
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

/* Column headers for HSSLC grouped table */
.marksheet-hsslc .marks-table--hsslc-grouped .column-headers th {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* HSSLC footer table (GFC / WE / PE, Total, Result) */
.marksheet-hsslc .hsslc-footer-table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
}

.marksheet-hsslc .hsslc-footer-table td,
.marksheet-hsslc .hsslc-footer-table th {
    padding: 0.5rem 0;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
}

.marksheet-hsslc .hsslc-footer-table .info-row td {
    font-weight: 600;
    color: #1f2937;
    padding-bottom: 0.4rem;
}

.marksheet-hsslc .hsslc-footer-table .total-row th {
    text-align: left;
    font-weight: 700;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
}

.marksheet-hsslc .hsslc-footer-table .total-row td {
    font-weight: 700;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
}

.marksheet-hsslc .hsslc-footer-table .result-row {
    background-color: #f3f4f6;
}

.marksheet-hsslc .hsslc-footer-table .result-row th,
.marksheet-hsslc .hsslc-footer-table .result-row td {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: none;
}

/* 4-column Marks Table — HSSLC 2007-2016 */
.marksheet-hsslc .marks-table--4col th:nth-child(1),
.marksheet-hsslc .marks-table--4col td:nth-child(1) {
    width: 40%;
    text-align: left;
    color: #1f2937;
}

.marksheet-hsslc .marks-table--4col th:nth-child(2),
.marksheet-hsslc .marks-table--4col td:nth-child(2) {
    width: 20%;
    text-align: right;
    color: #4b5563;
}

.marksheet-hsslc .marks-table--4col th:nth-child(3),
.marksheet-hsslc .marks-table--4col td:nth-child(3) {
    width: 20%;
    text-align: right;
    color: #4b5563;
}

.marksheet-hsslc .marks-table--4col th:nth-child(4),
.marksheet-hsslc .marks-table--4col td:nth-child(4) {
    width: 20%;
    text-align: right;
    color: #1f2937;
    font-weight: 500;
}

/* Override: column header cells — HSSLC */
.marksheet-hsslc .marks-table--4col .column-headers th {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Section Headers */
.marksheet-old .section-header {
    text-align: center !important;
    color: #1f2937;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0 0.4rem 0;
    border: none;
}

/* Totals */
.marksheet-old .total-row td {
    font-weight: 700;
    color: #1f2937;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

/* Footer Table */
.marksheet-old .footer-table {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
}

.marksheet-old .footer-table th {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    width: 80%;
}

.marksheet-old .footer-table td {
    text-align: right;
    font-weight: 600;
    color: #1f2937;
    width: 20%;
}

.marksheet-old .result-row {
    background-color: #f3f4f6;
}

.marksheet-old .result-row th,
.marksheet-old .result-row td {
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
}

@media (max-width: 576px) {
    .marksheet-hslc .marks-table th:nth-child(1),
    .marksheet-hslc .marks-table td:nth-child(1),
    .marksheet-hslc .marks-table th:nth-child(2),
    .marksheet-hslc .marks-table td:nth-child(2),
    .marksheet-hslc .marks-table th:nth-child(3),
    .marksheet-hslc .marks-table td:nth-child(3),
    .marksheet-hslc .marks-table--4col th:nth-child(4),
    .marksheet-hslc .marks-table--4col td:nth-child(4) {
        width: auto;
        display: block;
        text-align: left;
        padding: 0.25rem 0;
    }
    
    .marksheet-old .marks-table tr {
        display: block;
        border-bottom: 1px solid #e5e7eb;
        padding: 0.5rem 0;
    }
    
    .marksheet-old .marks-table th {
        border-bottom: none;
    }
}

@media (max-width: 576px) {
    /* On small screens restore normal flow so table remains usable */
    .marksheet-old table th:nth-child(3),
    .marksheet-old table td:nth-child(3) {
        padding-left: 1rem;
        width: auto;
        text-align: left;
    }
    .marksheet-old table th:nth-child(2),
    .marksheet-old table td:nth-child(2) {
        min-width: 0;
    }
}
/*
.view-sample-result {
    background: none;
    border: none;
    color: #0d6efd;
    padding: 0;
    text-decoration: none;
}
.view-sample-result:hover {
    text-decoration: underline;
    background: none;
    color: #0a58ca;
}
*/
