/* Layout Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    font-size: 2rem;
    font-family: Arial, Helvetica, sans-serif;
    background-image: url("/media/img/backgound.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: whitesmoke;
}

footer {
    font-size: 1rem;
    color: black;
    padding: 16px 0px 8px 0px;

    a {
        text-decoration: none;
        color: black;
    }
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    padding: 1rem 0rem;
}


h2,
p {
    text-align: center;
    color: black;
    font-family:Arial, Helvetica, sans-serif;
}

header{
    padding: 8px;
}

.header-user {
    display: flex;
    gap: 1.5rem;
    
    align-items: center;
    font-size: 0.8rem;
    img{
        width: 25px;
        height: 25px;
        padding-top: 2px;
    }
}

.logout-btn{
    background-color: transparent;
    border: none;
    color: whitesmoke;
    font-weight: bold;
}

/* Dashboard Styles */

.door-section {
    padding: 50px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Door Button Styles */

.single-door {
    --button-bg: rgb(0, 0, 0, 0.5);
    --bubble-color: #fff3a6;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0;
    appearance: none;
    border: none;
    border-radius: 8px;
    background-color: var(--button-bg);
    box-shadow: 0 2px 25px rgba(56, 1, 29, 0.5);
    color: #fff;
    cursor: pointer;
    font-family:Arial, Helvetica, sans-serif;
    font-size: 1rem;
    isolation: isolate;
    position: relative;
    text-align: center;
    text-decoration: none;
    transition: transform ease-in 0.1s, box-shadow ease-in 0.25s;
}

.single-door:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.single-door.door-locked {
    --button-bg: rgb(0, 0, 0, 0.3);
    color: rgb(255, 255, 255, 0.65);
    cursor: not-allowed;
    filter: grayscale(1);
    opacity: 0.7;
    box-shadow: none;
}

.single-door.door-locked::before,
.single-door.door-locked::after {
    display: none;
}

.single-door h2,
.single-door p {
    color: inherit;
    font-family: inherit;
    line-height: 1.1;
    overflow-wrap: anywhere;
    margin: 0;
}

.single-door h2 {
    font-size: 2rem;
}

.single-door p {
    font-size: 1rem;
}

.single-door::before,
.single-door::after {
    position: absolute;
    content: "";
    display: none;
    width: 140%;
    height: 100%;
    left: -20%;
    z-index: 0;
    transition: all ease-in-out 0.5s;
    background-repeat: no-repeat;
}

.single-door::before {
    top: -75%;
    background-image:
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, transparent 20%, var(--bubble-color) 20%, transparent 30%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, transparent 10%, var(--bubble-color) 15%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%);
    background-size: 10% 10%, 20% 20%, 15% 15%, 20% 20%, 18% 18%, 10% 10%,
        15% 15%, 10% 10%, 18% 18%;
}

.single-door::after {
    bottom: -75%;
    background-image:
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, transparent 10%, var(--bubble-color) 15%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%),
        radial-gradient(circle, var(--bubble-color) 20%, transparent 20%);
    background-size: 15% 15%, 20% 20%, 18% 18%, 20% 20%, 15% 15%, 10% 10%,
        20% 20%;
}

.single-door > * {
    position: relative;
    z-index: 1;
}

.single-door:active {
    transform: scale(0.9);
    /* background-color: #e60074; */
    background-color: rgb(0, 0, 0, 0.5);
    box-shadow: 0 2px 25px rgba(255, 0, 130, 0.2);
}

.single-door.animate::before {
    display: block;
    animation: topBubbles ease-in-out 1.8s forwards;
}

.single-door.animate::after {
    display: block;
    animation: bottomBubbles ease-in-out 1.8s forwards;
}

@keyframes topBubbles {
  0% {
    background-position: 5% 90%, 10% 90%, 10% 90%, 15% 90%, 25% 90%, 25% 90%,
      40% 90%, 55% 90%, 70% 90%;
  }
  50% {
    background-position: 0% 80%, 0% 20%, 10% 40%, 20% 0%, 30% 30%, 22% 50%,
      50% 50%, 65% 20%, 90% 30%;
  }
  100% {
    background-position: 0% 70%, 0% 10%, 10% 30%, 20% -10%, 30% 20%, 22% 40%,
      50% 40%, 65% 10%, 90% 20%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}

@keyframes bottomBubbles {
  0% {
    background-position: 10% -10%, 30% 10%, 55% -10%, 70% -10%, 85% -10%,
      70% -10%, 70% 0%;
  }
  50% {
    background-position: 0% 80%, 20% 80%, 45% 60%, 60% 100%, 75% 70%, 95% 60%,
      105% 0%;
  }
  100% {
    background-position: 0% 90%, 20% 90%, 45% 70%, 60% 110%, 75% 80%, 95% 70%,
      110% 10%;
    background-size: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
  }
}



/* Riddle Styles */

.riddle {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;

    img {
        width: 200px;
        min-height: 150px;
        border: 2px solid rgba(0,0,0,0.7);
        border-radius: 5px;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    }
}

.riddle-box{
    background: radial-gradient(
        ellipse farthest-corner,
        rgba(0,0,0,0.7) 0%,
        rgba(0,0,0,0.7) calc(100% - 2rem),
        rgba(0,0,0,0.6) calc(100% - 1.5rem),
        rgba(0,0,0,0.35) calc(100% - 1rem),
        rgba(0,0,0,0.15) calc(100% - 0.5rem),
        transparent 100%
    );
    padding: 1rem;
    border-radius: 5px;
}
.riddle-text{
    font-size: 1.1rem;
    color: whitesmoke;
    line-height: 150%;
    padding: 0.5rem;
}

.attempts{
    padding-top: 1rem;
    font-size: 0.8rem;
    color: gray;
    text-align: end;
}

.message{
    animation: messageIn 0.4s ease-out;
    list-style: none;
}

@keyframes messageIn{
    from{
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to{
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce){
    .message{
        animation: none;
    }
}

.message.error{
    color: rgb(112, 9, 9);
    font-size: 1rem;
    font-weight: bold;
    text-align: center;
    padding-top: 1rem;
}

.message.success{
    color: green;
    padding: 1rem;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
}

.riddle-form{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.riddle-form label{
    padding: 0.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: rgba(0,0,0,0.7);
}

.riddle-form input{
    font-size: 1.2rem;
    border-radius: 2px;
    background-color: rgba(0,0,0,0.3);
    color: whitesmoke;
}

.absenden-btn {
    
    border-radius: 2rem;
    border: none;
    padding: 0.3rem 1.1rem ;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    font-family:Arial, Helvetica, sans-serif;
    color: whitesmoke;
    /* background-color: whitesmoke; */
    background-color: rgba(0,0,0,0.7);
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

/* Login Styles */

.login-form {
    font-size: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.login-form div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-form input {
    padding: 0.25rem;
    max-width: 300px;
    background-color: transparent;
    border-radius: 5px;
    border: 1px solid gainsboro;
    color: whitesmoke;
}

.login-form label{
    color: whitesmoke;
    font-weight: bold;
    font-size: 1.2rem;
}

.login-form .remember-me {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.login-form .remember-me input {
    width: auto;
    padding: 0;
    background: none;
    border: initial;
    border-radius: initial;
}

.login-btn {
    width: 100px;
    border-radius: 2rem;
    border: none;
    padding: 0.3rem 1.1rem ;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    font-family:Arial, Helvetica, sans-serif;
    background-color: whitesmoke;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    
}

/* Desktop Styles */

@media (min-width: 768px) {
    main {
        width: 100%;
        max-width: 900px;
    }

    .door-section {
        gap: 16px;
    }

    .single-door {
        width: 140px;
        height: 140px;
    }

    .single-door h2 {
        font-size: 2.8rem;
    }

    .single-door p {
        font-size: 1.2rem;
    }

    .riddle {
        max-width: 640px;
        margin-inline: auto;

        img {
            width: 320px;
        }
    }

    .riddle-box {
        max-width: 640px;
        margin-inline: auto;
    }

    .login-form {
        max-width: 480px;
        margin-inline: auto;
    }
}

.helptext {
    font-size: 1rem;
    margin-left: 1rem;
}

.errorlist {
    color: red;
    margin-left: 2rem;
    list-style-type: none;
    text-align: center;
}