/* Result Page Styles */

.result-hero {
    background: linear-gradient(135deg, #0c1f3f 0%, #0f4c5c 100%);
    padding: 100px 0 90px;
    min-height: 440px;
    display: flex;
    align-items: center;
    position: relative;
}

.result-hero-content {
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 2;
}

.result-hero-content h1 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

.result-hero-content p {
    font-size: 16px;
    margin-bottom: 32px;
    color: rgba(255,255,255,0.75);
}

.result-search-box {
    max-width: 520px;
    margin: 0 auto 16px;
    display: flex;
    gap: 10px;
    background: #fff;
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    position: relative;
    z-index: 3;
}

.result-search-box input {
    flex: 1;
    padding: 13px 18px;
    border: none;
    background: #f5f7fa;
    border-radius: 9px;
    font-size: 14px;
    outline: none;
    color: #1e293b;
    transition: box-shadow 0.2s ease;
}

.result-search-box input:focus {
    box-shadow: 0 0 0 2px #17a2b8;
}

.result-search-box input::placeholder {
    color: #94a3b8;
}

.btn-search {
    padding: 13px 26px;
    background: #17a2b8;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-search:hover {
    background: #138496;
}

.search-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    position: relative;
    z-index: 3;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12,31,63,0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
    color: #fff;
}

.loading-spinner {
    width: 64px;
    height: 64px;
    border: 5px solid rgba(255,255,255,0.15);
    border-top: 5px solid #17a2b8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.loading-content p {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
}

/* Result Display Section */
.result-display {
    display: none;
    padding: 70px 0;
}

.result-display.active {
    display: block;
}

.result-card {
    max-width: 850px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(15,23,42,0.08);
    overflow: hidden;
    animation: slideUp 0.4s ease;
    border: 1px solid #eef1f5;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    background: #0c1f3f;
    padding: 36px 30px;
    text-align: center;
    color: #fff;
}

.board-seal {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    border: 1px solid rgba(255,255,255,0.15);
    color: #5dcaa5;
}

.result-header h2 {
    font-size: 24px;
    margin-bottom: 4px;
    font-weight: 700;
}

.result-header p {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
}

.result-header h3 {
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    color: rgba(255,255,255,0.85);
}

.result-content {
    padding: 44px 40px;
    display: grid;
    grid-template-columns: 180px 1fr auto;
    gap: 36px;
    align-items: start;
}

.student-photo {
    width: 180px;
    height: 216px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15,23,42,0.1);
    border: 1px solid #eef1f5;
}

.student-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
}

.info-row {
    display: flex;
    padding: 13px 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-label {
    flex: 0 0 170px;
    font-weight: 500;
    color: #64748b;
    font-size: 14px;
}

.info-value {
    flex: 1;
    color: #1e293b;
    font-weight: 500;
    font-size: 14px;
}

.result-score {
    text-align: center;
}

.score-badge {
    background: #0f4c5c;
    padding: 26px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.percentage {
    font-size: 40px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.grade {
    font-size: 22px;
    font-weight: 600;
    color: #5dcaa5;
    margin-top: 8px;
}

.status-badge {
    padding: 12px 22px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
}

.status-badge.pass {
    background: #e1f5ee;
    color: #085041;
}

.status-badge.fail {
    background: #fcebeb;
    color: #791f1f;
}

.result-actions {
    padding: 32px 40px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 14px;
    justify-content: center;
}

.btn-action {
    padding: 13px 30px;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.btn-view {
    background: #fff;
    color: #0c1f3f;
    border: 1px solid #d3d1c7;
}

.btn-view:hover {
    background: #f5f7fa;
}

.btn-download {
    background: #0c1f3f;
    color: #fff;
}

.btn-download:hover {
    background: #16305a;
}

/* Not Found Section */
.result-not-found {
    display: none;
    padding: 90px 0;
}

.result-not-found.active {
    display: block;
}

.not-found-content {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.not-found-icon {
    width: 96px;
    height: 96px;
    background: #fcebeb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 40px;
    color: #a32d2d;
}

.not-found-content h2 {
    font-size: 26px;
    color: #0c1f3f;
    margin-bottom: 12px;
    font-weight: 700;
}

.not-found-content p {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 6px;
}

.not-found-content .btn {
    margin-top: 24px;
}

/* PDF Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12,31,63,0.75);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 14px;
    overflow: hidden;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 26px;
    background: #f8fafc;
    border-bottom: 1px solid #eef1f5;
}

.modal-header h3 {
    color: #0c1f3f;
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 34px;
    height: 34px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    color: #475569;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: #e2e8f0;
}

.modal-body {
    padding: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .result-hero {
        padding: 50px 0 40px;
        min-height: 350px;
    }

    .result-hero-content h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .result-hero-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .result-search-box {
        flex-direction: column;
        border-radius: 12px;
        gap: 8px;
        padding: 8px;
        margin: 0 15px 12px;
        max-width: calc(100% - 30px);
    }

    .result-search-box input,
    .btn-search {
        width: 100%;
        padding: 12px 14px;
        font-size: 14px;
    }

    .search-info {
        font-size: 12px;
        margin: 0 15px;
    }

    .result-card {
        margin: 0 10px;
        border-radius: 12px;
    }

    .result-header {
        padding: 20px 16px;
    }

    .board-seal {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin: 0 auto 12px;
    }

    .result-header h2 {
        font-size: 18px;
        margin-bottom: 3px;
    }

    .result-header p {
        font-size: 12px;
    }

    .result-header h3 {
        font-size: 12px;
        margin-top: 8px;
    }

    .result-content {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 20px 16px;
        gap: 16px;
        align-items: center;
    }

    .student-photo {
        width: 140px;
        height: 168px;
        margin: 0 auto 16px;
        border-radius: 10px;
    }

    .result-info {
        flex: 1;
    }

    .info-row {
        display: flex;
        flex-direction: column;
        padding: 10px 0;
        border-bottom: 1px solid #f1f5f9;
        text-align: center;
    }

    .info-label {
        flex: none;
        margin-bottom: 3px;
        font-size: 12px;
        color: #64748b;
    }

    .info-value {
        flex: none;
        color: #1e293b;
        font-size: 13px;
        font-weight: 600;
    }

    .result-score {
        text-align: center;
    }

    .score-badge {
        background: #0f4c5c;
        padding: 16px 12px;
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .percentage {
        font-size: 28px;
    }

    .grade {
        font-size: 16px;
        margin-top: 6px;
    }

    .status-badge {
        padding: 10px 18px;
        font-size: 12px;
        border-radius: 20px;
    }

    .result-actions {
        padding: 16px;
        background: #f8fafc;
        border-top: 1px solid #f1f5f9;
        display: flex;
        flex-direction: column;
        gap: 10px;
        justify-content: center;
    }

    .btn-action {
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
        border-radius: 8px;
        width: 100%;
        justify-content: center;
    }

    .not-found-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
        margin: 0 auto 16px;
    }

    .not-found-content h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .not-found-content p {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .not-found-content .btn {
        margin-top: 16px;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-header h3 {
        font-size: 14px;
    }

    .modal-body {
        padding: 0;
    }

    .modal-body iframe {
        height: 400px !important;
    }
}

@media (max-width: 480px) {
    .result-hero {
        padding: 40px 0 30px;
        min-height: 300px;
    }

    .result-hero-content h1 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .result-hero-content p {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .result-search-box {
        margin: 0 12px 10px;
        padding: 6px;
        gap: 6px;
    }

    .result-search-box input,
    .btn-search {
        padding: 10px 12px;
        font-size: 13px;
    }

    .search-info {
        font-size: 11px;
        margin: 0 12px;
    }

    .result-card {
        margin: 0 8px;
    }

    .result-header {
        padding: 16px 12px;
    }

    .board-seal {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .result-header h2 {
        font-size: 16px;
    }

    .result-header h3 {
        font-size: 11px;
    }

    .result-content {
        padding: 16px 12px;
        gap: 12px;
    }

    .student-photo {
        width: 120px;
        height: 144px;
        margin: 0 auto 12px;
    }

    .info-row {
        padding: 8px 0;
    }

    .info-label {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .info-value {
        font-size: 12px;
    }

    .score-badge {
        padding: 12px 8px;
    }

    .percentage {
        font-size: 24px;
    }

    .grade {
        font-size: 14px;
        margin-top: 4px;
    }

    .status-badge {
        padding: 8px 14px;
        font-size: 11px;
    }

    .result-actions {
        padding: 12px;
        gap: 8px;
    }

    .btn-action {
        padding: 10px 12px;
        font-size: 12px;
    }

    .btn-action i {
        font-size: 12px;
    }

    .not-found-icon {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .not-found-content h2 {
        font-size: 18px;
    }

    .not-found-content p {
        font-size: 12px;
    }

    .modal-body iframe {
        height: 300px !important;
    }
}