@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@page {
    size: A4;
    margin: 1cm;
}

body {
    font-family: 'Roboto', sans-serif;
    background: #f7f9fc;
    color: #2c3e50;
    line-height: 1.5;
    font-size: 13px;
}

/* --- Main Container --- */
.container_marksheet_template {
    width: 100%;
    height: auto;
    border: 1px solid #0b722d;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.content_container {
    padding: 10px 2%;
}

/* --- Header Section --- */
.header_template {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #0b722d;
}

.logo_div img {
    width: 70px;
    height: auto;
    margin-right: 20px;
}

.header_institution {
    text-align: center;
}

.heading_template {
    font-size: 20pt;
    font-weight: 700;
    color: #0b722d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heading_code_info, .heading_address, .contact_info {
    font-size: 10pt;
    color: #555;
}

.report_header {
    text-align: center;
    margin: 10px 0;
}

.heading_report {
    font-size: 14pt;
    font-weight: 700;
    color: #0b722d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.academic_session {
    font-size: 13px;
    color: #555;
}

/* --- Student Info --- */
.student_info_container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    margin-bottom: 15px;
    border: 1px solid #dfe6e9;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.student_info_item {
    font-size: 13px;
}

.student_info_item label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 5px;
}

.student_info_item .student_data {
    font-weight: 400;
}

/* --- Form and Table --- */
.form-container {
    margin: 15px 0;
}

.stream-selector {
    margin-bottom: 15px;
    text-align: center;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 13px;
    color: #2c3e50;
    cursor: pointer;
}

.subjects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    page-break-inside: avoid;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.subjects-table thead th {
    background: #0b722d;
    color: #fff;
    padding: 6px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid #dfe6e9;
    font-size: 12px;
}

.subjects-table tbody td {
    padding: 5px;
    border: 1px solid #dfe6e9;
    text-align: center;
}

.subjects-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.subjects-table .subject-name-input,
.subjects-table .theory-marks-obtained,
.subjects-table .practical-marks-obtained {
    width: 90%;
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.subjects-table .subject-type-select {
    padding: 3px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.submit-row {
    text-align: left;
    margin-top: 10px;
}

.btn-primary {
    background-color: #0b722d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #095a23;
}

/* --- Summary and Footer --- */
.divider {
    border: none;
    border-top: 1px solid #dfe6e9;
    margin: 15px 0;
}

.summary-container {
    background: #f1f3f1;
    margin: 15px 0;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    font-size: 13px;
}

.summary-item p {
    margin: 4px 0;
}

.summary-item strong {
    color: #2c3e50;
}

/* --- Promotion Message --- */
.promotion-container {
    background: #f1f3f1;
    padding: 8px;
    border-radius: 6px;
    margin: 15px 0;
    text-align: left;
    font-size: 13px;
}

.promotion-label {
    font-weight: 700;
    color: #2c3e50;
    font-size: 11pt;
}

.congratulate_message {
    font-size: 15px;
    font-weight: 600;
    padding: 8px 12px;
    border-left: 5px solid #0b722d;
    background: #edf7f0;
    color: #0b722d;
    border-radius: 5px;
}

.new_session {
    font-size: 13px;
    font-weight: 600;
    padding: 0px 12px;
    color: #2c3e50;
}

.signature_container {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.signature_div {
    text-align: center;
    width: 28%;
}

.signature-line {
    border-top: 1px solid #7f8c8d;
    margin-bottom: 5px;
}

.signature_div span {
    font-size: 11px;
    font-weight: 600;
    color: #2d3436;
}

.footer_note {
    font-size: 10pt;
    font-style: italic;
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
}

/* --- Print Mode --- */
@media print {
    body {
        margin: 0;
        padding: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 9pt;
        background: #fff !important;
    }
    
    .stream-selector {
        font-weight: bold;
        text-transform: uppercase;
    }
    
    .container_marksheet_template {
        width: 96.5% !important;
        height: 97.5% !important;
        background: #fff !important;
        border: none !important;
        font-size: 9pt !important;
        margin: 0 auto !important; 
        padding: 0 !important;
        page-break-after: always;
        margin-top: 0.5cm !important;
        box-shadow: none !important;
    }
    
    .content_container {
        padding: 0.5cm 1cm !important;
    }
    
    .header_template {
        flex-direction: column;
        align-items: center;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .logo_div {
        display: none !important;
    }
    
    .header_institution {
        text-align: center !important;
        margin-left: 0 !important;
        color: #000 !important;
    }
    
    .heading_template {
        opacity: 0 !important;
        margin: 0;
        padding: 0;
        height: 0;
        line-height: 0;
        font-size: 0;
    }
    
    .heading_code_info_template, 
    .heading_address_template, 
    .contact_template1 {
        font-size: 9pt !important;
        color: #000 !important;
        font-weight: normal !important;
        text-transform: none !important;
    }
    
    .heading_report {
        font-size: 14pt !important;
        font-weight: 700 !important;
        color: #000 !important;
        margin-top: 3px !important;
        text-transform: uppercase !important;
        letter-spacing: 1px;
    }
    
    .academic_session {
        font-size: 10pt !important;
        color: #000 !important;
        font-weight: normal !important;
    }
    .student_info_container {
        background: #fff !important;
    }
    
    .student_info_item label {
        color: #333 !important;
    }

    .summary-container,
    .promotion-container {
        border: 1px solid #000 !important;
        background: #fff !important;
        box-shadow: none !important;
    }
    
    .heading_template,
    .heading_report,
    .congratulate_message,
    .btn-primary {
        color: #000 !important;
        background: none !important;
        border: none !important;
    }
    .subjects-table thead th {
        background: #fff !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }
    .subjects-table tbody td {
        border: 1px solid #000 !important;
    }
    .subjects-table tbody tr:nth-child(even) {
        background-color: #fff !important;
    }
    .summary-item,
    .promotion-label,
    .signature_div span {
        color: #000 !important;
    }
    .congratulate_message {
        border-left: 0px solid #000 !important;
        background: none !important;
    }
    
    .signature_container {
        margin-top: 60px !important;
    }
}
