/**
 * WBSchool Result Pro - Student Portal Styles
 * Glassmorphism Login + Certificate-Quality Marksheet
 */

/* ===== GLOBAL STUDENT PORTAL STYLES ===== */
.wbsrp-student-portal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
}

/* ===== GLASSMORPHISM LOGIN ===== */
.wbsrp-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

/* Animated Background Circles */
.wbsrp-login-page::before,
.wbsrp-login-page::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
    animation: float 20s ease-in-out infinite;
    z-index: 1;
}

.wbsrp-login-page::before {
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.wbsrp-login-page::after {
    bottom: -200px;
    right: -200px;
    animation: float-reverse 25s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

@keyframes float-reverse {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-50px, -50px) scale(1.1);
    }
}

/* Login Card with Glassmorphism */
.wbsrp-login-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.3);
    padding: 4rem;
    width: 100%;
    max-width: 550px;
    /* Increased width */
    position: relative;
    z-index: 10;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wbsrp-login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.wbsrp-login-logo-img {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.wbsrp-login-title {
    font-size: 2.5rem;
    /* Increased size */
    font-weight: 800;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.wbsrp-login-subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 1.125rem;
    margin-bottom: 3rem;
    font-weight: 500;
}

.wbsrp-login-form-group {
    margin-bottom: 2rem;
}

.wbsrp-login-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 1rem;
    /* Increased size */
    letter-spacing: 0.02em;
}

.wbsrp-login-input {
    width: 100%;
    padding: 1.25rem 1.5rem;
    /* Larger padding */
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    font-size: 1.25rem;
    /* Larger font */
    font-weight: 500;
    color: white;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    /* Ensure padding doesn't overflow */
}

.wbsrp-login-input:focus {
    outline: none;
    background: rgba(15, 23, 42, 0.8);
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.wbsrp-login-input::placeholder {
    color: #64748b;
}

.wbsrp-login-btn {
    width: 100%;
    padding: 1.25rem;
    /* Larger padding */
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.25rem;
    /* Larger font */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.5);
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.wbsrp-login-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.6);
}

.wbsrp-login-btn:active {
    transform: translateY(-1px);
}

.wbsrp-login-help {
    text-align: center;
    margin-top: 2.5rem;
    color: #64748b;
    font-size: 0.95rem;
}

.wbsrp-login-help a {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.wbsrp-login-help a:hover {
    color: #60a5fa;
}

/* ===== MARKSHEET / RESULT CERTIFICATE ===== */
.wbsrp-result-page {
    background: #f1f5f9;
    min-height: 100vh;
    padding: 2rem;
}

.wbsrp-result-container {
    max-width: 900px;
    margin: 0 auto;
}

.wbsrp-result-certificate {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 3px solid #1e293b;
}

/* Certificate Header */
.wbsrp-cert-header {
    background: linear-gradient(135deg, #1e293b 0%, #2d4a72 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.wbsrp-cert-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
}

.wbsrp-school-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.wbsrp-school-name {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wbsrp-school-address {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.wbsrp-cert-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 1rem;
}

/* Student Info Section */
.wbsrp-student-info {
    padding: 2rem;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.wbsrp-student-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.wbsrp-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wbsrp-info-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wbsrp-info-value {
    font-weight: 700;
    color: #1e293b;
    font-size: 1rem;
}

/* Marks Table */
.wbsrp-marks-section {
    padding: 2rem;
}

.wbsrp-marks-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.wbsrp-marks-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.wbsrp-marks-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.wbsrp-marks-table th:last-child {
    border-right: none;
}

.wbsrp-marks-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.wbsrp-marks-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.wbsrp-marks-table td {
    padding: 1rem;
    color: #334155;
    font-weight: 500;
}

.wbsrp-marks-table tbody tr:last-child {
    background: #fef3c7;
    font-weight: 700;
    border-top: 3px solid #3b82f6;
    border-bottom: 3px solid #3b82f6;
}

/* Grade in Table */
.wbsrp-table-grade {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
}

.wbsrp-table-grade.grade-a-plus,
.wbsrp-table-grade.grade-a {
    background: #d1fae5;
    color: #065f46;
}

.wbsrp-table-grade.grade-b-plus,
.wbsrp-table-grade.grade-b {
    background: #dbeafe;
    color: #1e40af;
}

.wbsrp-table-grade.grade-c {
    background: #fef3c7;
    color: #92400e;
}

.wbsrp-table-grade.grade-d {
    background: #fed7aa;
    color: #9a3412;
}

.wbsrp-table-grade.grade-f {
    background: #fee2e2;
    color: #991b1b;
}

/* Result Summary Card */
.wbsrp-result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.wbsrp-summary-item {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.wbsrp-summary-item.result-pass {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.wbsrp-summary-item.result-fail {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.wbsrp-summary-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wbsrp-summary-value {
    font-size: 2rem;
    font-weight: 700;
}

/* Certificate Footer */
.wbsrp-cert-footer {
    padding: 2rem;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.wbsrp-signature {
    text-align: center;
}

.wbsrp-signature-line {
    width: 200px;
    height: 2px;
    background: #334155;
    margin-bottom: 0.5rem;
}

.wbsrp-signature-name {
    font-weight: 600;
    color: #1e293b;
}

.wbsrp-signature-title {
    font-size: 0.875rem;
    color: #64748b;
}

/* Print Button */
.wbsrp-action-buttons {
    text-align: center;
    margin: 2rem 0;
}

.wbsrp-print-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.wbsrp-print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.wbsrp-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f1f5f9;
    color: #334155;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 1rem;
    transition: all 0.2s ease;
}

.wbsrp-logout-btn:hover {
    background: #e2e8f0;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        margin: 0;
        padding: 0;
    }

    .wbsrp-result-page {
        background: white;
        padding: 0;
    }

    .wbsrp-action-buttons,
    .wbsrp-logout-btn,
    .no-print {
        display: none !important;
    }

    .wbsrp-result-certificate {
        box-shadow: none;
        border: 3px solid #1e293b;
        page-break-inside: avoid;
    }

    .wbsrp-cert-header {
        background: linear-gradient(135deg, #1e293b 0%, #2d4a72 100%);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color: white;
    }

    .wbsrp-marks-table thead {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        color: white;
    }

    .wbsrp-summary-item {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    @page {
        size: A4;
        margin: 1cm;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .wbsrp-login-card {
        padding: 2rem;
    }

    .wbsrp-result-page {
        padding: 1rem;
    }

    .wbsrp-cert-header {
        padding: 1.5rem;
    }

    .wbsrp-marks-section {
        padding: 1rem;
    }

    .wbsrp-marks-table {
        font-size: 0.875rem;
    }

    .wbsrp-marks-table th,
    .wbsrp-marks-table td {
        padding: 0.5rem;
    }

    .wbsrp-result-summary {
        grid-template-columns: 1fr;
    }

    .wbsrp-cert-footer {
        flex-direction: column;
        gap: 2rem;
        align-items: center;
    }
}

/* ===== LOADING STATE ===== */
.wbsrp-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.wbsrp-loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.wbsrp-error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    margin-bottom: 1rem;
}