/* ============================================
   VLS BLAZOR - Base Application Styles
   Matching existing Web Forms design
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --transition: 0.3s ease;
}
html, body { height: 100%; }
body { font-family: var(--font-main); font-size: 15px; line-height: 1.6; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }

/* FACULTY SELECTOR */
.faculty-selector-page {
    min-height: 100vh;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.faculty-selector-container { width: 100%; max-width: 680px; }
.selector-subtitle { text-align: center; color: #555; font-size: 1.05rem; margin-bottom: 40px; }
.faculty-grid { display: flex; flex-direction: column; gap: 20px; }
.faculty-card {
    display: flex; align-items: center; gap: 24px;
    padding: 28px 32px; background: #f8f8f8; border: none; border-radius: 16px;
    cursor: pointer; text-align: left; font-family: inherit;
    transition: all var(--transition); box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.faculty-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.faculty-logo {
    width: 72px; height: 72px; border-radius: 14px; object-fit: contain;
    flex-shrink: 0;
}
.nda-logo { background: linear-gradient(135deg, #1ba188, #0b3b85); padding: 8px; }
.nma-logo { background: white; padding: 4px; }
.bom-logo-text {
    width: 72px; height: 72px; border-radius: 14px; background: #e53e3e;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1rem; letter-spacing: 1px; color: white; flex-shrink: 0;
}
.faculty-content { flex: 1; text-align: center; }
.faculty-name { font-size: 1.2rem; font-weight: 700; color: #1a1a1a; margin-bottom: 6px; }
.faculty-description { font-size: 0.9rem; color: #666; line-height: 1.4; }
.faculty-arrow {
    width: 40px; height: 40px; border-radius: 50%; background: #e8e8e8;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: #888; flex-shrink: 0; transition: all var(--transition);
}
.faculty-card:hover .faculty-arrow { background: #d0d0d0; color: #333; }

/* LOGIN PAGE */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-container {
    width: 100%; max-width: 420px; text-align: center; padding: 40px;
    animation: slideIn 0.6s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.login-logo { width: 80px; height: auto; margin-bottom: 15px; display: block; margin-left: auto; margin-right: auto; }
.academy-name { font-size: 0.8rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 30px; }
.login-title { font-size: 2rem; font-weight: 600; margin-bottom: 8px; line-height: 1.2; }
.login-subtitle { font-size: 1rem; margin-bottom: 40px; line-height: 1.4; }
.login-form { text-align: left; }
.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; }
.login-input {
    width: 100%; padding: 16px 18px; border-radius: 12px; font-size: 1rem;
    font-family: inherit; transition: all var(--transition); outline: none;
}
.remember-row { margin-bottom: 24px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }
.error-message {
    background: rgba(231,76,60,0.9); color: white; padding: 12px; border-radius: 8px;
    margin-bottom: 16px; font-size: 0.9rem; text-align: center;
}
.login-btn {
    width: 100%; padding: 16px; border: none; border-radius: 12px; font-size: 1.1rem;
    font-weight: 600; color: white; cursor: pointer; transition: all var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit;
}
.login-btn:hover { transform: translateY(-2px); }
.login-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.spinner {
    width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-links { text-align: center; margin-top: 24px; }
.forgot-link, .signup-link { font-weight: 500; text-decoration: none; font-size: 0.9rem; transition: color var(--transition); }
.forgot-link:hover, .signup-link:hover { text-decoration: underline; }
.signup-text { margin-top: 12px; font-size: 0.95rem; }

/* DASHBOARD PAGE */
.dashboard-page { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar */
.top-bar {
    background: white; height: 60px; display: flex; align-items: center;
    justify-content: space-between; padding: 0 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative; z-index: 600;
}
.hamburger-btn {
    position: fixed; top: 10px; left: 20px; z-index: 999999;
    background: rgba(52,73,94,0.9); border: 2px solid #34495e; border-radius: 8px;
    width: 50px; height: 50px; cursor: pointer; color: white; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3); transition: all var(--transition);
}
.hamburger-btn:hover { background: rgba(52,73,94,1); transform: scale(1.1); }
.top-bar-left {
    display: flex; align-items: center; gap: 12px; margin-left: 60px;
}
.top-bar-right {
    display: flex; align-items: center; gap: 20px;
}
.top-bar-img { height: 45px; max-height: 45px; width: auto; max-width: 120px; margin-right: 10px; object-fit: contain; }
.top-bar-logo { font-weight: 600; font-size: 0.95rem; color: #333; }
.top-bar-user { font-size: 0.9rem; color: #666; }

/* Slide-out nav */
.nav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999997; }
.nav-sidebar {
    position: fixed; top: 0; left: 0; width: 300px; height: 100vh;
    background: linear-gradient(180deg, #2c3e50, #34495e); z-index: 999998;
    box-shadow: 5px 0 25px rgba(0,0,0,0.5); overflow-y: auto;
    animation: slideInNav 0.3s ease;
}
@keyframes slideInNav { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.nav-header {
    padding: 30px 25px; background: rgba(0,0,0,0.3); color: white;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}
.nav-header h2 { margin-bottom: 4px; }
.nav-header small { opacity: 0.7; }
.nav-items { padding: 10px 0; }
.nav-menu-item {
    display: block; padding: 15px 25px; color: rgba(255,255,255,0.85);
    text-decoration: none; font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.1); transition: background var(--transition);
}
.nav-menu-item:hover, .nav-menu-item.active { background: rgba(255,255,255,0.1); color: white; }

/* Dashboard body */
.dashboard-body { flex: 1; padding: 1.5rem; padding-left: calc(1.5rem + 80px); }
.welcome-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; color: white;
}
.welcome-header h2 { font-size: 1.3rem; font-weight: normal; }
.welcome-header em { font-style: italic; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-logout {
    background: white; color: black; border: none; padding: 6px 16px;
    border-radius: 6px; cursor: pointer; font-size: 0.9rem; font-family: inherit;
    transition: all var(--transition);
}
.role-display { color: rgba(255,255,255,0.7); font-size: 0.9rem; }

/* Navigation overview grid */
.overview-card {
    background: white; border-radius: 12px; padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin-bottom: 2rem;
}
.overview-card h3 { margin-bottom: 1rem; font-size: 1.1rem; color: #333; }
.nav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.nav-grid a {
    display: block; text-align: center; background: #f5f5f5; padding: 12px;
    border-radius: 8px; text-decoration: none; color: #333; font-weight: 500;
    transition: all 0.2s; font-size: 0.9rem;
}
.nav-grid a:hover { background: #0b3b85; color: white; }

/* Cards */
.cards-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem; margin-bottom: 1.5rem;
}
.card {
    background: white; color: black; padding: 1.5rem; border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.card h4 { font-weight: 600; margin-bottom: 0.5rem; font-size: 0.95rem; color: #333; }
.value { font-size: 2rem; font-weight: bold; color: #000; }
.value-row { display: flex; align-items: center; justify-content: space-between; }
.faculty-label { font-size: 2rem; font-weight: bold; margin-right: 8px; }
.loading-text { font-size: 2rem; color: #999; }
.clickable-number {
    color: #007bff; text-decoration: underline; cursor: pointer; font-size: 2rem;
    font-weight: bold; transition: color 0.2s, transform 0.2s; display: inline-block;
}
.clickable-number:hover { color: #0056b3; transform: scale(1.05); }
.card-divider { border-top: 1px solid #e0e0e0; margin: 10px 0; }

/* Trends */
.meta { font-size: 0.85rem; margin-top: 0.5rem; }
.meta.green { color: #10b981; }
.meta.red { color: #ef4444; }
.meta.gray { color: #6b7280; }
.meta-live { font-size: 0.85rem; }
.live-dot { color: #28a745; animation: pulseDot 2s infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.meta-gray { font-size: 0.85rem; color: #6b7280; margin-top: 4px; }

/* Responsive */
@media (max-width: 768px) {
    .cards-row { grid-template-columns: 1fr; }
    .nav-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-body { padding-left: 1rem; }
    .welcome-header { flex-direction: column; gap: 10px; align-items: flex-start; }
}
@media (max-width: 480px) { .nav-grid { grid-template-columns: 1fr; } }

/* ============================================
   STUDENT LIST PAGE
   ============================================ */
.student-list-body {
    padding: 20px; padding-left: calc(20px + 80px);
    min-height: calc(100vh - 60px);
}
.student-list-container {
    max-width: 1600px; margin: 0 auto; background: white;
    border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); padding: 30px;
}
.list-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid #e0e0e0;
}
.list-header h1 { font-size: 28px; color: #333; margin: 0; }
.list-meta { color: #666; font-size: 14px; margin-top: 4px; }
.header-actions { display: flex; gap: 10px; }
.btn {
    padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer;
    font-size: 14px; text-decoration: none; display: inline-block;
    transition: background 0.2s; font-family: inherit;
}
.btn-primary { background: #007bff; color: white; }
.btn-primary:hover { background: #0056b3; }
.btn-success { background: #28a745; color: white; }
.btn-success:hover { background: #218838; }
.btn-secondary { background: #6c757d; color: white; }
.btn-secondary:hover { background: #5a6268; }

/* Filters */
.filters { display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-group { flex: 1; min-width: 200px; }
.filter-group label { display: block; margin-bottom: 5px; font-weight: 500; color: #555; }
.filter-group input, .filter-group select {
    width: 100%; padding: 8px 12px; border: 1px solid #ddd;
    border-radius: 4px; font-size: 14px; font-family: inherit;
}

/* Table */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
thead { background: #f8f9fa; }
th {
    padding: 12px; text-align: left; font-weight: 600; color: #333;
    border-bottom: 2px solid #dee2e6; white-space: nowrap; user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable::after { content: " \21C5"; color: #999; }
th.sorted-asc::after { content: " \2191"; color: #007bff; }
th.sorted-desc::after { content: " \2193"; color: #007bff; }
th:hover { background: #e9ecef; }
tbody tr { border-bottom: 1px solid #dee2e6; transition: background 0.15s; }
tbody tr:hover { background: #f8f9fa; }
td { padding: 12px; color: #555; }
.loading-cell { text-align: center; padding: 40px; color: #999; }
.error-banner {
    padding: 20px; background: #f8d7da; border: 1px solid #f5c6cb;
    border-radius: 4px; color: #721c24; margin-bottom: 20px;
}

/* Badge */
.badge { display: inline-block; padding: 4px 8px; border-radius: 3px; font-size: 12px; font-weight: 500; }
.badge-danger { background: #dc3545; color: white; }
.badge-warning { background: #ffc107; color: #333; }
.badge-success { background: #28a745; color: white; }
.badge-info { background: #17a2b8; color: white; }

/* Pagination */
.pagination-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 20px; padding-top: 20px; border-top: 1px solid #dee2e6;
}
.pagination-info { color: #666; font-size: 14px; }
.pagination-controls { display: flex; gap: 5px; }
.pagination-controls button {
    padding: 8px 12px; border: 1px solid #dee2e6; background: white;
    cursor: pointer; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.pagination-controls button:hover:not(:disabled) { background: #f8f9fa; }
.pagination-controls button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination-controls button.active { background: #007bff; color: white; border-color: #007bff; }

@media (max-width: 768px) {
    .student-list-body { padding-left: 20px; }
    .student-list-container { padding: 15px; }
    .list-header { flex-direction: column; align-items: flex-start; }
    .header-actions { margin-top: 10px; width: 100%; }
    .filters { flex-direction: column; }
    table { font-size: 12px; }
    th, td { padding: 8px; }
}

/* Unread mail badge */
.nav-menu-item .unread-badge,
a .unread-badge {
    display: inline-block;
    background: #e53e3e;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    margin-left: 0.4rem;
    min-width: 18px;
    text-align: center;
    vertical-align: middle;
    line-height: 1.3;
}

/* Online users panel */
.card-clickable { cursor: pointer; transition: box-shadow 0.15s; }
.card-clickable:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.online-users-panel {
    position: fixed !important;
    top: 80px !important;
    right: 24px !important;
    width: 360px;
    max-height: 70vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 9999;
    color: #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.online-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}
.online-users-header h4 { margin: 0; font-size: 1rem; color: #333; }
.close-panel-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #888;
    padding: 0.25rem;
}
.close-panel-btn:hover { color: #333; }
.online-users-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.online-user-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f8f8f8;
}
.online-user-row:hover { background: #f5f8ff; }
.online-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #0b3b85;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    position: relative;
}
.online-dot-sm {
    position: absolute;
    bottom: -1px;
    right: -1px;
    font-size: 0.6rem;
    color: #48bb78;
}
.online-user-info { flex: 1; min-width: 0; }
.online-user-name {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
}
.online-user-meta {
    display: block;
    font-size: 0.75rem;
    color: #999;
}
.online-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* Sub note on metric cards */
.sub-note {
    font-size: 0.75rem;
    color: #999;
    margin-top: -0.25rem;
}
