/**
 * Royals Preparatory School - Student Portal Stylesheet
 * Official Branding: Deep Navy Blue (#0f2744, #0a192f) & Royal Gold (#d4af37)
 */

@import 'global.css';

:root {
    --student-primary: #0f2744;
    --student-navy-dark: #0a192f;
    --student-navy-light: #1b3d66;
    --student-navy-soft: #f0f4f8;
    --student-gold: #d4af37;
    --student-gold-light: #fdfaf0;
    --student-gold-dark: #b38f20;
    
    --bg-canvas: #f8fafc;
    --bg-surface: #ffffff;
    --bg-sidebar: #0a192f;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-subtle: #e2e8f0;
    
    --sidebar-width: 260px;
    --topbar-height: 65px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 4px 18px rgba(15, 39, 68, 0.06);
    --shadow-float: 0 10px 25px -5px rgba(15, 39, 68, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Shell Layout */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    border-right: 1px solid rgba(212, 175, 55, 0.2);
}

.sidebar-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--student-gold);
}

.sidebar-brand-name {
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.sidebar-brand-tag {
    font-size: 10px;
    color: var(--student-gold);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.student-user-badge {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.student-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--student-gold);
}

.student-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--student-navy-light);
    color: var(--student-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--student-gold);
}

.student-badge-info .name {
    font-weight: 600;
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.student-badge-info .index {
    font-size: 11px;
    color: var(--student-gold);
    font-family: monospace;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
}

.menu-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 12px 14px 6px;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.nav-link-custom i {
    font-size: 15px;
    width: 20px;
    text-align: center;
    color: #64748b;
}

.nav-link-custom:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nav-link-custom:hover i {
    color: var(--student-gold);
}

.nav-link-custom.active {
    color: #ffffff;
    background: var(--student-navy-light);
    border-left: 3px solid var(--student-gold);
    font-weight: 600;
}

.nav-link-custom.active i {
    color: var(--student-gold);
}

.portal-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navbar */
.portal-topbar {
    height: var(--topbar-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
}

/* Portal Content Area */
.portal-content {
    flex: 1;
    padding: 24px 28px;
}

/* Cards & Widgets */
.portal-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    overflow: hidden;
}

.portal-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.portal-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--student-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Metric / Stat Card */
.stat-box {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-float);
}

.stat-box-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-box-icon.navy {
    background: var(--student-navy-soft);
    color: var(--student-primary);
}

.stat-box-icon.gold {
    background: var(--student-gold-light);
    color: var(--student-gold-dark);
}

.stat-box-icon.success {
    background: #ecfdf5;
    color: #10b981;
}

.stat-box-icon.danger {
    background: #fef2f2;
    color: #ef4444;
}

.stat-box-info .label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-box-info .val {
    font-size: 22px;
    font-weight: 700;
    color: var(--student-primary);
    line-height: 1.2;
}

/* Table styles */
.portal-table {
    width: 100%;
    border-collapse: collapse;
}

.portal-table th {
    background: #f8fafc;
    color: var(--student-primary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-subtle);
}

.portal-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    vertical-align: middle;
}

.portal-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Buttons */
.btn-student-primary {
    background: var(--student-primary);
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-student-primary:hover {
    background: var(--student-navy-light);
    color: #ffffff;
}

.btn-student-gold {
    background: var(--student-gold);
    color: #0a192f;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: background 0.2s;
}

.btn-student-gold:hover {
    background: var(--student-gold-dark);
    color: #ffffff;
}

/* Print Styles for Report Cards and Receipts */
@media print {
    .portal-sidebar, .portal-topbar, .btn-print, .no-print, .impersonation-bar {
        display: none !important;
    }
    .portal-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .portal-card {
        border: none !important;
        box-shadow: none !important;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .portal-sidebar {
        transform: translateX(-100%);
    }
    .portal-sidebar.show {
        transform: translateX(0);
    }
    .portal-main {
        margin-left: 0;
    }
    .sidebar-toggle-btn {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .sidebar-header { padding: 14px 16px; }
    .student-user-badge { padding: 12px 16px; }
    .portal-card-header { flex-wrap: wrap; gap: 8px; padding: 14px 16px; }
    .portal-card-body { padding: 16px; }
    .stat-box { padding: 14px 16px; gap: 12px; }
    .portal-footer { padding: 14px 16px; text-align: center; }
}

