@import url('https://fonts.googleapis.com/css2?family=Satisfy&display=swap');

main {
    width: 90%;
    max-width: 520px;
}

.containers {
    min-width: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    gap: 50px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.score {
    margin-top: 50px;
}

.usercard,
.score,
.attempts,
.password,
.logout,
.recoveryOption,
.report,
.settings,
.themes {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    background-color: var(--marginals);
    gap: 20px;
    padding: 30px;
    border-radius: 15px;
    width: 100%;
    position: relative;
    max-width: 520px;
}

.button {
    font-size: 0.8em;
    margin-bottom: 0;
}

.recoveryOption {
    gap: 2px;
    flex-direction: column;

    a {
        text-decoration: none;
    }

    button {
        background-color: var(--text);
        color: var(--text-secondary);
        margin-bottom: 10px;
        font-weight: 600;
        font-family: var(--font-main);
        transition: background-color 300ms ease-in-out;
    }

    button:hover {
        background-color: var(--incorrect);
    }
}

.usercard h1,
.password h1 {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    margin: 10px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.password {
    text-align: center;
}

.sectionLabel {
    position: absolute;
    top: -25px;
    left: 10px;

    border-radius: 10px;
    font-size: 2em;
    font-family: "Satisfy", cursive;
    font-weight: 400;
    font-style: normal;
    text-shadow: var(--text-shadow) 10px 0 10px;
}

.score {
    h1 {
        font-size: 5em;
        margin: 15px 0;
        background: -webkit-linear-gradient(-45deg, var(--correct), var(--text));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.settings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    button {
        margin: 20px;
        font-family: var(--font-main);
        font-size: 1em;
        font-weight: 600;
    }

    .desactivated {
        background-color: grey;
    }

    .desactivated:hover {
        background-color: #5c5c5c;
        cursor: not-allowed;
    }
}

.settingsContainer {
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: start;
    margin-top: 20px;
    gap: 20px;
}


.checkbox-container input {
    display: none;
}

.checkbox-container input:checked+.custom-checkbox {
    background: var(--incorrect);
    border-color: var(--incorrect);
}

.checkbox-container input:checked+.custom-checkbox::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 0.15px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
}

.custom-checkbox {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #999;
    border-radius: 4px;
}

input[type="checkbox"]:disabled+.custom-checkbox {
    opacity: 0.5;
    cursor: not-allowed;
}

input[type="checkbox"]:disabled~.checkbox-text {
    color: #999;
}

.checkbox-container:has(input:disabled) {
    opacity: 0.6;
    cursor: not-allowed;
}

#profilpic {
    transition: 200ms ease-in-out;
    display: block;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

#profilpic:hover {
    filter: brightness(0.3) saturate(0.5);
}

#profilpic-edit {
    position: absolute;
    opacity: 0;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    pointer-events: none;
    transition: 200ms ease-in-out;
}

#profilpic-container:hover #profilpic-edit {
    opacity: 1;
}

#username-input,
.password-input {
    color: var(--text);
    font-family: var(--font-main);
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
    width: 100%;
    box-sizing: border-box;
    font-size: 2em;
    text-align: left;
    margin: 10px 0 8px 0;
    background-color: transparent;
    border: none;
    outline: none;
    line-height: 1;
    padding: 0;
    box-sizing: border-box;
    vertical-align: top;
    border-bottom: 2px solid var(--text);
}

#password-display {
    width: 470px;
}

.password-input {
    background-color: var(--marginals-secondary);
    border-radius: 10px;
    border: none;
    padding: 0 5px;
}

.password-input:focus {
    background-color: #ff52527c;
}

#passwordChange {
    p {
        margin: 30px 0 0;
    }

    button {
        width: 100%;
        transition: filter 300ms ease-in-out;
        font-family: var(--font-main);
        font-optical-sizing: auto;
        font-weight: 600;
        font-style: normal;
        color: var(--text);
        margin-top: 50px;
        margin-bottom: 10px;
        font-size: 1.3em;
    }

    button:hover {
        filter: brightness(1.2);
    }

    #passwordchangebtn-save {
        border-radius: 15px 15px 0 0;
        margin-bottom: 5px;
        background-color: var(--fake-news);
    }

    #passwordchangebtn-cancel {
        border-radius: 0 0 15px 15px;
        margin-top: 0px;
        background-color: var(--marginals-secondary);
    }

    span {
        color: var(--text);
    }

    div {
        font-size: 0.85em;
        background-color: #ff00003a;
        border: 2px solid red;
        border-radius: 10px;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 10px;
    }

    #uppercase-requirement {
        border-bottom: 0;
        border-radius: 10px 10px 0 0;
    }

    #special-requirement {
        border-bottom: 0;
        border-top: 0;
        border-radius: 0;
    }

    #length-requirement {
        border-top: 0;
        border-radius: 0 0 10px 10px;
    }

    .requirement.valid {
        background-color: #3ddc8541;
        border-color: lime;
    }
}

.popup span {
    color: var(--fake-news);
    font-weight: 600;
}

.popup-overlay {
    display: none;
    position: fixed;
    z-index: 999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px) brightness(0.5) saturate(0.8);
    -webkit-backdrop-filter: blur(4px);
}

.popup {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    position: fixed;
    top: 50%;
    left: 50%;
    padding: 30px;
    border-radius: 15px;
    transform: translate(-50%, -50%);
    min-width: 200px;
    min-height: 200px;
    max-width: 80vw;
    max-height: 80vh;
    background-color: var(--marginals);

    h1 {
        margin-top: 0;
    }

    strong {
        font-weight: 500;
    }
}

.popup button,
.popup .button {
    margin: 0 !important;
    font-family: var(--font-main);
    font-weight: 600;
}

#passwordchangebtn-save {
    margin: 40px 0 5px 0 !important;
}

.buttonsContainer {
    margin: 30px 0;
    display: flex;
    flex-direction: row;
    gap: 5px;
}

#usernameChangeSuccessBtn,
#passwordChangeSuccessBtn {
    background-color: #ccc;
    color: #666;
    border: none;
    padding: 10px 20px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    cursor: not-allowed;
    transition: color 0.3s;
    font-family: var(--font-main);
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    margin: 30px;
}

#usernameChangeSuccessBtn.animate-btn,
#passwordChangeSuccessBtn.animate-btn {
    cursor: not-allowed;
    color: var(--text-secondary);

    background: linear-gradient(to right, var(--incorrect) 0%, var(--incorrect) 50%, #e0e0e0 50%, #e0e0e0 100%);
    background-size: 200% 100%;
    background-position: 100% 0;
    transition: background-position 5s linear, background-color 0.3s;

    animation: chargeProgress 5s linear forwards;
}

@keyframes chargeProgress {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: 0 0;
    }
}

#usernameChangeSuccessBtn.animate-btn-2,
#passwordChangeSuccessBtn.animate-btn-2 {
    cursor: pointer;
    background: none;
    background-color: var(--incorrect);
    color: var(--text-secondary);
    animation: none !important;
}

.pixabaybtn {
    padding: 2px 4px;
    background-color: var(--text);
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: none;
    border-radius: 3px;
}

.category {
    margin-top: 10px;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.category-header {
    background: var(--fake-news);
    padding: 10px;
    cursor: pointer;
    user-select: none;
    font-weight: bold;
}

.category-content {
    display: none;
    padding: 10px;
    background: var(--marginals-secondary);
}

.category-content img {
    width: 70px;
    height: 70px;
    margin-right: 10px;
    cursor: pointer;
    object-fit: cover;
    border-radius: 50%;
    position: relative;
    transition: all 300ms ease-in-out;
}

.category-content img:hover {
    border-radius: 15px;
    width: 100px;
    height: 100px;
    transition: all 300ms 300ms ease-in-out;
}

.attempts {
    flex-direction: column;
    gap: 5px;

    a {
        text-decoration: none;
        transition: 200ms ease-in-out;
    }

    a:hover {
        filter: brightness(1);
    }

    span {
        color: var(--text-secondary);
    }
}

.attempt-label {
    font-weight: 700;
    width: 95%;
    font-size: 1em;
    padding: 0 20px;
    filter: brightness(0.7);
    border-radius: 5px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 10p;
}

.attempt-item {
    height: 30px;
    font-weight: 700;
    width: 90%;
    font-size: 1.7em;
    padding: 20px;
    color: var(--text-secondary);
    background-color: var(--correct);
    filter: brightness(0.7);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    span {
        font-size: 0.7em;
        font-weight: 300;
    }
}

.attempt-item,
.attempt-label {
    position: relative;
    display: flex;
    align-items: center;
}

.attempt-item> :first-child,
.attempt-label> :first-child {
    margin-right: auto;
}

.attempt-item> :nth-child(2),
.attempt-label> :nth-child(2) {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.attempt-item> :last-child,
.attempt-label> :last-child {
    margin-left: auto;
}

.attempt-item.placeholder {
    border-radius: 10px;
    background-color: transparent;
    color: var(--text);
    font-size: 1.2em;
    font-weight: 300;
    font-style: italic;
    border: 2px var(--text) dashed;
    margin-top: 10px;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 300ms ease-in-out;
}

.attempt-item.first {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.attempt-item.last {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.see-more,
a.see-more {
    height: 30px;
    font-weight: 700;
    font-size: 1.7em;
    padding: 20px;
    color: var(--text-secondary);
    background-color: var(--text);
    filter: brightness(0.7);
    border-radius: 0 0 10px 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
}

.logout {
    color: var(--text);
    text-decoration: none !important;
    gap: 15px;
    padding: 15px 30px;
    margin-bottom: 50px;

    span {
        font-size: 40px;
    }
}

.logout h2 {
    text-align: center;
    margin: 0;
    width: auto;
}

.themes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    h1 {
        margin: 20px 0 0 0;
    }
}

.themesCont {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    button{
        margin-bottom: 0;
    }
}

.themebtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 5px;
    padding: 10px;
    height: auto;
    background-color: gray;
}

.themebtn:hover {
    background-color: var(--text);
}

.themebtn p {
    font-size: 1.2em;
    padding: 0;
    margin: 0;
    font-weight: 600;
    font-family: var(--font-main);
}

.preview {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.preview div {
    width: 20px;
    height: 20px;
    background-color: red;
    border: 1px solid black;
}

.preview div:nth-child(-n+2) {
    width: 30px;
}

.current {
    border: 2px solid var(--text);
}

.current:hover {
    background-color: gray;
    cursor: not-allowed;
}

@media only screen and (max-width: 768px) {
    .containers {
        width: 95%;
        min-width: unset;
        padding: 0 10px;
    }

    .sectionLabel {
        font-size: 1.5em;
        top: -20px;
    }

    .usercard,
    .score,
    .info,
    .password,
    .attempts,
    .logout,
    .recoveryOption,
    .report,
    .settings,
    .themes {
        width: 100%;
        max-width: 100%;
        padding: 15px;
        gap: 10px;
    }

    #password-display {
        width: 100%;
    }

    #passwordChange div {
        width: 100%;
    }

    .popup {
        width: 95%;
    }

    .requirement {
        box-sizing: border-box;
    }

    .score h1 {
        font-size: 3em;
    }

    .attempt-item,
    .see-more {
        font-size: 1.2em !important;
        padding: 20px 10px;
        box-sizing: border-box;

    }

    .attempts {
        gap: 5px;
    }

    #username-input,
    .password-input {
        font-size: 1.5em;
        height: 40px;
    }

    .buttonsContainer {
        .button {
            width: 50%;
        }
    }

    .attempt-label div {
        font-size: 0.85em
    }
}