/* ============================================================
   KNM Result Portal - Stylesheet
   ============================================================ */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #f9f9f9;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 20px;
}

/* Header */
.header-top {
    background: #fff;
    border-bottom: 2px solid #FAEBD7;
    padding: 10px 0;
    margin-bottom: 15px;
}
.header {
    display: flex;
    align-items: center;
}
.header .logo {
    flex: 0 0 auto;
    margin-right: 15px;
}
.header .text-container {
    flex: 1;
    text-align: center;
}
.header-text .title {
    font-size: 22px;
    color: #232e44;
    line-height: 1.3;
}
.header-text .subtitle {
    font-size: 14px;
    color: #232e44;
    text-transform: uppercase;
    margin-top: 4px;
}
.header-text .malayalam {
    font-size: 13px;
    color: #555;
}

/* Search forms */
.form-container {
    max-width: 420px;
    margin: 30px auto;
    background: #fff;
    padding: 25px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}
.form-container h3 {
    margin-bottom: 18px;
    color: #232e44;
}
.form-container input[type="text"],
.form-container select {
    width: 100%;
    height: 42px;
    margin-bottom: 12px;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 15px;
}
.form-container input[type="submit"] {
    width: 100%;
    height: 42px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 8px;
}
.form-container input[type="submit"]:hover {
    background-color: #0056b3;
}
.form-nav-links {
    margin-top: 12px;
    font-size: 13px;
}
.form-nav-links a {
    color: #1565c0;
    text-decoration: none;
    margin: 0 8px;
}

/* Result tables */
#result, #result1 {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 5px;
}
#result td, #result th,
#result1 td, #result1 th {
    border: 1px solid #000;
    padding: 5px 6px;
    font-size: 14px;
}
#result1 {
    border-bottom: none;
}
#result1 td, #result1 th {
    border-bottom: none;
}
#result th, #result1 th {
    background-color: #FAEBD7;
    color: #000;
    text-align: left;
}
#result tr:nth-child(odd) { background-color: #FFFAF0; }
#result1 tr:nth-child(odd) { background-color: #FFFAF0; }
.rowtop { font-size: 13px; }

.absent { color: #c62828; font-weight: bold; }

/* Legend */
#legend {
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 12px;
    width: 45%;
}
#legend td {
    border: 1px solid #999;
    padding: 3px 6px;
}

/* Buttons */
.buttonprint {
    padding: 9px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin: 4px;
}
.buttonprint:hover { background-color: #388E3C; }

/* Madrasa result - student separator */
.student-block {
    margin-bottom: 20px;
    page-break-inside: avoid;
}

/* Print styles */
@media print {
    .buttonprint, .no-print { display: none !important; }
    body { background: #fff; }
    .header-top { border-bottom: 1px solid #000; }
    #result td, #result th { font-size: 12px; padding: 3px; }
    #result1 td, #result1 th { font-size: 12px; padding: 3px; }
    .student-block { page-break-after: always; }
    .student-block:last-child { page-break-after: avoid; }
}

/* Mobile */
@media only screen and (max-width: 767px) {
    .header-text .title { font-size: 15px; }
    .header-text .subtitle { font-size: 11px; }
    #result td, #result th { font-size: 11px; padding: 3px; }
    #result1 td, #result1 th { font-size: 10px; padding: 3px; }
    #legend { width: 100%; }
    .form-container { margin: 15px; padding: 15px; }
}
