/* CSS variables */
:root {
    --primary-font: 'DM Serif', serif;
    --secondary-font: 'Cal Sans', sans-serif;
    --primary-color: #171E4B;
    /* dark blue */
    --text-color: #2C2C2C;
    /* charcoal gray */
    --highlight-color: #3F51B5;
    /* indigo */
    --background-color: #f0f0f0;
    /* light gray */
}

/* Global styles */

html,
body {
    margin: 0;
    padding: 0;
    background-color: var(--primary-color);
    width: 100%;
    height: 100%;
}

body {
    background-color: var(--primary-color);
    width: 100%;
    margin: 0;
    padding: 0;
}

section {
    background-color: var(--primary-color);
    color: #f0f0f0;
    padding: 20px;
}

.container-fluid {
    background-color: #171E4B !important;
}

.container-fluid,
.row {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

/* Navbar styles */
.navbar .container-fluid {
    background-color: #f0f0f0 !important;
}

.navbar-brand {
    font-family: var(--secondary-font);
    font-size: 1.6rem !important;
    color: #171E4B !important;
}

/* Navbar logo */
.navbar-brand img {
    width: 60px;
    height: auto;
    padding-left: 20px;
}

/* Typography styles */
h1 {
    font-family: var(--secondary-font);
    font-size: 50rem;
    font-weight: 900;
    color: #f0f0f0;
}

h2 {
    font-family: var(--secondary-font);
    font-size: 4rem;
    font-weight: 600;
}

body p {
    font-family: var(--primary-font);
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--background-color);
}

header {
    background-color: var(--primary-color);
    color: #f0f0f0;
    padding: 20px;
    text-align: left;
}

.main-title {
    font-size: 7.5rem;
    word-break: break-word;
}

.of-text {
    font-size: 0.5em;
    vertical-align: middle;
}

/* Colour Map styles */

#colour-map {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#colour-map svg {
    max-width: 100%;
    height: auto;
    display: block;
}

.country {
    fill: #bcefd8;    /* light green */
    opacity: 0.5;
    transition: fill 0.4s ease, opacity 0.4s ease;
    cursor: default;
    stroke: white;
    stroke-width: 2;

}

/* SVG pan zoom styles */
#demo-tiger {
    width: 100%;
    height: 100%;
}

/* Highlight map styles */
.highlight-red {
    fill: #E63946 !important;
}

.highlight-green {
    fill: #06D6A0 !important;
}

.highlight-yellow {
    fill: #FFE94C !important;
}

.highlight-blue {
    fill: #118AB2 !important;
}

.country.active {
    opacity: 1;
    cursor: pointer;
}

/*Hover module styles */
#hover-info {
    position: absolute;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    pointer-events: none;
    font-size: 0.9rem;
    max-width: 250px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#hover-info p {
    color: #333;
    font-family: 'Cal Sans', sans-serif;
    font-size: 0.9rem;
}

.hover-hidden {
    display: none;
}

#click-hint {
    display: block;
    margin-top: 8px;
    font-size: 0.75rem;
    color: black;
    font-style: italic;
}

.country.disabled-hover {
    pointer-events: none;
}

/* Info module styles */
#info-module {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid #ccc;
    padding: 20px;
    max-width: 600px;
    z-index: 1001;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    color: black !important;
}

#info-module p {
    color: #333;
    font-family: 'Cal Sans', sans-serif;
    font-size: 1.2rem;
}

.info-hidden {
    display: none;
}

#close-info {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Modal background colours */
.bg-red {
    background-color: #E63946;
    color: white;
}

.bg-green {
    background-color: #06D6A0;
    color: white;
}

.bg-yellow {
    background-color: #FFE94C;
    color: black;
}

.bg-blue {
    background-color: #118AB2;
    color: white;
}

/* Container for mobile users message */
#landscape-message {
    position: fixed;
    bottom: -60px;
    left: 0;
    width: 100%;
    background: #b2d1c3;
    color: rgb(0, 0, 0);
    font-family: var(--secondary-font);
    text-align: center;
    padding: 10px;
    font-size: 1rem;
    z-index: 9999;
    transition: bottom 0.4s ease;
}

#landscape-message.show {
    bottom: 0;
}

/* Footer styles */
footer {
    background-color: var(--background-color);
    padding: 20px;
    width: 100%;
}

footer p {
    font-family: var(--primary-font);
    font-size: 1rem;
    color: var(--text-color);
    text-align: center;
}

/* Error page styles */
.error-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.error-icon {
    font-size: 6rem;
    color: #dc3545;
    /* Bootstrap danger red */
    margin-bottom: 20px;
}

.error-code {
    font-size: 10rem;
    font-weight: 900;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-message {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.btn-home {
    font-size: 1.2rem;
    padding: 10px 30px;
}

/* Responsive styles */

/* Desktop styles */
@media screen and (min-width: 769px) {

    /* Hide landscape message on desktop */
    #landscape-message {
        display: none !important;
    }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 991px) {
    .main-title {
        font-size: 5rem;
        text-align: center;
    }

    h2 {
        text-align: center;
    }
    p {
        font-size: 1.2rem;
        text-align: center;
    }
    #colour-select {
        display: flex;
        justify-content: center;
    }
    section {
        padding: 0px 40px 0px 40px; 
    }

}


/* Mobile styles */
@media (max-width: 768px) {
    .main-title {
        font-size: 3.5rem;
        text-align: center;
        margin-bottom: 50px;
    }

    h2 {
        text-align: center
    }

    p {
        font-size: 1.1rem;
        text-align: center;
    }

    #colour-select {
        display: flex;
        justify-content: center;
    }

    section {
        padding: 0px 20px 0px 20px;
    }

    /* Colour Picker styles */
    /* Remove colour picker label + create rounded buttons */
    #colour-select label {
        min-width: 40px;
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        text-indent: -9999px;
        /* hide text */
        position: relative;
    }

    /* Adjust colour button colors */
    #red+label[for="red"] {
        background-color: #E63946;
        border-color: #E63946;
    }

    #green+label[for="green"] {
        background-color: #06D6A0;
        border-color: #06D6A0;
    }

    #yellow+label[for="yellow"] {
        background-color: #FFE94C;
        border-color: #FFE94C;
    }

    #blue+label[for="blue"] {
        background-color: #118AB2;
        border-color: #118AB2;
    }

    /* Make all colour buttons slightly faded by default */
    .btn-colour {
        opacity: 0.6 !important;
        transition: opacity 0.3s ease;
    }

    /* Highlight the selected button */
    .btn-colour.selected {
        opacity: 1 !important;
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    }

    /* Style the label when its corresponding radio input is checked */
    #colour-select input[type="radio"]:checked+label {
        opacity: 1 !important;
        /* fully opaque */
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
        border-width: 2px;
    }

    #colour-select label {
        opacity: 0.6;
        transition: opacity 0.3s ease;
        cursor: pointer;
    }

    /* Map styles */
    .svg-pan-zoom_control {
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Hover info styles */
    #info-module p {
        color: #333;
        font-family: 'Cal Sans', sans-serif;
        font-size: 0.9rem;
    }
}