/*
 * Portal CSS - ResultSoft School Public Result Portal
 * Location: public/assets/css/portal.css
 */

/* ==========================================================================
   1. CSS Custom Properties & Reset
   ========================================================================== */
:root {
    --portal-font: 'Hind Siliguri', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    --portal-primary: #1d4ed8;
    --portal-primary-hover: #1e40af;
    --portal-dark: #0f172a;
    --portal-slate: #f8fafc;
    --portal-border: #e2e8f0;
}

body,
button,
input,
select,
textarea,
.form-control,
.form-select,
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
label,
table,
th,
td {
    font-family: var(--portal-font) !important;
}

body {
    color: #1e293b;
    background-color: var(--portal-slate);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-size: 15.5px;
    line-height: 1.6;
}

/* ==========================================================================
   2. Navbar & Header
   ========================================================================== */
.portal-navbar {
    background: #ffffff;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid #f1f5f9;
}

.portal-logo-crest {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #38bdf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    flex-shrink: 0;
}

.portal-logo-crest-sm {
    width: 36px;
    height: 36px;
    font-size: 18px;
    border-radius: 8px;
}

.portal-logo-crest-lg {
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-radius: 10px;
}

.portal-brand-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--portal-dark);
    line-height: 1.25;
    letter-spacing: -0.3px;
    margin: 0;
    white-space: nowrap;
}

.portal-brand-sub {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin: 0;
    line-height: 1.35;
    white-space: nowrap;
}

/* Language switch bar in navbar */
.portal-lang-toggle {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px;
    overflow: hidden;
    height: 34px;
    display: flex;
    align-items: center;
}

.lang-toggle-btn {
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    height: 100%;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.15s ease;
}

.lang-toggle-btn.active {
    background: var(--portal-primary);
    color: #ffffff !important;
}

.lang-toggle-btn.inactive {
    background: #ffffff;
    color: #64748b !important;
}

.lang-toggle-btn.inactive:hover {
    background: #f1f5f9;
    color: var(--portal-primary) !important;
}

/* Single-row responsive container */
.portal-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
}

.btn-portal-login {
    font-size: 13.5px;
    padding: 7px 16px;
}

@media (max-width: 576px) {
    .portal-navbar {
        padding: 8px 0;
    }

    .portal-logo-crest {
        width: 34px;
        height: 34px;
        font-size: 18px;
        border-radius: 8px;
    }

    .portal-brand-title {
        font-size: 14.5px;
    }

    .portal-lang-toggle {
        height: 30px;
    }

    .lang-toggle-btn {
        font-size: 12px;
        padding: 0 8px;
    }

    .btn-portal-login {
        font-size: 12.5px;
        padding: 5px 10px;
    }
}


/* ==========================================================================
   3. Hero Section
   ========================================================================== */
.portal-hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #172554 100%);
    padding: 2.2rem 0;
    color: #ffffff;
    position: relative;
}

.portal-hero-badge {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 13px;
    border-radius: 20px;
    padding: 5px 14px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
}

.portal-hero-title {
    font-size: clamp(24px, 5vw, 36px);
    letter-spacing: -0.5px;
    color: #ffffff !important;
    font-weight: 800;
    margin-bottom: 8px;
}

.portal-hero-desc {
    color: #e2e8f0 !important;
    font-size: 16px;
    max-width: 640px;
    margin: 0 auto;
}

/* ==========================================================================
   4. Search Section & Card
   ========================================================================== */
.portal-search-section {
    margin-top: 2rem;
    padding-bottom: 3rem;
}

.portal-search-container {
    max-width: 760px;
    margin: 0 auto;
}

.portal-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--portal-dark) !important;
    margin-bottom: 4px;
}

.portal-card-subtitle {
    font-size: 13.5px;
    color: #64748b;
}

.portal-form-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    display: block;
}

.portal-input,
.form-select.portal-input,
.form-control.portal-input {
    font-size: 15.5px !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    background-color: #ffffff !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.portal-input:focus,
.form-select.portal-input:focus,
.form-control.portal-input:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15) !important;
    outline: none !important;
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.btn-portal-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff !important;
    font-weight: 700;
    font-size: 16px;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.btn-portal-primary:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.38);
    color: #ffffff !important;
}

.btn-portal-outline {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b !important;
    font-weight: 600;
    font-size: 14px;
    padding: 7px 16px;
    border-radius: 8px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.btn-portal-outline:hover {
    border-color: #1d4ed8;
    color: #1d4ed8 !important;
    background: #eff6ff;
}

/* ==========================================================================
   6. Result Marksheet Modal & Elements
   ========================================================================== */
.portal-modal-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--portal-border);
    padding: 12px 20px;
}

.portal-modal-body {
    background: #ffffff;
    padding: 20px;
}

.portal-modal-footer {
    background: #f8fafc;
    border-top: 1px solid var(--portal-border);
    padding: 10px 16px;
}

.portal-marksheet-frame {
    border: 2px double #1e3a8a;
    border-radius: 10px;
    padding: 18px;
}

.portal-school-name {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a !important;
    line-height: 1.25;
}

.portal-grade-table {
    max-width: 280px;
    font-size: 11px;
    margin-left: auto;
    margin-bottom: 0;
}

.portal-grade-thead {
    font-size: 11px;
    background-color: #f1f5f9;
}

.portal-student-box {
    background-color: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    padding: 14px;
    font-size: 14px;
    margin-bottom: 1.25rem;
}

/* Metric summary cards */
.portal-metric-card {
    padding: 14px;
    border-radius: 8px;
    text-align: center;
}

.portal-metric-card.metric-passed {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
}

.portal-metric-card.metric-gpa {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
}

.portal-metric-card.metric-merit {
    background: #fefce8;
    border: 1.5px solid #fef08a;
}

.portal-metric-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    display: block;
}

.metric-label-passed {
    color: #166534;
}

.metric-label-gpa {
    color: #1e40af;
}

.metric-label-merit {
    color: #854d0e;
}

.portal-metric-value {
    font-size: 18px;
    font-weight: 700;
    margin-top: 4px;
    margin-bottom: 0;
}

.metric-value-passed {
    color: #15803d !important;
}

.metric-value-gpa {
    color: #1d4ed8 !important;
}

.metric-value-merit {
    color: #0f172a !important;
}

.portal-gpa-badge {
    background: #1d4ed8;
    color: #ffffff;
    font-size: 13px;
    margin-left: 4px;
    border-radius: 4px;
    padding: 2px 6px;
}

/* ==========================================================================
   7. Mobile Subject Cards (< md)
   ========================================================================== */
.portal-subject-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.portal-subject-title {
    font-size: 17.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.portal-subject-sub {
    font-size: 13.5px;
    color: #64748b;
    margin-top: 2px;
}

.portal-subject-breakdown {
    font-size: 13.5px;
    color: #475569;
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.portal-subject-breakdown span strong {
    color: #0f172a;
    font-size: 14px;
}

.portal-subject-score {
    min-width: 78px;
    text-align: center;
    padding-left: 8px;
    flex-shrink: 0;
}

.portal-subject-total {
    font-size: 22px;
    font-weight: 800;
    color: var(--portal-primary);
    line-height: 1;
}

.portal-subject-grade {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.portal-subject-gp {
    font-size: 12.5px;
    color: #64748b;
    font-weight: 600;
    margin-top: 3px;
}

.portal-mobile-total {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portal-remarks-box {
    background: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    padding: 14px;
    font-size: 13.5px;
    line-height: 1.5;
}

/* ==========================================================================
   8. Footer
   ========================================================================== */
.portal-footer {
    background: #0f172a;
    color: rgba(255, 255, 255, 0.6);
    padding: 14px 0;
    font-size: 13.5px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.portal-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.15s ease;
}

.portal-footer a:hover {
    color: #ffffff;
}

/* ==========================================================================
   9. Print Styles
   ========================================================================== */
@media print {

    .portal-navbar,
    .portal-footer,
    .no-print {
        display: none !important;
    }

    body {
        background: #ffffff !important;
        padding: 0 !important;
    }

    .portal-marksheet-frame {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        padding: 16px !important;
        margin: 0 !important;
        width: 100% !important;
    }
}

/* Width helper utilities */
.th-w-70 {
    width: 70px !important;
}

.th-w-75 {
    width: 75px !important;
}

.th-w-90 {
    width: 90px !important;
}