/* =========================
   GLOBAL RESET & BASE
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f4f6f9;
    color: #333;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* =========================
   LOADING SPINNER
========================= */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;              /* 🔴 DEFAULT HIDE */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay.active {
    display: flex;              /* ✅ SHOW ONLY WHEN ACTIVE */
}

/* =========================
   LOGIN SCREEN
========================= */
#studentLoginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #004aad, #007bff);
}

.login-card {
    background: #fff;
    padding: 35px;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-card .form-control {
    border-radius: 8px;
}

/* =========================
   DASHBOARD LAYOUT
========================= */
#studentDashboard {
    display: flex;
    min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 260px;
    background: #0d2a4a;
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background: #09305a;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h4 {
    margin-top: 10px;
    font-size: 18px;
}

.sidebar-header p {
    font-size: 13px;
    opacity: 0.85;
}

.student-info {
    background: rgba(255,255,255,0.08);
    padding: 10px;
    border-radius: 8px;
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-category {
    padding: 10px 20px;
}

.category-title {
    font-size: 13px;
    text-transform: uppercase;
    opacity: 0.7;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #fff;
    font-size: 14px;
    transition: 0.3s;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(255,255,255,0.15);
}

.menu-item i {
    width: 20px;
    text-align: center;
}

/* =========================
   MAIN CONTENT
========================= */
.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 20px;
}

/* =========================
   TOP BAR
========================= */
.top-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.top-bar h3 {
    margin: 0;
}

.user-info {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* =========================
   CONTENT SECTIONS
========================= */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* =========================
   DASHBOARD CARDS
========================= */
.welcome-card {
    background: #fff;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.stat-card i {
    font-size: 28px;
    margin-bottom: 8px;
}

/* =========================
   INFO CARDS
========================= */
.info-card {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* =========================
   PROFILE
========================= */
.profile-photo img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border: 4px solid #007bff;
}

.detail-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
}

.section-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.detail-item label {
    font-weight: 500;
    font-size: 13px;
    display: block;
}

.detail-item span {
    font-size: 14px;
}

/* =========================
   FORMS
========================= */
.form-section {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

/* =========================
   ID CARD
========================= */
.id-card {
    width: 320px;
    margin: auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    background: #fff;
}

.id-card-header {
    background: #004aad;
    color: #fff;
    padding: 10px;
}

.id-card-body {
    padding: 15px;
    display: flex;
    gap: 10px;
}

.id-photo img {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #004aad;
}

.id-details p {
    font-size: 13px;
    margin-bottom: 4px;
}

.id-card-footer {
    background: #f1f1f1;
    text-align: center;
    font-size: 12px;
    padding: 6px;
}

/* =========================
   TABLES
========================= */
.table-container {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.data-table th {
    background: #004aad;
    color: #fff;
}

.data-table td,
.data-table th {
    vertical-align: middle;
}

/* =========================
   ROLL NUMBER
========================= */
.roll-number-display h1 {
    font-size: 64px;
    color: #004aad;
    font-weight: 700;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 25px;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
