* {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    text-decoration: none;
    list-style: none;
    box-sizing: border-box;
}

:root {
    --color-primary: #293D60;
    --color-success: #00bf8e;
    --color-warning: #f7c94b;
    --color-danger: #f75842;
    --color-danger-variant: rgba(247, 88, 66, 0.4);
    --color-white: #fff;
    --color-light: rgba(255, 255, 255, 0.7);
    --color-black: #000;
    --color-bg: #1f2641;
    --color-bg1: hsl(216, 19%, 16%);
    --color-bg2: #ffffff;
    --container-width-lg: 80%;
    --container-width-md: 90%;
    --container-width-sm: 94%;
    --transition: all 400ms ease;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    color: var(--color-white);
    background: var(--color-bg);
}

.container {
    width: var(--container-width-lg);
    margin: 0 auto;
}

section {
    padding: 6rem 0;
}

section h2 {
    text-align: center;
    margin-bottom: 4rem;
}

h1, h2, h3, h4, h5 {
    line-height: 1.2;
}

h1 {
    font-size: 2.4rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.6rem;
}

h4 {
    font-size: 1.3rem;
}

a {
    color: var(--color-white);
}

img {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 10px;
}

.btn {
    display: inline-block;
    background: var(--color-white);
    color: var(--color-black);
    padding: 1rem 2rem;
    border: 1px solid transparent;
    font-weight: 500;
    transition: var(--transition);
}

.btn:hover {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.btn-primary {
    background: var(--color-danger);
    color: var(--color-white);
}

/* ========================== NAVBAR ========================== */

nav {
    background-color: #293D60;
    width: 100vw;
    height: 5rem;
    position: fixed;
    top: 0;
    z-index: 11;
}

/* change navbar styles on scroll using javascript */
.window-scroll {
    background: var(--color-primary);
    box-shadow: 0 1rem 2rem rgba(9, 8, 8, 0.2);
}

.nav__container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav button {
    display: none;
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav__menu a {
    font-size: 0.9rem;
    transition: var(--transition);
}

.nav__menu a:hover {
    color: #F75842;
}

/* ==================== NAVBAR ON SMALL SCREENS ==================== */
@media screen and (max-width: 1024px) {
    .container {
        width: var(--container-width-md);
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    /* Navbar toggle button */
    nav button {
        display: inline-block;
        background: transparent;
        font-size: 1.8rem;
        color: var(--color-white);
        cursor: pointer;
    }

    nav button#close-menu-btn {
        display: none;
    }

    /* Mobile Menu */
    .nav__menu {
        position: fixed;
        top: 5rem;
        right: 0;
        height: 100%;
        width: 80%;
        flex-direction: column;
        gap: 0;
        display: none;
        background-color: var(--color-bg);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    }

    .nav__menu.active {
        display: flex;
    }

    .nav__menu li {
        width: 100%;
        height: 5.8rem;
        transform-origin: top right;
        opacity: 1;
    }

    .nav__menu li a {
        background: var(--color-primary);
        width: 100%;
        height: 100%;
        display: grid;
        place-items: center;
    }

    .nav__menu li a:hover {
        background: var(--color-bg2);
        color: #F75842;
    }
}

@media (max-width: 600px) {
    .popup-content {
        width: 90%;
    }

    .image-grid {
        grid-template-columns: 1fr; /* 1 column for mobile */
    }
}

/* Dropdown Styles */
.test-series-navlink {
    position: relative;
}

.psu-exams-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #212731;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 25px 40px;
    border-radius: 5px;
    width: max-content;
    max-width: 90vw;
    z-index: 9999;
}

.test-series-navlink:hover .psu-exams-dropdown {
    display: block;
}

/* ========================== MOBILE & TABLET POPUP ========================== */
@media (max-width: 1024px) {
    .psu-exams-dropdown.mobile-dropdown {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 20px;
        border-radius: 10px;
        width: 90%;
        max-width: 380px;
        max-height: 80vh;
        overflow-y: auto; /* Scrollable if content is long */
        z-index: 10001;
        background-color: #1a2a44;
        color: white;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .psu-exams-dropdown.mobile-dropdown.active {
        display: block;
    }

    .psu-exams-dropdown.mobile-dropdown .subheading-container {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .psu-exams-dropdown.mobile-dropdown .section {
        margin-bottom: 10px;
    }

    .psu-exams-dropdown.mobile-dropdown .subheading {
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        color: white;
        border-bottom: 1px solid #344b73;
        padding-bottom: 5px;
    }

    .psu-exams-dropdown.mobile-dropdown .sub-subheading a {
        display: inline-block;
        color: white;
        padding: 4px 8px;
        font-size: 12px;
        text-decoration: none;
        background-color: #1a2a44;
        margin-right: 5px;
        border-radius: 4px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .psu-exams-dropdown.mobile-dropdown .sub-subheading a:hover {
        text-decoration: underline;
        color: #F75842;
        background-color: #253659;
    }

    .psu-exams-dropdown.mobile-dropdown .engineering-diploma-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

@media (min-width: 1025px) {
    .psu-exams-dropdown.mobile-dropdown {
        display: none !important; /* Prevent dropdown display on larger screens */
    }
}