/* Global styles */
* {
    user-select: none; /* Prevents text selection and blinking cursor on all elements */
}

html {
    height: 100%; /* Ensures the html element takes full viewport height */
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding-top: 55px;
    min-height: 100%; /* Ensures the body takes full viewport height */
    display: flex;
    flex-direction: column; /* Makes the body use flexbox layout */
    background-color: #1a202c;
    color: white;
}

/* Navbar styles */
:root {
    --icon-size: 37px;
    --panel-transition-duration: 0.5s;
}

/* Navbar styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2a3f5d;
    padding: 10px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 60px;
}

.navbar-logo img {
    width: 50px;
    height: auto;
}

.navbar-links {
    display: flex;
    align-items: center;
}

.nav-link, .dropbtn {
    color: white;
    text-decoration: none;
    padding: 10px 12px; /* Adjust padding to fit all links */
    display: block;
    font-size: 14px; /* Adjust font size to ensure everything fits */
}

.nav-link:hover, .dropbtn:hover, .dropdown:hover .dropbtn {
    color: #ffd700;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 190px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border-radius: 5px;
    border-bottom: 1px solid #d3d3d3;
}

.dropdown-content a, .dropdown-content .learning-resources-btn {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-radius: 5px;
    border-bottom: 1px solid #2a3f5d;
}

.dropdown-content a:last-child, .dropdown-content .learning-resources-btn:last-child {
    border-bottom: none;
}

.dropdown:hover .dropdown-content {
    display: block;
    background-color: #ffd700;
}

.dropdown .dropdown-content a:hover, 
.dropdown-content .learning-resources-btn:hover {
    background-color: #ffd700;
    color: #1a202c;
    font-weight: bold;
}

/* Specific styles for nested dropdown under 'Learning Resources' */
.dropdown-content .nested-dropdown {
    display: block; /* Always displayed but initially invisible */
    opacity: 0; /* Initial invisible state */
    transition: opacity 0.3s ease; /* Smooth transition for opacity change */
    position: absolute;
    left: 100%; /* Position to the right */
    top: 0;
}

.nested-dropdown a {
    border-bottom: 1px solid #2a3f5d;
}

.nested-dropdown a:last-child {
    border-bottom: none;
}

/* Change opacity to 1 when hovering over 'Learning Resources' link or nested dropdown */
.dropdown-content .learning-resources-link:hover + .nested-dropdown,
.nested-dropdown:hover {
    opacity: 1; /* Make nested dropdown visible on hover */
}

/* Language switcher styles */
.language-switcher select {
    color: #ffd700;
    font-weight: bold;
    background-color: #2a3f5d;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.language-switcher select option {
    background-color: #ffd700;
    color: #1a202c;
    font-weight: normal;
}

/* Hamburger menu styles */
.hamburger {
    display: none;
    cursor: pointer;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    margin-bottom: 5px;
    background-color: grey;
    transition: all 0.3s ease;
}

.hamburger.change span {
    background-color: #ffd700;
}

.hamburger.change span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.change span:nth-child(2) {
    opacity: 0;
}

.hamburger.change span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Hamburger Menu and Navbar styles for Mobile */
@media (max-width: 600px) {
    .hamburger {
        display: block;
    }

    .navbar-links {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #2a3f5d;
        display: none;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 10px 0;
    }

    .navbar-links.show {
        display: flex;
    }

    .navbar-links > .nav-link, .navbar-links > .dropdown {
        display: block; /* Changed to block for a vertical layout */
        margin: -10px -5px; /* Increased left and right margin */
        text-align: center; /* Center align the text for a better look */
    }

    .dropdown-content {
        top: 100%;
        left: 0;
        min-width: 200px; /* Example: Change the minimum width */
        max-width: 100%; /* Optionally, you can set a maximum width */
        max-height: 120px; /* Example: limit the height of the dropdown */
    }

    /* Adjustments for the nested dropdown for mobile screens */
    .dropdown-content .nested-dropdown {
        position: static; /* Reset position for mobile */
    }

    .language-switcher {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

/* Footer styles */
.footer {
    background-color: #2a3f5d;
    color: #ffd700;
    text-align: center;
    padding: 20px 0;
    width: 100%;
    margin-top: auto;
}

/* Contact Form styles */
.contact-form {
    background-color: #ffd700;
    padding: 20px;
    border-radius: 15px;
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    width: 360px;
    color: #2a3f5d;
}

.contact-form h2 {
    font-weight: bold;
    color: #2a3f5d;
    text-align: center;
    text-decoration: underline;
    margin-bottom: 20px;
    font-size: 20px;
}

.contact-form input, .contact-form textarea {
    border-radius: 25px;
    border: 3px solid #2a3f5d;
    padding: 15px;
    width: calc(100% - 30px);
    margin-bottom: 10px;
    color: black;
    background-color: white;
}

.contact-form textarea {
    resize: none;
}

.contact-form .g-recaptcha {
    padding: 0px;
    margin-bottom: 20px;
}

.contact-form button {
    border-radius: 25px;
    padding: 10px 25px;
    background-color: #2a3f5d;
    color: white;
    border: none;
    cursor: pointer;
}

.contact-form button:hover {
    background-color: #1e2d3a;
}

/* Add this CSS to dynamically adjust font size for smaller screens */
@media (max-width: 768px) {
    .dropdown-content a, .dropdown-content .learning-resources-btn, .nested-dropdown a {
        font-size: 12px; /* Adjust the font size as needed */
    }

    .dropbtn {
        font-size: 14px; /* Adjust the font size for dropdown buttons */
    }

    .nested-dropdown {
        font-size: 12px; /* Adjust the font size for nested dropdown */
    }
}

/* Further adjustments if needed for even smaller screens */
@media (max-width: 480px) {
    .dropdown-content a, .dropdown-content .learning-resources-btn, .nested-dropdown a {
        font-size: 10px; /* Adjust the font size as needed */
    }

    .dropbtn {
        font-size: 12px; /* Adjust the font size for dropdown buttons */
    }

    .nested-dropdown {
        font-size: 10px; /* Adjust the font size for nested dropdown */
    }
}
