/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital@0;1&display=swap');

/* Global Variables */
:root {
    --title-font: 'Oswald', sans-serif;
    --font: 'Rubik', sans-serif;
    --text-blue: #0594d1;
    --dark-blue: #01658f;
    --really-dark-blue: #024561;
    --text-white: #ffffff;
    --dark-white: #f5f5f5;
    --text-black: #1b1e2e;
    --light-grey: #d4d9e1;
    --white: #EEEDEB;
    --green: #508D4E;
    --nav: #f9fbfd;
    --nav-dark: #c6dac6;
    --really-dark: #9e9e9e;
    --bg: #fafafa;
}

/* Global Resets */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background-color: var(--bg);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Style for all checkbox inputs */
input[type="checkbox"] {
    -webkit-appearance: none; /* Removes default styling for checkboxes */
    appearance: none;
    margin: 0;
    width: 25px; /* Width of the checkbox */
    height: 25px; /* Height of the checkbox */
    background-color: var(--dark-white); /* Background color of the checkbox */
    border-radius: 4px; /* Rounded borders */
    border: 2px solid var(--really-dark-blue); /* Border color */
    cursor: pointer; /* Cursor changes to pointer to indicate clickable item */
    position: relative; /* Needed for positioning the checkmark */
    vertical-align: middle; /* Aligns the checkbox with adjacent text or inline elements */
    margin-left: 10px;
}

/* Checkmark style when checkbox is checked */
input[type="checkbox"]:checked {
    background-color: var(--green); /* Background color when checked */
    border-color: var(--green); /* Border color when checked */
}

/* Checkmark using pseudo-element */
input[type="checkbox"]:checked::after {
    content: ""; /* Necessary for pseudo-elements */
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border-style: solid;
    border-color: var(--text-white);
    border-width: 0 3px 3px 0;
    transform: rotate(45deg); /* Rotates the pseudo-element to create a checkmark */
}

/* Hover effect */
input[type="checkbox"]:hover {
    border-color: var(--text-blue); /* Changes border color on hover */
}


body {
    flex: 1;
    font-size: 2vh;
    color: var(--text-black);
}

button, select {
    font-family: var(--font);
    font-size: 1.8vh;
    cursor: pointer;
    border-radius: 6px;
    transition: 0.3s ease-in-out;
}

button {
    color: var(--text-white);
    background-color: var(--text-blue);
    border: 2px solid var(--dark-blue);
    padding: 0.5vh 2vw;
}

button:hover {
    transform: translateY(-2px);
    background-color: var(--dark-blue);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: var(--really-dark);
    color: var(--light-grey);
    cursor: not-allowed;
}

select {
    color: var(--text-black);
    background-color: var(--nav);
    border: 2px solid var(--light-grey);
    padding: 0.4vh 1vw;
    transition: border-color 0.2s ease-in-out;
}

select:hover {
    border-color: var(--text-blue);
}

select:focus {
    border-color: var(--dark-blue);
    outline: none;
}

/* Layout Containers */
.main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.nav {
    width: 90%;
    margin: 0 auto 4vh;
    padding: 1vh 5%;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background-color: var(--nav);
    color: var(--text-blue);
    font-family: var(--title-font);
    font-weight: 700;
    border-bottom: 2px solid var(--light-grey);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-title {
    font-size: 3.2vh;
    letter-spacing: 0.5px;
    user-select: none;
}

.foot {
    width: 100%;
    position: fixed;
    bottom: 0;
    background-color: var(--nav);
    color: #555;
    text-align: center;
    font-size: 1.2vh;
    padding: 0.3vh 0;
    border-top: 2px solid var(--light-grey);
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.container {
    width: 80%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 2vh 0;
}

.container-item {
    width: 30%;
    min-width: 280px;
    height: auto;
    margin-bottom: 3vh;
    background-color: var(--nav);
    border: 2px solid var(--light-grey);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

.container-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.container-title {
    padding: 1.5% 4%;
    font-size: 2.2vh;
    font-weight: 500;
    color: var(--text-black);
}

.container-segments {
    width: fit-content;
    padding: 0.3vh 0.5vw;
    font-size: 1.5vh;
    margin: 0 0 3.35vh 3.5%;
    background-color: var(--light-grey);
    color: var(--text-black);
    border-radius: 500px;
    text-align: center;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 6vh;
    display: flex;
    flex-direction: column;
    background-color: var(--nav-dark);
    padding: 1vh 0;
}

.progress-text {
    font-size: 1.9vh;
    margin: 0.4vh 0 0 3%;
    color: var(--text-black);
}

.progress-outer {
    width: 94%;
    height: 0.8vh;
    margin: 0.4vh auto 1vh;
    background-color: var(--really-dark);
    border-radius: 200px;
    overflow: hidden;
}

.progress-inner {
    width: 0%;
    height: 100%;
    background-color: var(--text-blue);
    transition: width 0.3s ease-in-out;
}

/* Search Bar */
.searchbar-container {
    width: 60%;
    margin: 0 auto;
    padding: 0.4vh 1vw;
    font-size: 2.25vh;
    display: flex;
    align-items: center;
    background-color: var(--dark-white);
    border: 2px solid var(--light-grey);
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.searchbar {
    flex: 1;
    font-size: 2.25vh;
    background: none;
    border: none;
    outline: none;
    color: var(--text-black);
    margin-left: 2%;
}

.searchbar-icon {
    height: 3vh;
    filter: grayscale(100%);
    transition: filter 0.2s ease-in-out;
}

.searchbar-icon:hover {
    filter: grayscale(0%);
}

.account-button-container {
    display: flex;
    align-items: center;
    padding: 0.1vh 0.5vw;
    border-left: 1.5px solid var(--light-grey);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.return-button {
    cursor: pointer;
    filter: invert(51%) sepia(67%) saturate(4567%) hue-rotate(170deg) brightness(94%) contrast(96%);
    height: 4vh;
    width: auto;
    user-select: none;
}

.account-button {
    height: 4vh;
    filter: invert(96%) sepia(5%) saturate(834%) hue-rotate(183deg) brightness(70%) contrast(96%);
}

/* Media Queries */
@media (max-width: 960px) {
    .container-item {
        width: 100%;
        margin-bottom: 4vh;
    }

    .searchbar-container {
        font-size: 1.9vh;
        width: 80%;
    }

    .searchbar-icon {
        height: 2.25vh;
    }

    .account-button {
        height: 3vh;
    }

    .account-button-container {
        border-left: 1px solid var(--light-grey);
    }

    .nav {
        width: 95%;
        padding: 1vh 2.5%;
    }

    .nav-title {
        font-size: 2.8vh;
    }

    .foot {
        font-size: 1vh;
    }
    
    .container-segments {
        padding-left: 1.1vw;
        padding-right: 1.1vw;
    }
}
