html, body {
    height: 100%;
    margin: 0;
}
#map {
    height: 100vh;
    width: 100vw;
}
/* Flex container for buttons & title */
.container {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    z-index: 1000;
    gap: 10px;
}

/* Button styling */
.info-button {
    flex: 1;
    min-width: 230px;
    max-width: 400px;
    text-align: center;
    background: rgba(176, 143, 77, 0.8);
    color: white;
    padding: 10px;
    box-shadow: -2px 0 2px rgba(0, 0, 0, 0.3), 2px 0 2px rgba(0, 0, 0, 0.3), 0 -2px 2px rgba(0, 0, 0, 0.3);
    -moz-border-radius: 0px;
    -webkit-border-radius: 5px 5px 0px 0px;
    border-radius: 5px 5px 0px 0px;
    cursor: pointer;
    font-size: 18px;
}

/* Button hover effect */
.info-button:hover {
    background: rgb(176, 143, 77);
}

/* Dropdowns */
.dropdown-info {
    display: none;
    position: absolute;  /* Ensure dropdown stays in place */
    top: 100%;  /* Adjust dropdown position */
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ccc;
    padding: 0 10px 0 10px;
    line-height: 2;
    -moz-border-radius: 0px;
    -webkit-border-radius: 0px 0px 5px 5px;
    border-radius: 0px 0px 5px 5px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    width: 230px;
    text-align: center;
}

#courses-dropdown {
    max-height: 445px;
    overflow-y: auto;
}

#courses-dropdown-mobile {
    max-height: 305px;
    overflow-y: auto;
}

.lower-corners {
    -moz-border-radius: 0px;
    -webkit-border-radius: 0px 0px 5px 5px;
    border-radius: 0px 0px 5px 5px;
}

.dropdown-info p {
    margin: 0px;
}

.dropcont {
    position: relative;  /* Makes dropdown position relative to this container */
    display: inline-block;  /* Prevents it from stretching */
    text-align: center;
}

/* Title box */
#pagetitle {
    position: relative;
    text-align: center;
    color: rgb(0, 0, 60);
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 19px;
    font-weight: bold;
    flex: 0 0 auto; /* Prevents it from growing/shrinking */
}

#pagetitle span {
    display: none;
}

/* Sections inside the title */
.sections {
    display: block;
    margin: auto;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 19px;
    color: white;
    width: 130px;
    text-align: center;
}
#education {
    background: rgba(0, 0, 255, 0.5);
}
#experience {
    background: rgba(255, 0, 0, 0.5);
    display: none;
}
#cs {
    background: rgba(176, 143, 77, 0.8);
    display: none;
}
#la {
    background: rgba(176, 143, 77, 0.8);
    display: none;
}
#ac {
    background: rgba(176, 143, 77, 0.8);
    display: none;
}
#ho {
    background: rgba(176, 143, 77, 0.8);
    display: none;
}
/* Photo */
#photo {
    position: absolute;
    bottom: 7%;
    right: 4%;
    display: inline-block;
    z-index: 9999;
    width: 90px;
    height: 90px;
}
/* Source code link */
#source-code {
    position: absolute;
    top: 1%;
    right: 2%;
    color: white;
    font-size: 16px;
    display: inline-block;
    z-index: 9999;
}

#source-code:hover {
    text-decoration: underline !important;
}

/* Contact Button */
.dropdown {
    position: absolute;
    top: 0%;
    left: 0%;
    display: inline-block;
    z-index: 9999;
}

.contact-button {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    z-index: 9998;
}

.contact-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Dropdown Content */
.dropdown-content {
    display: none;
    position: absolute;  /* Change from relative to absolute */
    top: 100%;  /* Position it below the button */
    left: 0;
    background-color: white;
    min-width: 250px;
    z-index: 1;
    border: 1px solid #ddd;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
}

/* Show dropdown when hovering over .dropdown (not just the button) */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Dropdown links */
.dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* Navigation Buttons */
.nav-button {
    position: absolute;
    top: 93%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10000;
}
.nav-button:hover {
    background: rgba(0, 0, 0, 0.8);
}
#prev { right: 51%; }
#next { left: 51%; }
.leaflet-popup-content-wrapper .leaflet-popup-content {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    font-size: 16px;
    min-width: 600px;
}
.grey {
    background-color: rgb(240, 240, 240);
    margin: 0px -10px 0px -10px;
}

.top-buttons, .bottom-buttons {
    display: none;
}

/* Responsive layout for smaller screens */
@media (max-width: 1550px) {
    .info-button {
        min-width: 180px;
    }
    .dropdown-info {
        width: 180px;
    }
}

@media (max-width: 1320px) {
    #photo {
        top: 7%;
        left: 57%;
    }

    .desktop {
        display: none;
    }

    #pagetitle {
        position: absolute;
        top: 5%;
        right: 60%;
        transform: translateX(40%);
        font-size: 16px; /* Make the title smaller */
        padding: 10px;
    }

    #pagetitle span {
        display: block;
    }
    #pagetitle spin {
        display: none;
    }

    .sections {
        font-size: 16px;
    }

    .top-buttons, .bottom-buttons {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 90%;
        z-index: 1000;
        gap: 10px;
    }
    .top-buttons { top: calc(5% + 130px); }
    .bottom-buttons { top: 90%; }
    .info-button { min-width: 220px; }
    .dropdown-info { width: 220px; }
    .nav-button { top: 50%; }
    #prev { right: calc(94% - 30px); }
    #next { left: calc(94% - 30px); }
    .leaflet-popup-content {
        max-height: 300px !important;
        word-wrap: break-word;
        overflow: auto;
    }
    .bottom-buttons .dropcont .dropdown-info {
        top: auto;
        bottom: 100%;
        -moz-border-radius: 0px;
        -webkit-border-radius: 5px 5px 0px 0px;
        border-radius: 5px 5px 0px 0px;
    }
}

@media (max-height: 760px) {
    .leaflet-popup-content {
        max-height: 300px !important;
        word-wrap: break-word;
        overflow: auto;
    }
}

@media (max-width: 700px) {
    .leaflet-popup-content {
        min-width: 90% !important; /* Prevents overflow */
        max-height: 200px !important;
        word-wrap: break-word;
        overflow: auto;
    }
    .info-button {
        min-width: 180px;
    }
    .dropdown-info {
        width: 180px;
    }
}

/* Adjust for very small devices (like smartphones) */
@media (max-width: 480px) {
    .info-button {
        font-size: 16px;
    }

    .dropdown-info {
        font-size: 14px;
    }

    #pagetitle, .sections, .contact-button {
        font-size: 14px;
    }

    .container {
        top: 6.5%;
    }
    #pagetitle {
        right: 65%;
    }

    #photo {
        top: 7.5%;
        left: 65%;
    }
}

@media (max-width: 410px) {
    .info-button {
        min-width: 160px;
    }
    .dropdown-info {
        width: 160px;
    }
    .top-buttons, .bottom-buttons {
        gap: 5px;
    }
}