* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #fff;
    color: #333;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

/* Top bar navigation */
.top-bar {
    background-color: #276135;
    color: white;
    padding: 8px 0;
    position: relative;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-back {
    display: flex;
    align-items: center;
}

.back-link {
    display: flex;
    align-items: center;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: white;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #f9c90e;
}

.back-arrow {
    margin-right: 6px;
    font-size: 14px;
    transition: transform 0.3s ease;
}

.back-link:hover .back-arrow {
    transform: translateX(-3px);
}

.top-bar-links {
    display: flex;
    gap: 20px;
}

.top-bar-links a {
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s ease;
}

.top-bar-links a:hover {
    color: #f9c90e;
}

/* Main header and navigation */
.main-header {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    position: relative;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
}

.university-name {
    font-family: 'Lexend', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

.university-name .main-title {
    font-size: 16px;
    text-transform: uppercase;
}

.university-name .subtitle {
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    gap: 25px;
}

.nav-item {
    position: relative;
    padding: 10px 0;
}

.nav-item>a {
    font-family: 'Lexend', sans-serif;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-item>a::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid currentColor;
}

.nav-item.no-dropdown>a::after {
    display: none;
}

.header-home-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.header-home-link:hover .university-name {
    color: #276135;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 240px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-item:hover .dropdown {
    opacity: 1;
    visibility: visible;
}

.dropdown-toggle {
    cursor: default; 
    pointer-events: none;
}

.dropdown-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: #f9f9f9;
}

/* Course content */
.course-content {
    padding: 50px 0;
    background-color: #fff;
    position: relative;
    flex: 1;
}

.course-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 5% 10%, rgba(39, 97, 53, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 95% 85%, rgba(249, 201, 14, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.header-section {
    margin-bottom: 40px;
    position: relative;
}

h1 {
    color: #276135;
    font-family: 'Montserrat', sans-serif;
    font-size: 32px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 20px;
    position: relative;
}

h1::after {
    content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #276135, #276135 70%, rgba(39, 97, 53, 0.7));
    margin-top: 15px;
}

.course-description {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    text-align: justify;
    line-height: 1.6;
    font-size: 16px;
    max-width: 900px;
}

.accordion-section {
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.course-drawer {
    margin-bottom: 30px;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    background-color: #fff;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.course-drawer:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.course-drawer__content-wrapper {
    font-size: 1.25em;
    line-height: 1.4em;
    max-height: 0px;
    overflow: hidden;
    transition: 0.25s ease-in-out;
}

.course-drawer__title {
    border-top: #e0e0e0 1px solid;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.25em;
    font-weight: 700;
    padding: 20px 20px;
    position: relative;
    margin-bottom: 0;
    transition: all 0.25s ease-out;
    color: #fff;
    background: linear-gradient(to right, #276135, #2d7440);
}

.course-drawer__title:hover {
    background: linear-gradient(to right, #1a462b, #225b32);
    color: white;
}

.course-drawer__title::after {
    border-style: solid;
    border-width: 2px 2px 0 0;
    content: " ";
    display: inline-block;
    height: 12px;
    position: relative;
    transform: rotate(135deg);
    transition: 0.35s ease-in-out;
    width: 12px;
    flex-shrink: 0;
}

.course-drawer__trigger:checked+.course-drawer__title+.course-drawer__content-wrapper {
    max-height: 3000px;
}

.course-drawer__trigger:checked+.course-drawer__title::after {
    transform: rotate(-45deg);
    transition: 0.25s ease-in-out;
}

.course-year-description {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    text-align: justify;
    line-height: 1.6;
    font-size: 0.9em;
    margin-top: 20px;
    margin-bottom: 15px;
    padding: 0 20px;
}

input[type="checkbox"] {
    display: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    display: block;
    padding: 0 20px 20px;
}

/* Table */
.course-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: 15px;
    border-radius: 10px;
    overflow: hidden;
    background-color: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.course-table thead {
    background-color: #f2f2f2;
}

.course-table th {
    text-transform: uppercase;
    padding: 15px 10px;
    font-size: 0.8em;
    text-align: left;
    font-weight: 600;
    color: #000;
}

.course-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(1, 1, 1, 0.05);
    font-size: 0.85em;
    vertical-align: top;
    line-height: 1.3;
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    word-wrap: break-word;
}

.course-table th:nth-child(1),
.course-table td:nth-child(1) {
    width: 120px;
    min-width: 120px;
    /* Course Code */
}

.course-table th:nth-child(2),
.course-table td:nth-child(2) {
    width: 280px;
    min-width: 280px;
    /* Name */
}

.course-table th:nth-child(3),
.course-table td:nth-child(3) {
    width: 70px;
    min-width: 70px;
    /* Units */
    text-align: center;
}

.course-table th:nth-child(4),
.course-table td:nth-child(4) {
    width: 100px;
    min-width: 100px;
    /* Semester */
    text-align: center;
}

.course-table tr:hover {
    background-color: #f9f9f9;
}

.course-name {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3;
}

/* Semester tags */
.first-sem,
.second-sem,
.summer {
    padding: 0.3rem 0.7rem;
    border-radius: 40px;
    display: inline-block;
    font-size: 0.8em;
    font-weight: 500;
}

.first-sem {
    background-color: #eef2fe;
    color: #5487fa;
}

.second-sem {
    background-color: #e6f7ea;
    color: #36b356;
}

.summer {
    background-color: #fff0ee;
    color: #f33e5d;
}

/* Units tooltips */
.units-lab,
.units-rle {
    position: relative;
    cursor: help;
    transition: color 0.2s ease;
}

.units-lab:hover,
.units-rle:hover {
    color: #276135;
}

.units-lab::after,
.units-rle::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.units-lab::before,
.units-rle::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px 5px 0;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.units-lab:hover::after,
.units-lab:hover::before,
.units-rle:hover::after,
.units-rle:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Hamburger menu */
.hamburger-menu {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    z-index: 101;
    margin-left: auto;
}

.bar {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.mobile-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    z-index: 102;
    color: #333;
}

/* Responsiveness */
@media only screen and (max-width: 1200px) {
    .container {
        width: 90%;
    }
}

@media only screen and (max-width: 992px) {
    .container {
        width: 90%;
    }

    .header-inner {
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        gap: 0 !important;
    }

    .hamburger-menu {
        display: flex;
    }

    .mobile-close {
        display: block;
        position: absolute;
        top: 10px;
        right: 10px;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        color: #000;
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        z-index: 100;
        padding: 0;
        opacity: 0;
        visibility: hidden;
    }

    .main-nav.active {
        max-height: 100vh;
        opacity: 1;
        visibility: visible;
    }

    .nav-item {
        width: 100%;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-item > a {
        padding: 15px 20px;
        width: 100%;
        display: flex;
        justify-content: space-between;
        color: #000;
        font-size: 14px;
    }

    .nav-item > a::after {
        margin-left: auto !important;
        transform: rotate(0deg);
        transition: transform 0.3s ease;
        border-top-color: #000;
    }

    .nav-item.active > a::after {
        transform: rotate(180deg);
    }

    .nav-item:hover {
        background-color: #f5f5f5;
    }

    .dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
        background-color: #f5f5f5;
    }

    .nav-item.active .dropdown {
        visibility: visible;
        max-height: 500px;
    }

    .dropdown-item {
        padding-left: 40px;
        border-color: rgba(0, 0, 0, 0.05);
    }

    .dropdown-item a {
        color: #000;
        opacity: 1;
    }

    .dropdown-item:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    h1 {
        font-size: 28px;
    }
}

@media only screen and (max-width: 768px) {
    .container {
        width: 90%;
    }

    h1 {
        font-size: 24px;
    }

    .course-drawer__title {
        font-size: 1.1rem;
        padding: 20px 15px;
    }

    .table-responsive {
        padding: 0 10px 10px;
    }

    .course-table {
        table-layout: auto;
    }

    .course-table thead {
        display: none;
    }

    .course-table td {
        display: block;
        width: 100%;
        text-align: right;
        position: relative;
        padding-left: 45%;
        min-height: 30px;
        box-sizing: border-box;
        font-size: 0.85em;
        word-break: break-word;
        hyphens: auto;
    }

    .course-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 12px;
        width: 40%;
        font-weight: 600;
        text-align: left;
    }

    .course-table tr {
        margin-bottom: 15px;
        display: block;
        border: 1px solid rgba(1, 1, 1, 0.1);
        border-radius: 5px;
    }

    .course-table td:nth-child(1),
    .course-table td:nth-child(2),
    .course-table td:nth-child(3),
    .course-table td:nth-child(4) {
        width: 100%;
        text-align: right;
    }

    .units-lab, .units-rle {
        white-space: nowrap;
    }
}

@media (max-width: 576px) {
    .back-link {
        font-size: 13px;
    }
    
    .back-arrow {
        font-size: 13px;
    }
}

@media only screen and (max-width: 480px) {
    .container {
        width: 92%;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .header-section {
        margin-bottom: 30px;
    }

    .course-description {
        font-size: 14px;
    }

    .course-year-description {
        font-size: 14px;
    }

    .course-table td {
        padding: 10px 10px 10px 45%; 
        font-size: 0.8em; 
    }
      
    .first-sem, .second-sem, .summer {
        padding: 0.2rem 0.5rem; 
        font-size: 0.75em; 
    }
      
    .course-table td[data-label="Course Code"] {
        word-break: break-all;
    }
}

@media only screen and (max-width: 360px) {
    .course-table td {
      padding-left: 42%; 
      font-size: 0.75em; 
    }
    
    .course-table td:before {
      font-size: 0.9em; 
    }
}