/* global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;  
    background-color: #f5f7fa;
    color: #333;
    line-height: 2;
}

/* navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #1a2a44, #2e79c9);
    color: white;
    padding: 0.2rem 0.94rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1001;
    box-shadow: 0 0.09rem 0.23rem rgba(0, 0, 0, 0.1);
}
.navbar-section {
    display: flex;
    align-items: center; 
    gap: 0.85rem;      
}
.navbar-brand {
    font-size: 1.25rem;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    cursor: pointer;
}
.navbar-links a {
    color: white;
    text-decoration: none;
    margin: 0 0.7rem;
    font-weight: 400;
}
.navbar-links a:hover,
.navbar-links a:focus,
.navbar-links a[aria-current="page"] {
    color: #ffec99;
}

/* container, section */
.container {
    flex: 1;
    width: 100%;
    margin: 0 auto;
}
.link-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.section {
    padding: 3.75rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    flex: 1 0 auto;
}
#opportunities.section {
    min-height: 90vh; 
}
.section-header {
    text-align: center;
    max-width: 37.5rem;
    margin-top: 0.94rem;
    margin-bottom: 1.41rem;
}
.section-header h1 {
    font-size: 2.1rem;
    color: #1a2a44;
}
.section-header p {
    font-size: 0.9rem;
    color: #666;
}
.section-title {
    font-size: 1.88rem;
    font-weight: 600;
    text-align: center;
    max-width: 37.5rem;
    margin: 0 auto;
}

/* map */
#map-container {
    flex: 1;
    transition: width 0.3s ease;
}
#map-container.filters-open {
    width: calc(100% - 15.94rem);
}
#map {
    height: 28.2rem;
    width: 100%;
    border-radius: 0.55rem;
    box-shadow: 0 0.19rem 0.94rem rgba(0, 0, 0, 0.1);
    position: relative;
}

/* popup */
.error-message {
    color: #e63946;
    text-align: center;
    padding: 0.94rem;
}
#info-popup {
    position: absolute;
    right: 0.47rem;
    top: 0.47rem;
    width: 16.41rem;
    height: 95%;
    background: white;
    padding: 0.94rem;
    border-radius: 0.56rem;
    box-shadow: 0 0.19rem 0.94rem rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}
#info-popup-content {
    font-size: 0.68rem;
    color: #333;
}
#close-popup {
    position: absolute;
    top: 0.47rem;
    right: 0.47rem;
    background: #1a2a44;
    color: white;
    border: none;
    border-radius: 50%;
    width: 1.41rem;
    height: 1.41rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.3s ease;
}
#close-popup:hover,
#close-popup:focus {
    background: #2e79c9;
}
#info-popup a.website-link {
    color: #2e79c9;
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 0.45rem;
    background: #e6f0fa;
    border-radius: 0.38rem;
    transition: background-color 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}
#info-popup a.website-link:hover,
#info-popup a.website-link:focus {
    background: #b3d4fc;
}
.expand-button {
    background: linear-gradient(90deg, #1a2a44, #2e79c9);
    color: white;
    border: none;
    padding: 0.38rem 0.75rem;
    border-radius: 0.38rem;
    cursor: pointer;
    font-size: 0.68rem;
    margin-top: 0.47rem;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.expand-button:hover,
.expand-button:focus {
    transform: translateY(-0.14rem);
    box-shadow: 0 0.19rem 0.7rem rgba(0, 0, 0, 0.2);
}

/* filters */
.sr-only {
    position: absolute;
    width: 0.05rem;
    height: 0.05rem;
    padding: 0;
    margin: -0.05rem;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.filter-toggle-container {
    margin-bottom: 0.94rem;
}
.map-filter-container {
    display: flex;
    gap: 0.94rem;
    width: 100%;
    max-width: 56.25rem;
    margin: 0 auto;
}
#filter-popup {
    display: none;
    flex-direction: column;
    width: 16.5rem;
    height: 28.13rem;
    overflow-y: scroll;
    background: white;
    padding: 0.94rem;
    border-radius: 0.56rem;
    box-shadow: 0 0.19rem 0.94rem rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
}
.filter-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.7rem;
}
#clear-filters-btn {
    background: linear-gradient(90deg, #1a2a44, #2e79c9);
    color: white;
    border: none;
    padding: 0.47rem 0.94rem;
    border-radius: 0.38rem;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
#clear-filters-btn:hover,
#clear-filters-btn:focus {
    transform: translateY(-0.14rem);
    box-shadow: 0 0.19rem 0.7rem rgba(0, 0, 0, 0.2);
}
#filter-popup-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.filter-row {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-start;
}
.filter-label {
    font-size: 0.68rem;
    color: #333;
    font-weight: 500;
}
#filter-popup label {
    font-size: 0.68rem;
    color: #333;
}
#filter-popup select,
#filter-popup input[type="number"] {
    padding: 0.38rem;
    border: 0.05rem solid #ddd;
    border-radius: 0.38rem;
    width: 100%;
    max-width: 9.38rem;
    font-size: 0.68rem;
}
#filter-popup input[type="checkbox"] {
    margin-left: 0.47rem;
    margin-right: 0.23rem;
}
.toggle-filters-btn {
    background: linear-gradient(90deg, #1a2a44, #2e79c9);
    color: white;
    border: none;
    padding: 0.56rem 1.13rem;
    border-radius: 0.38rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.toggle-filters-btn:hover,
.toggle-filters-btn:focus {
    transform: translateY(-0.14rem);
    box-shadow: 0 0.19rem 0.7rem rgba(0, 0, 0, 0.2);
}
.filter-row-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
}
.semester-choice {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}
.date-slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.date-slider-container label {
    font-size: 0.65rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}
.slider-wrapper {
    position: relative;
    height: 0.5rem;
    width: 100%;
}
.slider-wrapper input[type="range"] {
    position: absolute;
    width: 100%;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
}
.slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 0.9rem;
    width: 0.9rem;
    background: #2e79c9;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    margin-top: -0.35rem; 
}
.slider-wrapper input[type="range"]::-moz-range-thumb {
    height: 0.9rem;
    width: 0.9rem;
    background: #2e79c9;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
}
.slider-wrapper input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 0.2rem;
    background: #ddd;
    border-radius: 0.2rem;
}
.slider-wrapper input[type="range"]::-moz-range-track {
    width: 100%;
    height: 0.2rem;
    background: #ddd;
    border-radius: 0.2rem;
}
.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #555;
    margin-top: 0.25rem;
}

/* tips */
#info {
    background: #1a2a44;
    color: #fff;
    padding-top: 0;
}
.tips-header {
    width: 100%;
    padding: 5.63rem 0.94rem 2.81rem;
    background: linear-gradient(to bottom, rgba(26, 42, 68, 0.15), #1a2a44 100%), url('../images/landscape_cut.jpg') no-repeat center top/cover;
    background-size: cover;
    background-attachment: fixed;
    transition: background 0.5s ease;
}
.tips-content {
    width: 100%;
    max-width: 60rem;
    margin: 0 auto;
    padding: 1.88rem 0.94rem;
    display: flex;
    flex-direction: column;
    gap: 1.88rem;
}
.tip-card {
    display: flex;
    align-items: flex-start;
    gap: 0.94rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.94rem;
    border-radius: 0.56rem;
    position: relative;
    width: 100%;
    max-width: 60rem;
    box-sizing: border-box;
    justify-content: space-between;
}
.tip-number {
    font-size: 1.88rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    position: absolute;
    top: -1.41rem;
    left: 0.94rem;
}
.tip-card h3 {
    color: #fff;
    font-size: 1.13rem;
    margin-top: 0.47rem;
    width: 9.38rem;
    line-height: 1.5;
}
.tip-text {
    flex: 1;
    min-width: 9.38rem;
    overflow-y: auto;
    padding-right: 0.47rem;
    font-size: 0.8rem;
    color: #ddd;
}
.tip-text p,
.tip-text ul {
    margin-bottom: 0.47rem;
}
.tip-text ul {
    padding-left: 0.94rem;
}
.tip-image {
    width: 9.38rem;
    height: 7.03rem;
    background-size: cover;
    background-position: center;
    border-radius: 0.38rem;
    flex-shrink: 0;
}
.tips-conclusion {
    font-size: 0.83rem;
    color: #fff;
    text-align: center;
    margin-top: 1.88rem;
    max-width: 37.5rem;
    margin-left: auto;
    margin-right: auto;
}

/* opportunities */
#opportunities .section-title {
    color: #1a2a44;
    text-shadow: none;
}
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 62.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-viewport {
    overflow: hidden;
    width: 100%;
}
.carousel-track {
    display: flex;
    gap: 1.25rem;
    padding: 0.5rem;
    transition: transform 0.5s ease-in-out;
}
.opportunity-card {
    flex: 0 0 calc((100% - 2 * 1.25rem) / 3);
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.opportunity-card h3 {
    font-size: 1.25rem;
    color: #1a2a44;
    margin-bottom: 0.5rem;
}
.opportunity-card p {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #1a2a44;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}
.carousel-btn:hover:not(:disabled) {
    background: #f0f0f0;
    transform: translateY(-50%) scale(1.1);
}
.carousel-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
#prev-btn {
    left: -1.25rem;
}
#next-btn {
    right: -1.25rem;
}
.opportunity-details {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.5rem;
}
.opportunity-details strong {
    color: #1a2a44;
}
.info-link {
    display: inline-block;
    margin-top: auto;
    padding: 0.25rem 0.6rem;
    background: linear-gradient(90deg, #1a2a44, #2e79c9);
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 0.25rem;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    align-self: center;
}
.info-link:hover,
.info-link:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-0.94rem);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* footer */
.footer {
    background-color: #1a2a44;
    padding: 0.8rem 1rem;
    text-align: center;
}
.footer-links {
    display: flex;
    flex-direction: column; 
    align-items: center;
}
.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.65rem;
}
.footer-links a:hover,
.footer-links a:focus {
    color: #ffec99;
}
.navbar-links {
    display: flex;
    align-items: center;
}

/* flag */
.language-switcher img {
    width: 1.5rem;
    height: auto;
    display: block;
    border-radius: 0.15rem;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin: 15px;
}
.language-switcher a:hover img {
    transform: scale(1.1);
    opacity: 0.85;
}

/* hamburger */
.hamburger-button {
    display: none;
    position: relative;
    z-index: 1002;
    padding: 15px;
    cursor: pointer;
    background-color: transparent;
    border: 0;
    margin: 10px;
}
.hamburger-box {
    width: 28px;
    height: 24px;
    position: relative;
}
.hamburger-inner {
    display: block;
    top: 50%;
    margin-top: -1.5px;
    position: relative;
}
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 28px;
    height: 3px;
    background-color: white;
    border-radius: 4px;
    position: absolute;
    transition: transform 0.25s ease-in-out, background-color 0.25s ease-in-out;
    left: 0;
}
.hamburger-inner::before,
.hamburger-inner::after {
    content: '';
}
.hamburger-inner::before {
    top: -10px;
}
.hamburger-inner::after {
    bottom: -10px;
}
.hamburger-button.is-active .hamburger-inner {
    background-color: transparent;
}
.hamburger-button.is-active .hamburger-inner::before {
    transform: translateY(10px) rotate(45deg);
}
.hamburger-button.is-active .hamburger-inner::after {
    transform: translateY(-10px) rotate(-45deg);
}
.navbar-menu {
    display: flex;
    align-items: center;
}

/* media queries */
@media (max-width: 48rem) {
    .map-filter-container {
        flex-direction: column;
    }
    #filter-popup {
        width: 100%;
        max-width: none;
        height: 19rem;
    }
    .filter-actions {
        justify-content: center;
    }
    #clear-filters-btn {
        width: 100%;
        max-width: 9.38rem;
    }
    #map-container {
        width: 100% !important;
    }
    #map {
        height: 20rem;
    }
    #info-popup {
        width: 100%;
        right: 0;
        top: 0;
        height: 100%;
    }
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    .hamburger-button {
        display: block;
    }
    .navbar-menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(90deg, #1a2a44, #2e79c9);
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 0 0.09rem 0.23rem rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    .navbar-menu.is-open {
        transform: translateY(0);
    }
    .navbar-links {
        flex-direction: column;
        width: 100%;
    }
    .navbar-links a {
        padding: 0.8rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
    }
    .section {
        min-height: unset;
        flex: 1 0 auto;
        padding: 4.5rem 0.95rem 2.8rem;
    }
    .section.section-hidden-mobile {
        display: none;
    }
    .section-header h1 {
        font-size: 1.35rem;
        margin-top: 0.94rem;
    }
    .section-header p {
        font-size: 0.75rem;
    }
    .tips-header {
        background-attachment: scroll;
    }
    .section-title {
        font-size: 1.3rem;
    }
    .tips-content {
        padding: 0.94rem;
    }
    .tip-card {
        flex-direction: column;
        align-items: stretch;
        min-height: 18.75rem;
    }
    .tip-card h3 {
        width: 100%;
    }
    .tip-text {
        width: 100%;
        overflow-y: auto;
    }
    .tip-image {
        width: 100%;
        height: 9.38rem;
        margin-top: 0.94rem;
    }
    .tip-number {
        font-size: 1.5rem;
        top: -0.94rem;
        left: 0.47rem;
    }
    .tips-conclusion {
        font-size: 0.75rem;
        padding: 0 0.94rem;
    }
    .carousel-container {
        max-width: 100%;
        padding: 0 3rem;
    }
    .carousel-track {
        padding: 0.5rem; 
    }
    .opportunity-card {
        flex: 0 0 100%;
        min-height: 17rem;
    }
    .carousel-viewport {
        overflow: hidden;
    }
    .carousel-btn {
        display: flex;
    }
    #prev-btn {
        left: 0.5rem;
    }
    #next-btn {
        right: 0.5rem;
    }
}