:root {
    --primary-color: #003366;
    /* Deep Blue */
    --secondary-color: #D4AF37;
    /* Gold */
    --text-color: #333333;
    --bg-color: #f9f9f9;
    --sidebar-width: 280px;
    --header-height: 60px;
    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Merriweather', serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    /* Fix for horizontal scrolling */
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-color);
    color: white;
    position: fixed;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile viewport fix */
    overflow-y: auto;
    padding-top: 20px;
    padding-bottom: 80px;
    /* Ensure bottom items are reachable on mobile */
    /* Custom Scrollbar for Sidebar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    border: 1px solid transparent;
    background-clip: content-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}



.sidebar-header {
    text-align: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    margin: 0;
    font-size: 1.2rem;
    color: var(--secondary-color);
    width: 100%;
    /* Ensure text alignment works within flex */
}

.sidebar-header small {
    display: block;
    margin-top: 15px;
}

.sidebar-logo {
    display: block;
    /* Ensure block behavior */
    width: 112px;
    height: auto;
    object-fit: contain;
    /* Make logo white */
    filter: brightness(0) invert(1) contrast(200%);
    -webkit-filter: brightness(0) invert(1) contrast(200%);
    margin-bottom: 15px;
    /* Unified margin */
    opacity: 1;
    will-change: transform;
    /* Hint to browser to create layer */
    background-color: transparent !important;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links a {
    display: block;
    padding: 15px 25px;
    color: #e0e0e0;
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
    padding-left: 30px;
    /* Slide effect */
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px 60px;
}

/* Sidebar Sub-items and Groups */
/* Sidebar Sub-items and Groups */
.nav-item-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 15px 25px;
    color: #e0e0e0;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.nav-item-toggle:hover,
.nav-item-toggle.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--secondary-color);
}

.arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.nav-item-toggle.open .arrow {
    transform: rotate(180deg);
}

.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.15);
}

.sub-menu.open {
    max-height: 500px;
    /* Arbitrary large height for transition */
}

.sub-menu a {
    padding: 12px 25px 12px 40px;
    /* Indented */
    font-size: 0.9rem;
    border-bottom: none;
    border-left: 3px solid transparent;
}

.sub-menu a:hover,
.sub-menu a.active {
    border-left: 3px solid var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.05);
    padding-left: 45px;
}

/* Academic Dept Wrapper */
#academic-department-wrapper,
.department-wrapper {
    background-color: #f0f4f8;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    border: 1px solid #e1e8ed;
}

.section-group-title {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 5px;
    margin-bottom: 25px;
}

/* Data Tables (Grading Scale) */
.table-responsive {
    overflow-x: auto;
}

.grading-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.grading-table th,
.grading-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.grading-table th {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
}

/* Section Intro Box */
.intro-box {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 25px;
}

.intro-box p {
    margin-bottom: 0 !important;
    font-style: italic;
    color: #555;
    font-size: 0.95rem;
}

.grading-table tr:hover {
    background-color: #f9f9f9;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 2000;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Sections */
section {
    background: white;
    padding: 40px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    scroll-margin-top: 20px;
    /* Helper for smooth scroll anchor */
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 10px;
}

h2 {
    font-size: 1.8rem;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

h3 {
    font-size: 1.4rem;
    margin-top: 25px;
    color: #444;
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
}

ul {
    line-height: 1.6;
}

/* Cover Page Specifics */
#cover {
    text-align: center;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.logo-placeholder {
    width: 150px;
    height: 150px;
    background-color: #ddd;
    border-radius: 50%;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-family: var(--font-heading);
}

.university-name {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.handbook-title {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 40px;
    font-weight: 300;
}

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

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 60px;
        /* Space for mobile header usually */
    }

    .menu-toggle {
        display: block;
    }
}

/* Department Blocks */
.department-block {
    background-color: white;
    border: 1px solid #e1e8ed;
    border-left: 4px solid var(--secondary-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    transition: transform 0.2s;
}

.department-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.department-block h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.department-block p {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #555;
}

.contact-info {
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
    margin-top: 15px;
    margin-bottom: 0 !important;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Program Cards */
.program-card {
    background-color: #fcfcfc;
    border: 1px solid #e1e8ed;
    border-left: 4px solid var(--secondary-color);
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.program-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--secondary-color);
}

.program-group-title {
    margin: 10px 0 18px;
    font-size: 1.2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
}

.program-course-title {
    font-size: 1.54rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--secondary-color);
    margin-bottom: 12px;
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.program-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.program-meta {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    background-color: #e9ecef;
    padding: 4px 10px;
    border-radius: 12px;
}

.program-section {
    margin-top: 20px;
}

.program-section h5 {
    font-size: 1rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.program-section-intro {
    margin-bottom: 10px;
    color: #555;
}

.program-section ul {
    margin: 0;
    padding-left: 20px;
}

.program-section li {
    margin-bottom: 8px;
    line-height: 1.7;
    color: #444;
}

.program-curriculum-block {
    margin-top: 18px;
}

.program-curriculum-block h6 {
    margin: 0 0 10px;
    font-family: var(--font-heading);
    font-size: 0.98rem;
    color: var(--primary-color);
}

.program-requirements h5 {
    font-size: 1rem;
    color: #333;
    margin-top: 20px;
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-color);
    padding-left: 10px;
}

.program-requirements-table {
    margin-top: 10px;
}

.program-requirements-table th {
    background-color: #111;
    color: #fff;
    text-align: center;
    vertical-align: middle;
}

.program-requirements-table td {
    text-align: center;
    vertical-align: middle;
}

.program-requirements-table td:first-child {
    text-align: left;
    font-weight: 600;
}

.program-requirements-note {
    margin-top: 10px;
    font-size: 0.95rem;
    color: #555;
}

.program-curriculum-table th,
.program-curriculum-table td {
    vertical-align: top;
    font-size: 0.9rem;
    line-height: 1.5;
}

.program-curriculum-table td:first-child {
    font-weight: 600;
    width: 18%;
}

/* Locked Sections */
.locked-section {
    opacity: 0.6;
    position: relative;
}

.locked-section h2,
.locked-section .section-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lock-icon {
    font-size: 0.8em;
    opacity: 0.8;
}

.locked-message {
    font-style: italic;
    color: #888;
    text-align: center;
    padding: 20px;
}
