/* ============================================================
   Delhi College — Languages & Linguistics Portal
   languages.css  |  Theme: Royal Academic Blue
   Palette: Navy Blue · Classic Blue · Light Slate · Soft Ivory
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Design Tokens ── */
:root {
    --forest: #0B1B3D;          /* Deep Navy Text/Background */
    --forest-mid: #142A5C;      /* Mid Navy */
    --forest-light: #1E3A8A;    /* Royal Blue */
    --mint: #2563EB;            /* Accent Bright Blue */
    --mint-dark: #1D4ED8;       /* Deep Classic Blue */
    --mint-light: #93C5FD;      /* Light Sky Blue */
    --mint-pale: #EFF6FF;       /* Soft Ice Blue Tint */
    --ivory: #F8FAFC;           /* Clean Soft Background */
    --white: #FFFFFF;
    --slate: #334155;           /* Slate Body Text */
    --slate-light: #64748B;     /* Subtitle Caption Gray */
    --border: #CBD5E1;          /* Border Gray */
    --row-alt: #F1F5F9;         /* Alternating Table Row */
    --danger: #EF4444;          /* High Contrast Alert Red */
    --danger-bg: #FEF2F2;
    --green: #10B981;
    --blue: #2563EB;
    --cyan: #06B6D4;
    --amber: #F59E0B;
    --orange: #F97316;
    --gray: #64748B;

    --r-sm: 6px;
    --r-md: 12px;
    --r-lg: 18px;
    --shadow: 0 8px 40px rgba(11, 27, 61, 0.20), 0 2px 10px rgba(11, 27, 61, 0.12);
}

/* ── Base ── */
html,
body {
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: var(--forest);
    background: var(--forest);
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
    z-index: 0;
    isolation: isolate;
}

/* ══════════════════════════════════════
   BACKGROUND SLIDESHOW
══════════════════════════════════════ */
.bg-slideshow {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: var(--forest);
}

.bg-slide {
    position: absolute;
    inset: 0;
    background-color: var(--forest);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.8s ease-in-out;
}

.bg-slide.active {
    opacity: 1;
}

.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 46, 0.72);
    z-index: -1;
}

/* ══════════════════════════════════════
   LOGO BOX
══════════════════════════════════════ */
.logo-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.logo-box img {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--mint);
    box-shadow: 0 0 0 4px var(--mint-pale);
    flex-shrink: 0;
}

.logo-text h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--forest);
    line-height: 1.2;
}

.logo-text h2 {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--slate);
    margin-top: 2px;
}

.portal-tag {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--mint-pale);
    border: 1px solid var(--mint-light);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mint-dark);
}

/* Compact variant used in results header */
.logo-box.compact {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.logo-box.compact img {
    width: 52px;
    height: 52px;
}

.logo-box.compact .logo-text h1 {
    font-size: 1.1rem;
}
.logo-box.compact .logo-text h2 {
    font-size: 0.82rem;
}

/* ══════════════════════════════════════
   LOGIN CARD
══════════════════════════════════════ */
.login-card {
    position: relative;
    z-index: 10;
    width: min(440px, 94vw);
    margin: 52px auto 60px;
    padding: 40px 38px 32px;
    background: var(--white);
    border-radius: var(--r-lg);
    border-top: 5px solid var(--mint);
    box-shadow: var(--shadow);
}

/* ── Form Fields ── */
.field-group,
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--slate);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"] {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.94rem;
    color: var(--forest);
    background: var(--ivory);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus {
    border-color: var(--mint);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

input::placeholder {
    color: #CBD5E1;
    font-size: 0.88rem;
}

select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.94rem;
    color: var(--forest);
    background: var(--ivory);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23334155' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

select:focus {
    border-color: var(--mint);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.select-wrap {
    position: relative;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--r-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s, transform 0.14s, box-shadow 0.18s;
}

.btn-primary {
    width: 100%;
    padding: 13px;
    font-size: 0.92rem;
    margin-top: 8px;
    background: var(--mint);
    color: var(--white);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.32);
}

.btn-primary:hover {
    background: var(--mint-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(37, 99, 235, 0.42);
}

.btn-secondary,
.btn-ghost {
    background: var(--ivory);
    color: var(--forest);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover,
.btn-ghost:hover {
    background: var(--mint-pale);
    border-color: var(--mint);
    color: var(--forest);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1rem;
    font-weight: 400;
}

/* ── Error / Alert ── */
.error-msg,
.alert {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    background: var(--danger-bg);
    border-left: 4px solid var(--danger);
    color: var(--danger);
    font-size: 0.87rem;
    font-weight: 500;
    line-height: 1.45;
}

.error-alert {
    margin-top: 16px;
}

/* ── Loading ── */
.loading-state,
.loading-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    color: var(--slate);
    font-size: 0.88rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--mint-light);
    border-top-color: var(--mint);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

/* ── Card Footer ── */
.card-footer,
.card-footer-links {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.back-link {
    font-size: 0.83rem;
    color: var(--slate-light);
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--mint-dark);
}

/* ══════════════════════════════════════
   RESULTS CARD
══════════════════════════════════════ */
.results-card {
    position: relative;
    z-index: 10;
    width: min(820px, 96vw);
    margin: 40px auto 64px;
    background: var(--white);
    border-radius: var(--r-lg);
    border-top: 5px solid var(--mint);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 28px 36px 24px;
    border-bottom: 1px solid var(--border);
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Student Info Strip ── */
.student-info,
.student-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0;
    margin: 0 36px 28px;
    border-radius: var(--r-md);
    border: 1px solid var(--mint-light);
    overflow: hidden;
    background: var(--mint-pale);
}

.student-info div,
.student-profile-grid div {
    padding: 12px 16px;
    font-size: 0.88rem;
    color: var(--slate);
    border-right: 1px solid var(--mint-light);
    border-bottom: 1px solid var(--mint-light);
    line-height: 1.5;
}

.student-info div:last-child,
.student-profile-grid div:last-child {
    border-right: none;
}

.student-info strong,
.student-profile-grid strong {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--slate-light);
    margin-bottom: 2px;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
}

.status-active {
    background: #D97706;
}
.status-completed {
    background: var(--green);
}
.status-inactive {
    background: var(--danger);
}
.status-unknown {
    background: var(--gray);
}

/* ── Filter Group ── */
.filter-group {
    padding: 0 36px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group label {
    margin-bottom: 0;
    font-size: 0.72rem;
    color: var(--slate-light);
    white-space: nowrap;
}

.filter-group select {
    width: auto;
    min-width: 200px;
    padding: 8px 36px 8px 14px;
    font-size: 0.88rem;
}

/* ── Courses Container ── */
.courses-container {
    padding: 0 36px 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Course Block ── */
.course-block {
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(11, 27, 61, 0.06);
}

.course-header {
    padding: 14px 20px;
    background: var(--forest);
    border-bottom: 3px solid var(--mint);
}

.course-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.01em;
}

/* ── Results Table ── */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.91rem;
}

.results-table thead tr {
    background: var(--forest-mid);
}

.results-table thead th {
    padding: 11px 18px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mint-light);
}

.results-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.14s;
}

.results-table tbody tr:nth-child(even) {
    background: var(--row-alt);
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background: var(--mint-pale);
}

.results-table tbody td {
    padding: 12px 18px;
    color: var(--slate);
    vertical-align: middle;
}

.results-table tbody td:first-child {
    color: var(--forest);
    font-weight: 500;
}

/* ── Grade Colours ── */
td.grade-A {
    color: var(--green);
    font-weight: 700;
}
td.grade-B {
    color: var(--blue);
    font-weight: 700;
}
td.grade-C {
    color: var(--cyan);
    font-weight: 700;
}
td.grade-D {
    color: var(--amber);
    font-weight: 700;
}
td.grade-E {
    color: var(--orange);
    font-weight: 700;
}
td.grade-F {
    color: var(--danger);
    font-weight: 700;
}

/* ── Metrics Bar ── */
.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 18px 22px;
    background: var(--forest);
    border-top: 3px solid var(--mint);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric .label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mint-light);
}

.metric .value {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--mint);
    line-height: 1;
}

/* ── No Results Summary ── */
.summary {
    padding: 40px 24px;
    text-align: center;
    color: var(--slate);
}

.summary h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--forest);
    margin-bottom: 8px;
}

/* ── Tagline ── */
.tagline {
    font-size: 0.82rem;
    color: var(--slate-light);
    margin-top: 2px;
}

/* ── College Logo Variants ── */
.college-logo {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--mint);
    box-shadow: 0 0 0 4px var(--mint-pale);
}

.college-logo-small {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mint);
    box-shadow: 0 0 0 3px var(--mint-pale);
}

/* ── specific subtitle ── */
.subtitle {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--slate-light);
    margin-top: 2px;
}

/* ══════════════════════════════════════
   PRINT
══════════════════════════════════════ */
@media print {
    .bg-slideshow,
    .bg-overlay,
    .action-buttons,
    .card-footer,
    .card-footer-links,
    .filter-group {
        display: none !important;
    }

    body {
        background: var(--white) !important;
    }

    .results-card {
        width: 100% !important;
        margin: 0 !important;
        box-shadow: none !important;
        border-top: 3px solid var(--mint) !important;
    }

    .results-header {
        padding: 16px 20px;
    }
    .student-info,
    .student-profile-grid {
        margin: 0 20px 20px;
    }
    .courses-container {
        padding: 0 20px 20px;
    }

    .course-header,
    .results-table thead tr,
    .metrics {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 640px) {
    .login-card {
        padding: 30px 20px 26px;
        margin: 28px auto 40px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 18px 18px;
    }

    .student-info,
    .student-profile-grid {
        margin: 0 18px 22px;
        grid-template-columns: 1fr 1fr;
    }

    .courses-container {
        padding: 0 18px 28px;
    }

    .results-table {
        font-size: 0.82rem;
    }
    .results-table thead th,
    .results-table tbody td {
        padding: 9px 10px;
    }

    .metric .value {
        font-size: 1.6rem;
    }

    .filter-group {
        padding: 0 18px 14px;
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select {
        width: 100%;
        min-width: unset;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
        border-top-color: var(--mint);
    }
    .bg-slide {
        transition: none;
    }
    .btn {
        transition: none;
    }
}