html {
    scroll-behavior: smooth;
}

:root {
    --school-maroon: #800000;
    --school-gold: #d4af37;
    --shs-orange: #f97316;
}

.dept-page {
    font-family: 'Inter', sans-serif;
    background-color: #f4f7f6;
    padding: 50px 20px;
}

/* --- Department Banners --- */
.banner-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    max-width: 1400px;
    margin: 0 auto 30px auto;
    justify-content: center;
    overflow: visible !important;
}

.dept-banner {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    height: 80px;
    background: #fff;
    border-left: 6px solid var(--school-maroon);
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: visible !important;
    cursor: help;
}

.dept-banner:hover {
    transform: translateY(-3px);
    background: #fafafa;
    z-index: 1000;
}

.dept-logo-small {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 15px;
    flex-shrink: 0;
}

.dept-name-banner {
    color: var(--school-maroon);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

/* --- Hover Info Popup --- */
.hover-info {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 105%;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    z-index: 9999 !important;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    border: 1px solid #ddd;
}

.hover-info::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
}

.dept-banner:hover .hover-info {
    visibility: visible;
    opacity: 1;
}

.info-section { margin-bottom: 12px; }
.info-section:last-child { margin-bottom: 0; }

.info-label {
    display: block;
    color: #800000;
    font-weight: 800;
    font-size: 0.7rem;
    text-transform: uppercase;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.info-text {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.4;
    text-align: justify;
}

/* --- Programs Section --- */
.programs-section {
    padding-top: 10px;
    max-width: 900px;
    margin: 0 auto;
}

.section-title-alt {
    text-align: center;
    color: #1e293b;
    font-weight: 800;
    font-size: 2.2rem;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.dept-card-horizontal {
    background: #fff;
    border-radius: 12px;
    padding: 35px 45px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 25px;
    scroll-margin-top: 100px;
}

.dept-card-horizontal:hover {
    transform: translateX(8px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.08);
}

.grad-card { border-left: 12px solid #6b21a8; background: linear-gradient(to right, #faf5ff, #ffffff); }
.undergrad-card { border-left: 12px solid #dc2626; background: linear-gradient(to right, #fef2f2, #ffffff); }
.shs-card { border-left: 12px solid var(--shs-orange); background: linear-gradient(to right, #fff7ed, #ffffff); }
.hs-card { border-left: 12px solid #eab308; background: linear-gradient(to right, #fefce8, #ffffff); }
.elem-card { border-left: 12px solid #2563eb; background: linear-gradient(to right, #eff6ff, #ffffff); }

.prog-dept-name {
    font-weight: 800;
    font-size: 1.6rem;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
    color: #1e293b;
    border-bottom: 2px solid rgba(0,0,0,0.05);
    width: 100%;
    padding-bottom: 10px;
}

.course-list {
    padding: 0;
    margin: 0;
    list-style: none;
    width: 100%;
}

/* Leveled sublists with an indentation layout */
.sub-course-list {
    padding-left: 25px;
    margin: 0;
    list-style: none;
    width: 100%;
}

.group-title {
    display: block;
    padding: 12px 0 6px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

.course-item {
    position: relative;
    padding: 8px 0 8px 25px;
    font-size: 1.05rem;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
}

.course-item::before {
    content: "\f111";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 14px;
    font-size: 0.6rem;
    color: #800000;
}

.course-item:hover {
    color: var(--school-maroon);
    padding-left: 30px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .banner-row { flex-wrap: wrap; }
    .dept-banner { flex: 0 0 45%; max-width: none; height: 80px; }
    .dept-card-horizontal { padding: 25px; }
    .prog-dept-name { font-size: 1.3rem; }
}