@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1e293b;
    padding-top: 90px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* --- Layout Components --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000; /* Keeps header layered on top of all card components */
    height: 70px;
    background-color: rgba(255, 255, 255, 0.85); /* Slightly translucent */
    backdrop-filter: blur(12px); /* Premium cinematic frosted glass blur effect */
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    background-color: #e0e7ff;
    color: #2b4cb3;
    padding: 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.brand-title p {
    font-size: 0.85rem;
    color: #64748b;
}

.status-badge {
    background-color: #fef2f2;
    color: #ef4444;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #ef4444;
    border-radius: 50%;
}



/* --- Card Architecture --- */
.container {
    max-width: 800px;
    width: 90%;
    margin: 0 auto 3rem auto;
}

.portal-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.text-center {
    text-align: center;
    margin-bottom: 2rem;
}

.text-center h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.text-center p {
    color: #64748b;
    font-size: 0.95rem;
}
.btn-primary {
    width: 100%;
    background-color: #2b4cb3;
    color: #ffffff;
    border: none;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #1e3a8a;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #334155;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-field:focus {
    border-color: #2b4cb3;
}
/* --- Password Toggle & Username Check Utilities --- */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper .input-field {
    padding-right: 2.75rem; /* Make room so text doesn't overlap the icon */
    width: 100%;
}
.toggle-password-btn {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}
.toggle-password-btn:hover {
    color: #2b4cb3;
}
.username-status {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.35rem;
}
.status-available { color: #16a34a; }
.status-taken { color: #dc2626; }
/* --- Results Metadata Layout --- */
.student-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.meta-item span {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.meta-item p {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.meta-item p.highlight-class {
    color: #2b4cb3;
}

/* --- Data Presentation Tables --- */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.results-table th {
    text-align: left;
    padding: 0.75rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.results-table td {
    padding: 1rem 0;
    font-size: 0.95rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

.results-table td.fw-bold {
    font-weight: 600;
}

/* Dynamic Grade Badges */
.badge-grade {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
}

.text-muted {
    color: #64748b;
}

/* --- Aggregated Results Summary Card --- */
.summary-gradient-card {
    background: linear-gradient(135deg, #eef2ff 0%, #fef2f2 100%);
    border: none;
    margin-top: 2rem;
}

.summary-gradient-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.summary-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-block span {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-block p {
    font-size: 1.75rem;
    font-weight: 700;
}

.text-blue { color: #2b4cb3; }
.text-orange { color: #ea580c; }

.status-pass {
    background-color: #2b4cb3;
    color: #ffffff;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

/* --- Global Sticky Footer Component --- */
footer {
    margin-top: auto; /* Dynamically pushes footer to webpage absolute bottom */
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 0;
    text-align: center;
    width: 100%;
}

footer p {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

footer strong {
    color: #2b4cb3; /* Elegant corporate accent link coloration styling */
    font-weight: 600;
}

/* --- Authentication Layout Extensions --- */
.auth-container {
    max-width: 450px;
    margin: rem auto;
}
.admin-meta-info {
    display: flex;
    align-items: center;
    gap: 1.2rem; /* Spacing between the text stack, divider, and logout button */
}
.admin-user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns items neatly to the left */
    gap: 0.35rem; /* Spacing between the name and the badge underneath it */
}
.user-name-text {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}
/* Custom design match for the vibrant MASTER ADMIN role token */
.badge-role {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.3px;
    display: inline-block;
}

.badge-master {
    background-color: #00ff66; /* Vibrant green accent matched to snapshot */
    color: #000000;
}

.badge-coadmin {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Elegant thin separator bar staying centered next to the stack */
.header-divider {
    width: 1px;
    height: 32px; /* Made slightly taller to match the height of a 2-line stack */
    background-color: #cbd5e1;
}

/* High-contrast red logout action */
.logout-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ef4444; 
    text-decoration: none;
    transition: color 0.15s ease;
}

.logout-link:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* --- Administrative Grid Fixed Sidebar Layout --- */
.dashboard-wrapper {
    display: flex;
    min-height: calc(100vh - 70px);
    margin-top: 0;
}

/* Sidebar navigation container panel - NOW FIXED & SCROLLABLE */
.admin-sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;

    /* Pinned standard viewport fixing */
    position: fixed;
    top: 70px;     /* Begins right exactly below your 70px fixed header */
    bottom: 0;     /* Extends straight to the bottom of the visible viewport */
    left: 0;
    z-index: 900;  /* Remains layered neatly above contents but below headers */
    
    /* Enables scrolling on the sidebar itself if the items exceed the screen height */
    overflow-y: auto; 
}

/* Elegant, modern thin scrollbar styling for the sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 5px;
}
.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Dynamic workspace view containers - NOW OFFSET to account for the fixed sidebar */
.admin-content-workspace {
    flex: 1;
    padding: 2.5rem;
    background-color: #f8fafc;
    
    /* Pushes content rightward so it does not slip hidden beneath the fixed sidebar */
    margin-left: 260px; 
    min-height: calc(100vh - 70px);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.sidebar-btn.active {
    background-color: #f0f3ff;
    color: #2b4cb3;
}

.sidebar-btn svg {
    flex-shrink: 0;
}

.dashboard-module {
    display: none !important;
}

.dashboard-module.active-view {
   display: block !important;
}

/* Stats Counter grid dashboard look */
.stats-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.stat-mini-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}
.stat-mini-card h3 { font-size: 0.85rem; color: #64748b; text-transform: uppercase; margin-bottom: 0.5rem; }
.stat-mini-card p { font-size: 1.75rem; font-weight: 700; color: #0f172a; }

/* Positioning context for the instructor overlay */
.instructor-fixed-wrapper {
    position: fixed;
    bottom: 0;         /* Anchors the container straight to the bottom viewport boundary */
    right: 1%;         /* Positions it on the bottom-right side (change to 'left: 4%;' if preferred) */
    z-index: 10;       /* Ensures it sits cleanly on top of your background layers */
    pointer-events: none; /* Prevents the image bounding box from blocking clicks on elements beneath it */
}

.instructor-img {
    display: block;
    width: 350px;      /* Adjust the image size to fit your design layout profile */
    height: auto;      /* Preserves original aspect ratio proportions */
    filter: drop-shadow(0px 10px 25px rgba(0, 0, 0, 0.3)); /* Soft drop-shadow separating it from your background image */
    pointer-events: auto; /* Re-enables pointer hover interactions directly on the image itself */
    transition: transform 0.3s ease;
    filter: drop-shadow(0px 10px 20px rgba(0, 0, 0, 0.7));
}

/* Subtle cinematic hover feedback effect */
.instructor-img:hover {
    transform: translateY(-5px) scale(1.02);
    filter: drop-shadow(0px 18px 30px rgba(0, 0, 0, 0.55));
}

/* Responsive adjustment for small mobile viewports */
@media (max-width: 768px) {
    body, 
    .main-container,
    main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .instructor-fixed-wrapper,
    .instructor-wrapper {
        position: fixed !important;
        bottom: 80px !important;       /* Negative or near-zero values pull it all the way down */
        right: 5% !important;          /* Keeps it neatly tucked into the bottom right corner */
        left: auto !important;
        transform: none !important;
        z-index: 99 !important;        /* Keeps it sitting correctly layered */
        pointer-events: none;          /* Prevents the image frame from blocking finger clicks */
        line-height: 0 !important;     /* Eliminates hidden browser font spacing underneath */
    }

    /* 2. OPTIMIZE IMAGE SCALE FOR SMALL MOBILE FOOTPRINTS */
    .instructor-img {
        display: block !important;
        width: 160px !important;       /* Slightly smaller width so it fits perfectly on phone screen edges */
        height: auto !important;
        margin: 0 !important;
        pointer-events: auto;          /* Restores touch actions directly on the character image */
        
        /* Premium drop shadow blend to separate it from background graphics */
        filter: drop-shadow(0px -5px 15px rgba(0, 0, 0, 0.5)) !important;
    }

    .hero-content,
    .main-content {
        order: 1 !important; /* Pushes text content to show right BELOW the image */
        width: 100% !important;
        padding-bottom: 30px !important; /* Normal breathing space */
    }

    /* 5. FORCE FOOTER TO THE VERY BOTTOM WITHOUT OBSTRUCTIONS */
    footer,
    .site-footer {
        order: 2 !important; /* Guarantees the footer sits dead last in the column chain */
        position: relative !important;
        width: 100% !important;
        padding: 20px 10px !important;
        margin-top: auto !important;
        clear: both !important;
    }

    footer p{
        font-size: 0.7rem;
    }

}
