/* ============================================================
   D Y Patil Law School – Result Management System
   Custom Styles
   ============================================================ */

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

:root {
    --primary: #1a237e;
    --primary-dark: #0d1659;
    --primary-light: #3949ab;
    --accent: #e91e63;
    --accent-light: #f48fb1;
    --gold: #f9a825;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #f57f17;
    --sidebar-w: 260px;
    --header-h: 64px;
    --bg: #f4f6fb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 2px 16px rgba(26, 35, 126, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ── Sidebar ─────────────────────────────────────── */
#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(26, 35, 126, 0.25);
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand .brand-logo {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 10px;
}

.sidebar-brand .brand-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-brand .brand-sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.nav-section-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 14px 20px 6px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 20px;
    border-radius: 0;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link .nav-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--gold);
}

.sidebar-nav .nav-link:hover .nav-icon,
.sidebar-nav .nav-link.active .nav-icon {
    background: rgba(249, 168, 37, 0.25);
}

/* ── Top Header ──────────────────────────────────── */
#topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--header-h);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    z-index: 1040;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

#topbar .page-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
    flex: 1;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 24px;
    padding: 5px 14px 5px 10px;
    font-size: 12.5px;
    font-weight: 600;
}

.admin-badge .avatar {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

/* ── Main Content ────────────────────────────────── */
#main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    padding: 28px;
    min-height: calc(100vh - var(--header-h));
}

/* ── Cards ───────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    font-weight: 700;
    font-size: 15px;
    color: var(--primary);
    border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ── Stat Cards ──────────────────────────────────── */
.stat-card {
    border-radius: var(--radius);
    padding: 24px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card .stat-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 54px;
    /* opacity: 0.15; */
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0;
}

.stat-primary {
    background: linear-gradient(135deg, #1a237e, #3949ab);
}

.stat-success {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

.stat-warning {
    background: linear-gradient(135deg, #e65100, #f57c00);
}

.stat-danger {
    background: linear-gradient(135deg, #880e4f, #c2185b);
}

.stat-teal {
    background: linear-gradient(135deg, #004d40, #00796b);
}

/* ── Tables ──────────────────────────────────────── */
.table th {
    background: #f8faff;
    color: var(--primary);
    font-weight: 700;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-color: var(--border);
    white-space: nowrap;
}

.table td {
    border-color: var(--border);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8faff;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #ad1457);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-accent:hover {
    filter: brightness(1.1);
    color: #fff;
}

/* ── Forms ───────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    font-size: 13.5px;
    padding: 9px 14px;
    transition: border 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.12);
}

.form-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

/* ── Badges ──────────────────────────────────────── */
.badge-grade {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}

.grade-O {
    background: #e8f5e9;
    color: #1b5e20;
}

.grade-Aplus {
    background: #e3f2fd;
    color: #0d47a1;
}

.grade-A {
    background: #e8eaf6;
    color: #1a237e;
}

.grade-Bplus {
    background: #e0f7fa;
    color: #006064;
}

.grade-B {
    background: #f3e5f5;
    color: #6a1b9a;
}

.grade-C {
    background: #fff3e0;
    color: #e65100;
}

.grade-D {
    background: #fce4ec;
    color: #880e4f;
}

.grade-F {
    background: #ffebee;
    color: #b71c1c;
}

.badge-published {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}

.badge-unpublished {
    background: #ffebee;
    color: #c62828;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 12px;
}

/* ── Login Page ──────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1659 0%, #1a237e 40%, #283593 70%, #1565c0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(26, 35, 126, 0.3);
}

/* ── Marks Entry Grid ────────────────────────────── */
.marks-table th {
    font-size: 11px !important;
    padding: 8px 6px !important;
}

.marks-table td {
    padding: 6px 5px !important;
}

.marks-input {
    width: 70px;
    text-align: center;
    font-size: 13px;
    padding: 5px 6px !important;
    border-radius: 6px !important;
}

.total-display {
    display: inline-block;
    min-width: 48px;
    text-align: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
    padding: 4px 8px;
    background: #f0f4ff;
    border-radius: 6px;
}

/* ── Public Portal ───────────────────────────────── */
.portal-hero {
    background: linear-gradient(135deg, #0d1659 0%, #1a237e 50%, #283593 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
}

.portal-card {
    background: #fff;
    border-radius: 24px;
    padding: 48px 44px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.portal-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(26, 35, 126, 0.3);
}

/* ── Result Sheet ────────────────────────────────── */
.result-sheet {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.result-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px 32px;
    text-align: center;
    margin: -32px -32px 28px;
}

.result-header h1 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 4px;
}

.result-header p {
    margin: 0;
    opacity: .85;
    font-size: 13px;
}

.result-meta .meta-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.result-meta .meta-label {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 12.5px;
    min-width: 140px;
}

.result-meta .meta-value {
    font-weight: 600;
    color: var(--text);
}

.result-badge-pass {
    display: inline-block;
    padding: 8px 32px;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    border-radius: 30px;
    letter-spacing: 2px;
}

.result-badge-fail {
    display: inline-block;
    padding: 8px 32px;
    background: linear-gradient(135deg, #b71c1c, #c62828);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    border-radius: 30px;
    letter-spacing: 2px;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
    }

    #topbar,
    #main-content {
        left: 0 !important;
        margin-left: 0 !important;
    }

    #main-content {
        padding: 16px;
    }

    .portal-card {
        padding: 32px 20px;
    }

    .login-card {
        padding: 32px 24px;
    }
}

/* ── Animated decorations ────────────────────────── */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.pulse-dot {
    position: relative;
    display: inline-block;
    width: 10px;
    height: 10px;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse-ring 1.5s infinite;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: #4caf50;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #c7d0e8;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ── Utility ─────────────────────────────────────── */
.text-primary-custom {
    color: var(--primary) !important;
}

.bg-primary-custom {
    background: var(--primary) !important;
}

.fw-800 {
    font-weight: 800;
}

.section-divider {
    border: 0;
    border-top: 2px solid var(--border);
    margin: 24px 0;
}