/* ==========================================================================
    results-modern.css  —  Page-specific redesign for results.php
    Mirrors the design language of Exam_Duty/examduty.php.
    Loaded AFTER includes/styles.php so only results.php is affected.
    The result .data-table / .table-scroll (tables.css) is intentionally
    left untouched.
    ========================================================================== */

:root{
    --r-primary:#16a34a;
    --r-primary-dark:#15803d;
    --r-primary-light:#dcfce7;
    --r-bg:#f0fdf4;
    --r-card-bg:#ffffff;
    --r-text:#1e293b;
    --r-text-muted:#64748b;
    --r-border:#e2e8f0;
    --r-shadow:0 4px 6px -1px rgba(0,0,0,0.05),0 2px 4px -2px rgba(0,0,0,0.05);
    --r-shadow-lg:0 10px 15px -3px rgba(0,0,0,0.08),0 4px 6px -4px rgba(0,0,0,0.06);
    --r-radius:16px;
    --r-radius-sm:10px;
    --r-transition:0.25s ease;
}

body{
    font-family:'Segoe UI',system-ui,-apple-system,sans-serif;
    background:var(--r-bg);
    color:var(--r-text);
}

/* ---------- Header (matches Exam Duty banner card) ---------- */
.results-page .card{ overflow:visible; }
.results-page .header{
    background:#fff;
    border-radius:16px;
    overflow:hidden;
    box-shadow:var(--r-shadow);
    border:1px solid var(--r-border);
}

.results-page .header img{
    width:100%;
    display:block;
}

.results-page .header-text{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:18px 20px 22px;
    border-top:4px solid var(--r-primary);
}

.results-page .title{
    font-size:24px;
    font-weight:800;
    color:var(--r-text);
}

.results-page .subtitle{
    font-size:15px;
    font-weight:600;
    color:var(--r-primary);
    padding:0;
    margin:0;
    border:none;
    display:block;
}
/* ---------- Search card (matches Exam Duty form card) ---------- */
.results-page .search-box{
    background:var(--r-card-bg);
    border-radius:var(--r-radius);
    padding:28px;
    box-shadow:var(--r-shadow);
    border:1px solid var(--r-border);
    margin-top:0;
}
.results-page .search-box .form-group{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    align-items:stretch;
}
.results-page .search-box select,
.results-page .search-box input[type="text"]{
    flex:1;
    min-width:200px;
    padding:12px 16px;
    border:2px solid var(--r-border);
    border-radius:var(--r-radius-sm);
    font-size:15px;
    outline:none;
    transition:all var(--r-transition);
    background:#fff;
    font-family:inherit;
    color:var(--r-text);
    appearance:none;
    -webkit-appearance:none;
}
.results-page .search-box select{
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%2316a34a' d='M6 8L1 3h10z'/></svg>");
    background-repeat:no-repeat;
    background-position:right 16px center;
    padding-right:38px;
}
.results-page .search-box select:focus,
.results-page .search-box input[type="text"]:focus{
    border-color:var(--r-primary);
    box-shadow:0 0 0 3px rgba(22,163,74,0.1);
}

/* ---------- Buttons (matches Exam Duty btn styles) ---------- */
.results-page button{
    padding:12px 22px;
    border:none;
    border-radius:var(--r-radius-sm);
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:all var(--r-transition);
    font-family:inherit;
    background:var(--r-primary);
    color:#fff;
    display:inline-flex;
    align-items:center;
    gap:8px;
    white-space:nowrap;
}
.results-page button:hover{
    background:var(--r-primary-dark);
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(22,163,74,0.3);
}
.results-page .link-btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:12px 22px;
    border:none;
    border-radius:var(--r-radius-sm);
    font-size:14px;
    font-weight:600;
    cursor:pointer;
    transition:all var(--r-transition);
    font-family:inherit;
    white-space:nowrap;
    background:var(--r-primary);
    color:#fff;
    text-decoration:none;
    text-align:center;
}
.results-page .link-btn:hover{
    background:var(--r-primary-dark);
    color:#fff;
    transform:translateY(-1px);
    box-shadow:0 4px 12px rgba(22,163,74,0.3);
}
.results-page .link-btn.outline{
    background:#fff;
    color:var(--r-primary);
    border:2px solid var(--r-primary);
}
.results-page .link-btn.outline:hover{
    background:var(--r-primary-light);
    box-shadow:none;
}

/* ---------- Actions row ---------- */
.results-page .actions{
    margin-top:28px;
    display:flex;
    justify-content:center;
    flex-wrap:wrap;
    gap:12px;
}

/* ---------- Error box (matches Exam Duty error-box) ---------- */
.results-page .error-box{
    display:flex;
    align-items:center;
    gap:12px;
    background:#fef2f2;
    color:#991b1b;
    padding:16px 18px;
    border-radius:12px;
    border:1px solid #fecaca;
    font-weight:600;
    font-size:14px;
    margin-top:0;
}
.results-page .error-box::before{
    content:"\f057";
    font-family:"Font Awesome 6 Free";
    font-weight:900;
    font-size:18px;
    flex-shrink:0;
}

/* ---------- Student info card (matches Exam Duty staff-box) ---------- */
.results-page .student-box{
    background:var(--r-card-bg);
    border-radius:var(--r-radius);
    box-shadow:var(--r-shadow);
    border:1px solid var(--r-border);
    padding:24px;
    position:relative;
    overflow:hidden;
    margin-top:0;
    border-left:none;
}
.results-page .student-box::before{
    content:'';
    position:absolute;
    top:0;left:0;
    width:4px;height:100%;
    background:var(--r-primary);
    border-radius:0 4px 4px 0;
}
.results-page .student-box .student-head{
    display:flex;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
}
.results-page .student-box .student-avatar{
    width:52px;height:52px;
    border-radius:14px;
    flex-shrink:0;
    background:var(--r-primary-light);
    color:var(--r-primary);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
}
.results-page .student-box .student-name{
    font-size:22px;
    font-weight:800;
    color:var(--r-text);
    line-height:1.2;
}
.results-page .student-box .regno{
    margin-top:14px;
    display:flex;
    flex-wrap:wrap;
    gap:10px 22px;
    color:var(--r-text-muted);
    font-size:14px;
    align-items:center;
}
.results-page .student-box .regno strong{color:#475569;font-weight:600}
.results-page .student-box .code-pill{
    background:var(--r-primary-light);
    color:var(--r-primary-dark);
    padding:4px 12px;
    border-radius:999px;
    font-weight:700;
    letter-spacing:0.5px;
}

/* ---------- Publish Soon box (modernized card) ---------- */
.results-page .publish-box{
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:14px;
    background:var(--r-card-bg);
    border-radius:var(--r-radius);
    box-shadow:var(--r-shadow);
    border:1px solid var(--r-border);
    padding:40px 24px;
    margin-top:0;
    text-align:center;
}
.results-page .publish-box.publish-off{
    background:var(--r-card-bg);
    color:var(--r-text);
    border-left:1px solid var(--r-border);
}
.results-page .publish-logo{
    width:120px;
    height:120px;
    border-radius:50%;
    object-fit:contain;
    object-position:center;
    opacity:0.95;
    margin-bottom:0;
}
.results-page .publish-text{
    font-size:22px;
    font-weight:600;
    color:var(--r-text);
}

/* ---------- Footer (matches Exam Duty footer) ---------- */
.results-page .footer{
    margin-top:30px;
    text-align:center;
    color:var(--r-text-muted);
    font-size:12px;
    border-top:none;
}
.results-page .spacer{ height:0; }

/* ---------- Responsive (matches Exam Duty behavior) ---------- */
@media(max-width:768px){
    .results-page .search-box{padding:20px}
    .results-page .search-box .form-group{flex-direction:column}
    .results-page .search-box select,
    .results-page .search-box input[type="text"]{width:100%}
    .results-page .btn,
    .results-page button,
    .results-page .link-btn{width:100%;justify-content:center}
    .results-page .actions{flex-direction:column}
    .results-page .title{font-size:20px}
}

@media print{
    body.results-page{background:#fff;padding:0;display:block}
    .results-page .header,
    .results-page .search-box,
    .results-page .student-box,
    .results-page .publish-box{box-shadow:none;border-radius:0;border:none}
    .results-page .search-box,
    .results-page .actions,
    .results-page .footer{display:none}
}
