body {
    font-family: "Rubik", sans-serif;
    line-height: 1.5em;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

button, input, select, option {
    font-family: "Rubik", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
}

select {
    font-weight: 800;
    width: 220px;
}

/* Smooth scrolling when jumping between sections */
html {
    scroll-behavior: smooth;
}

a {
    text-decoration: underline dotted; /* Dotted underline */
    text-decoration-color: currentColor; /* Keeps the color of the underline consistent with the text */
    color: inherit; /* Prevents color change after clicking */
}

a:visited {
    color: inherit; /* Ensures the link does not change to purple after being clicked */
}

#explore-link-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
}


#explore-link {
    text-decoration: none;
    padding: 10px 20px;
    background-color: #0056b3;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9em;
    border-radius: 8px;
}
  
#explore-link:hover {
    background-color: #003B7A;
}

/* Dialog styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 100;
}
  
.dialog-content {
    text-align: center;
    max-width: 768px;
    padding: 20px 50px 20px 50px;
    background-color: #333;
    border-radius: 20px;
}

.dialog-content p {
    text-align: left;
}
  
#close-dialog-btn {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 10px 20px;
    background-color: #0056b3;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 8px;
}
  
#close-dialog-btn:hover {
    background-color: #003B7A;
}

#question-btn {
    background-color: #0056b3;
    padding-top: 2px;
    padding-bottom: 2px;
    padding-left: 8px;
    padding-right: 8px;
    border: black;
    border-radius: 2px;
    color: white;
    cursor: pointer;
}
  
#question-btn:hover {
    background-color: #003B7A;
}

/* Disable scrolling when dialog is open */
body.dialog-open {
    overflow: hidden;
}
  
/* Disable interaction with all UI elements when dialog is open */
body.dialog-open #content-container {
    pointer-events: none;
}
  
.content {
    position: relative;
    max-width: 800px;
    margin: 30px auto;
    padding: 50px 80px 50px 80px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
}

.title {
    margin-top: 1.5em;
    font-size: 3em;
    text-align: center;
    font-family: "Rubik Pixels", system-ui;
    font-weight: 400;
    font-style: normal;
}

.title a {
    text-decoration: none;
}
  
.introduction {
    position: relative;
    word-wrap: break-word;
    z-index: 0;
}
  
.line-bar {
    position: absolute;
    background: black;
    pointer-events: none;
    z-index: 1;
}

.blur-overlay {
    position: relative;
    overflow: hidden;
    transition: filter 0.3s ease; /* Smooth blur adjustment */
}
  
.blur-overlay img {
    max-width: 100%;
    height: auto;
    display: block;
}



canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;  /* Make sure the canvas is on top of the section */
    pointer-events: none; /* Ensure the canvas does not block interaction */
}
  
#rights-section {
    position: relative;
}

#controls-container {
    width: 250px;
    text-align: center;
    font-size: 0.85em;
}

/* Toggle switch styling */
.draggable {
    position: fixed;
    background-color: #f9f9f9;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: grab;
    z-index: 50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.draggable:active {
    cursor: grabbing;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}
  
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 25px;
}
  
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
  
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 25px;
}
  
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 3.5px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #0056b3;
}
  
input:checked + .slider:before {
    transform: translateX(24px);
}
  
#toggle-label {
    font-size: 0.8em;
    margin: 2px;
    color: black;
}

#visualization-container p {
    margin-top: 0.6em;
    margin-bottom: 0.6em;
}

/* Expand / collapse details: country score info and visualization toggle */

#all-details-container {
    display: block; /* Start expanded by default */
    transition: all 0.3s ease;
  }

#all-details-container.collapsed {
    display: none; /* Hide details when collapsed */
}

#details-button-container {
    text-align: center;
}

#details-toggle {
    display: none;
    margin: 0.8em auto 0.3em auto; /* Horizontally center the button */
    background-color: transparent;
    border: none;
    border-radius: 2px;
    color: black;
    cursor: pointer;
}

#details-toggle:hover {
    text-decoration: underline dotted;
}

#visualization-container {
    margin-top: 1.0em;
    margin-bottom: 1.0em;
}

.flourish-footer-logo-container, .flourish-credit {
    display: none;
}

/* Only allow experience on desktop */
.desktop-only {
    display: block;
}

.mobile-warning {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }

    .mobile-warning {
        display: block;
        z-index: 1000;
        background-color: white;
        padding: 1em 2em 1em 2em;
        border-radius: 16px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        position: relative;
        max-width: 85vw;
    }

    html, body {
        height: 100%;
        margin: 0;
        overflow: hidden; /* Disable scroll */
    }

    #screened-section {
        opacity: 1;
        display: flex;
        flex-direction: column;
        justify-content: center; /* Horizontally center */
        align-items: center;    /* Vertically center */
        height: 100vh;          /* Full viewport height */
    }

    #controls-container {
        display: none;
    }
}