:root {
    --background-default: #f8f9fa;
    --background-light: #ffffff;
    --clr-dark: #212529;
    --clr-primary: #0d6efd;
    --clr-secondary: #6c757d;
    --accent: #e94560;
    --highlight: #198754;
}

* {
    margin: 0;
    padding: 0;
    list-style-type: none;
    text-decoration: none;
    color: var(--clr-dark);
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html, body {
    min-height: 100vh;
    max-width: 100vw;
    background: var(--background-default);
    color: var(--clr-dark);
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Header (Navigation Bar) */
.nav {
    background: var(--background-light);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* Keep the header fixed at the top */
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.headerleft {
    display: flex; /* Align logos side by side */
    align-items: center; /* Center logos vertically */
    gap: 10px; /* Space between logos */
}

.headerleft a {
    display: flex;
    align-items: center;
}

.headerleft a.logo img, 
.headerleft a.logo-text img {
    max-height: 40px; /* Set consistent height for both logos */
}

.nav-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* General Navigation Links */
.nav-menu a, .dropdown-btn {
    font-weight: bold;
    color: var(--clr-dark); /* Ensure all nav links are black */
    padding: 10px 15px;
    border-radius: 5px;
    transition: color 0.3s;
    display: inline-block;
}

/* Remove Blue Link Color */
.nav-menu a:visited, 
.nav-menu a:link, 
.dropdown-btn:visited, 
.dropdown-btn:link {
    color: var(--clr-dark);
}

/* Hover Effect (Keep Color Black) */
.nav-menu a:hover, .dropdown-btn:hover {
    text-decoration: underline;
    color: var(--clr-dark); /* Prevent color change on hover */
}

/* Ensure Dropdown Button Matches Nav Links */
.dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
}

/* Dropdown Styling */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--background-light);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    border-radius: 5px;
    overflow: hidden;
    z-index: 999;
}

/* Dropdown Links */
.dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: var(--clr-dark);
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

/* Hover Effect (Keep Black) */
.dropdown-content a:hover {
    background: var(--background-default);
    color: var(--clr-dark);
    text-decoration: underline;
}

/* Show Dropdown on Hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* --- Nested Dropdown (For Data Murid STEM JPNJ) --- */
.sub-dropdown {
    position: relative;
}

/* Second-level dropdown content (Hidden initially) */
.sub-dropdown-content {
    display: none;
    position: absolute;
    left: 100%; /* Moves it to the right */
    top: 0;
    background: var(--background-light);
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    border-radius: 5px;
    overflow: hidden;
}

/* Ensure sub-dropdown appears on hover */
.sub-dropdown:hover .sub-dropdown-content {
    display: block;
}

/* Style for sub-dropdown links */
.sub-dropdown-content a {
    padding: 10px 15px;
    color: var(--clr-dark);
    text-decoration: none;
    display: block;
    transition: background 0.3s, color 0.3s;
}

/* Sub-dropdown Hover Effect */
.sub-dropdown-content a:hover {
    background: var(--background-default);
    color: var(--clr-dark);
}

/* Hamburger Menu for Mobile */
.hamburger {
    display: flex !important; /* Ensure visibility */
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    position: relative;
    z-index: 1001;
}

.hamburger div {
    width: 30px;
    height: 3px;
    background: var(--clr-dark);
    transition: all 0.3s ease-in-out;
}



/* Content Section */
.content {
    padding: 2em;
    margin-top: 80px; /* Ensure content doesn't overlap with the fixed header */
}

/* Footer */
.footer {
    background-color: #333; /* Updated background color */
    color: white; /* Ensure text color is white */
    padding: 30px 10%; /* Updated padding */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

/* Footer Logo */
.footer-logo img {
    max-width: 120px; /* Updated maximum width */
    margin-bottom: 15px; /* Consistent spacing */
}

/* Footer Address */
.footer-address {
    flex: 1;
    font-size: 0.9rem; /* Adjusted font size */
    margin-bottom: 15px; /* Updated spacing */
    line-height: 1.6; /* Added for better readability */
}

.footer-address p {
    margin: 5px 0;
    color: white; /* Ensure paragraph text is white */
}

/* Footer Social Links */
.footer-social {
    flex: 1;
    text-align: right; /* Align everything to the right */
    display: flex;
    flex-direction: column; /* Stack social links & counter */
    gap: 10px; /* Space between items */
    align-items: flex-end; /* Aligns all content to the right */
}

/* Style for Social Links */
.footer-social a {
    color: white; /* Ensure links are white */
    text-decoration: none;
    font-weight: bold; /* Highlighted links */
    margin: 0;
    transition: color 0.3s ease;
}

.footer-social a:hover {
    color: #FF6F61; /* Updated hover color */
}


/* Visitor Counter */
.footer-social .visitor-counter {
    color: white !important; /* Force text color to white */
    font-size: 1.1rem;
    font-weight: bold;
    text-align: right; /* Align text to the right */
    margin-top: 10px; /* Space below social links */
}


/* Newsletter Section */
.newsletter {
    flex: 1;
    text-align: center; /* Center-align newsletter section */
    margin-bottom: 15px;
}

.newsletter input[type="email"] {
    padding: 10px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    margin-right: 10px;
    width: calc(100% - 120px); /* Responsive input width */
    max-width: 400px; /* Limit width */
}

.newsletter button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #FF6F61;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter button:hover {
    background-color: #FF3B2F; /* Updated hover color */
}

/* Ensure Hamburger is Visible on Tablets */
@media (max-width: 1024px) {
    .hamburger {
        display: flex !important; 
        flex-direction: column;
        cursor: pointer;
        gap: 5px;
        position: relative;
        z-index: 1001; /* Ensures it’s above other elements */
    }
    

    .nav-menu {
        display: none; /* Hide menu by default */
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--background-light);
        box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        z-index: 999;
    }

    .nav-menu.active {
        display: flex !important;
    }

    .nav-menu.responsive {
        display: flex;
    }

    .dropdown-content {
        position: relative;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }

    .footer {
        flex-direction: column; /* Stack footer content vertically */
        align-items: center;
        text-align: center;
    }

    .footer-address, 
    .footer-social {
        margin: 10px 0;
        text-align: center; /* Center-align content */
    }
}

@media (max-width: 1024px) {
    .dropdown-content {
        display: none;
        position: static; /* Change to static so it appears correctly */
        box-shadow: none;
        background: none;
    }

    .dropdown.active .dropdown-content {
        display: block; /* Show dropdown when clicked */
    }
}


