/* ============================================================
   Delhi College — Journalism & Media Studies Portal
   journalism.css  |  Theme: Monochrome News / Black & White
   Palette: Ink Black · Charcoal · Press Gray · Newsprint White
   ============================================================ */

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

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

/* ── Design Tokens ── */
:root {
    --forest: #111111;          /* Ink Black Background/Text */
    --forest-mid: #1F2937;      /* Dark Charcoal */
    --forest-light: #374151;    /* Charcoal Accent */
    --mint: #000000;            /* Primary Accent (Pure Black) */
    --mint-dark: #111111;       /* Deep Black */
    --mint-light: #4B5563;      /* Press Gray */
    --mint-pale: #F3F4F6;       /* Newsprint Off-White / Light Gray */
    --ivory: #F9FAFB;           /* Clean Base White */
    --white: #FFFFFF;
    --slate: #374151;           /* Muted Body Text */
    --slate-light: #6B7280;     /* Light Caption Gray */
    --border: #D1D5DB;          /* Border Gray */
    --row-alt: #F9FAFB;         /* Alternating Row Tint */
    --danger: #000000;          /* High Contrast Black for alerts */
    --danger-bg: #F3F4F6;
    --green: #000000;           /* Unified Monochrome Grades */
    --blue: #111111;
    --cyan: #1F2937;
    --amber: #374151;
    --orange: #4B5563;
    --gray: #9CA3AF;

    --r-sm: 4px;                /* Crisper, sharper edges for newsprint look */
    --r-md: 8px;
    --r-lg: 12px;
    --shadow: 0 8px 40px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* ── 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;
    filter: grayscale(100%); /* Keeps backgrounds matched to the theme */
    transition: opacity 1.8s ease-in-out;
}

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

.bg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.82);
    z-index: -1;
}

/* ══════════════════════════════════════
   LOGO BOX
══════════════════════════════════════ */
.logo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--mint); /* Bold editorial border */
    text-align: center;
}

.press-logo,
.faculty-crest {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mint);
    box-shadow: 0 0 0 4px var(--mint-pale);
    filter: grayscale(100%);
    flex-shrink: 0;
}

.logo-box h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--forest);
    line-height: 1.2;
}

.subtitle, .tagline {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate-light);
    margin-top: 4px;
}

/* Compact variant used in results header */
.logo-box.compact {
    flex-direction: row;
    text-align: left;
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.press-logo-small,
.faculty-crest-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);
    filter: grayscale(100%);
}

.logo-box.compact h2 {
    font-size: 1.15rem;
}

/* ══════════════════════════════════════
   CARDS & FORMS
══════════════════════════════════════ */
.card {
    position: relative;
    z-index: 10;
    background: var(--white);
    border-radius: var(--r-lg);
    border-top: 6px solid var(--mint);
    box-shadow: var(--shadow);
}

.login-card {
    width: min(440px, 94vw);
    margin: 52px auto 60px;
    padding: 40px 38px 32px;
}

.form-group, .field-group {
    margin-bottom: 18px;
}

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

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

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

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

select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--border);
    border-radius: var(--r-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.94rem;
    color: var(--forest);
    background: var(--white);
    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='%23111111' stroke-width='2' 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(0, 0, 0, 0.15);
}

.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.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-headline, .btn-primary {
    width: 100%;
    padding: 13px;
    font-size: 0.92rem;
    margin-top: 8px;
    background: var(--mint);
    color: var(--white);
}

.btn-headline:hover, .btn-primary:hover {
    background: var(--forest-light);
}

.btn-editorial, .btn-secondary, .btn-ghost {
    background: var(--white);
    color: var(--forest);
    border: 2px solid var(--mint);
}

.btn-editorial:hover, .btn-secondary:hover, .btn-ghost:hover {
    background: var(--mint);
    color: var(--white);
}

.btn-logout, .btn-danger {
    background: var(--white);
    color: var(--forest);
    border: 2px solid var(--border);
}

.btn-logout:hover, .btn-danger:hover {
    background: #000000;
    color: var(--white);
    border-color: #000000;
}

.btn:active {
    transform: scale(0.98);
}

/* ── Alerts & Loading ── */
.alert, .error-msg {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--r-sm);
    background: var(--mint-pale);
    border: 2px solid var(--mint);
    color: var(--forest);
    font-size: 0.87rem;
    font-weight: 600;
    line-height: 1.45;
}

.loading-spinner-wrap, .loading-state {
    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(--border);
    border-top-color: var(--mint);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

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

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

.back-link:hover {
    color: var(--mint);
    text-decoration: underline;
}

/* ══════════════════════════════════════
   RESULTS CARD
══════════════════════════════════════ */
.results-card {
    width: min(820px, 96vw);
    margin: 40px auto 64px;
    overflow: hidden;
}

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

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

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

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

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

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

/* Status markers injected dynamically */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--r-sm);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
    background: #000000 !important; /* Uniform strict monochrome badges */
}

/* ── 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;
}

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

.course-block {
    border-radius: var(--r-md);
    overflow: hidden;
    border: 2px solid var(--mint);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

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

/* ── Table Matrix ── */
.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(--white);
    border-bottom: 1px solid var(--mint);
}

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

.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: 600;
}

/* ── Clean Monochrome Grades ── */
td.grade-A, td.grade-B, td.grade-C, td.grade-D, td.grade-E, td.grade-F {
    color: var(--forest) !important;
    font-weight: 700;
}

/* ── Metrics Block ── */
.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 18px 22px;
    background: var(--forest);
    border-top: 2px 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(--gray);
}

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

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

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

    .card {
        box-shadow: none !important;
    }

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

    .results-header {
        padding: 16px 20px;
    }
    .student-profile-sheet, .student-info {
        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 DESIGN
══════════════════════════════════════ */
@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-profile-sheet, .student-info {
        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;
    }
    .bg-slide {
        transition: none;
    }
    .btn {
        transition: none;
    }
}