/* generl */
body {
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    height: 100vh; 
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

:root {
    --background-color: #FFC9DA;
    --container-color: #FF77B8;
    --text-color: #000000;
    --lighter-container-color: #FFBBD9;
    --hover-color: #F24195;
}

.sparkles_background {
    background-image: url('../img/sparkles-sparkle.gif');
    background-repeat: repeat;
    background-size: 300px 300px; /* Keeps the original size of the GIF */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.heart_icon {
    position: absolute;
    top: 40px;
    left: 40px;
    width: 140px;
    height: auto;
    z-index: 10;
}

.heart_icon:hover {
    transform: scale(1.2); 
    transition: transform 0.3s ease; /* Smooth transition effect */
}

/* Startpage Index */
.text_box {
    font-family: 'Pixelify Sans', sans-serif;
    background-color: var(--container-color);
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    color: var(--text-color);
    height: auto;
    width: 60vw;
    max-width: 100%;
    min-width: 190px;
    min-height: 300px;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

h1 {
    font-family: 'Pixelify Sans', sans-serif;
    color: var(--text-color);
    font-size: 50px;
    padding-top: 0px;
    margin-top: 0px;
}

p1 {
    font-size: 30px;
}

p2 {
    font-size: 30px;
    margin-top: auto;
}

.button_start {
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 275px;
    height: 65px;
    font-family: 'Pixelify Sans', sans-serif;
    background-color: var(--container-color);
    border: 3px solid #000;
    font-size: 45px;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    margin: 0 auto;
    box-sizing: border-box;
    white-space: nowrap;
}

.button_start:hover {
    background-color: var(--hover-color);
    transform: scale(1.1);
}

/* Question page  */
.magic_ball_still {
    background-size: cover;
    width: 450px; /* Adjust the size as needed */
    height: 450px; /* Adjust the size as needed */
    margin: 20px;
}

.question_container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px; 
}

.question_box {
    background-color: var(--container-color);
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    height: 50px;
    position: relative;
    width: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1; /* Allows the input field to grow and take available space */
}

.question_input {
    font-family: 'Pixelify Sans', sans-serif;
    background-color: var(--container-color);
    width: 100%;
    border: none;
    outline: none;
    font-size: clamp(18px, 6vw, 25px);
    position: center;
    padding-left: 10px;
}

.question_input::placeholder {
    color: var(--text-color);
    font-family: 'Pixelify Sans', sans-serif; /* Apply the font to the entire body */
}

.go_button {
    background-color: var(--lighter-container-color);
    text-decoration: none;
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    height: 45px;
    width: 65px;
    flex-shrink: 0;
    display: flex;
    align-items: center; 
    justify-content: center;
}

.go_button_text {
    text-decoration: none !important;
    font-family: "Pixelify Sans-Regular", Helvetica;
    background-color: transparent; 
    border: none;
    outline: none;
    font-size: 25px; 
    font-family: 'Pixelify Sans', sans-serif;
    color: var(--text-color);
    padding: 0;
    margin: 0;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.go_button a,
.go_button_text {
    text-decoration: none !important;
}

.go_button:hover {
    background-color: var(--hover-color);
    transform: scale(1.1);
}

.go_button_text:not(.active):hover,
.go_button:not(.active):hover {
    /* No hover effect when not active */
    background-color: var(--lighter-container-color);
    transform: none;
}

.go_button_text.active:hover,
.go_button.active:hover {
    background-color: var(--hover-color);
    transform: scale(1.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: 3px solid;
    border-radius: 0;
    border-color: #000000;
}

/* result page */

.magic_ball_result_wrapper {
    position: relative;
    width: 750px;   /* or your desired width */
    height: 750px;  /* or your desired height */
    margin: 0 auto;
}

.magic_ball_result {
    width: 100%;
    height: 100%;
    display: block;
}

.api_data_result {
    position: absolute;
    top: 50%;      /* Center vertically */
    left: 50%;     /* Center horizontally */
    transform: translate(-50%, -50%);
    -webkit-text-stroke: 0.1px var(--lighter-container-color);
    color: var(--lighter-container-color);
    font-family: Pixelify Sans, sans-serif;
    font-size: 21px;
    font-weight: bold;
    border: none;
    line-height: 1.5;
    background-color: transparent;
    text-align: center;
    height: 100%;
    max-height: 500px;
    width: 100%;
    max-width: 150px;
    white-space: normal; /* Allow text to wrap */
    word-wrap: normal;
    overflow-wrap: normal;
    position: absolute;
    top: 79%;
    left: 51%;
    transform: translate(-50%, -50%);
    z-index: 10;
    opacity: 0;
    animation: fadeIn 5.5s ease-in-out forwards;
}

.button_container_result{
    position: fixed;
    bottom: 20px;
    right: 25px;
    display: flex;
    gap: 20px; /* Space between the buttons */
    z-index: 20;
}

.button_again{
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 30px;
    background-color: var(--container-color);
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    height: 50px;
    width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
    margin-left: 30px;
}

.button_again:hover {
    transform: scale(1.1);
    background-color: var(--hover-color); 
}
.button_new {
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 30px;
    background-color: var(--container-color);
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    height: 50px;
    width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.button_new:hover {
    transform: scale(1.1);
    background-color: var(--hover-color); 
}

/* restart page  */

.magic_ball_restart {
    background-size: cover;
    width: 750px;
    height: 750px; 
    margin: 20px;
    display: block;
    margin: 0 auto;
    position: static;
    z-index: 1;
}
.button_again_transparent{
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 30px;
    background-color: var(--hover-color);
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    height: 50px;
    width: 220px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.button_new_transparent {
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 30px;
    background-color: var(--lighter-container-color);
    border: 3px solid;
    border-color: #000000;
    box-shadow: 0px 4px 4px #00000040;
    height: 50px;
    width: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.button_container_result_transparent {
    position: fixed;
    bottom: 20px;
    right: 25px;
    display: flex;
    gap: 20px;
}
.button_container_result a {
    text-decoration: none;
    color: inherit;
}

.countdown_container {
    position: absolute;
    display: flex;
    justify-content: center;
    left: 25px;
    bottom: 30px;
    width: 250px;
    font-family: 'Pixelify Sans', sans-serif;
    font-size: 25px;
    color: #000000;
    background-color: var(--container-color);
    border-color: #000000;
    border: 3px solid; 
    box-shadow: none;
}

.countdown_text {
    margin: 0;
}

.button_again.disabled {
    pointer-events: none;
    background-color: #FFBBD9;
    opacity: 0.6;
}

/*result still page */

.magic_ball_result_still {
    background-size: cover;
    width: 750px;
    height: 750px; 
    margin: 20px;
    display: block;
    margin: 0 auto;
    position: static;
    z-index: 1;
}

/* Keyframes for animations */
@keyframes shake {
    0%   { transform: translateX(0); }
    10%  { transform: translateX(-10px); }
    20%  { transform: translateX(10px); }
    30%  { transform: translateX(-20px); }
    40%  { transform: translateX(20px); }
    50%  { transform: translateX(-20px); }
    60%  { transform: translateX(20px); }
    70%  { transform: translateX(-10px); }
    80%  { transform: translateX(10px); }
    90%  { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 1s ease-in-out;
}

@keyframes grow {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

.magic_ball_result {
    animation: grow 2s ease-in-out;
    transform-origin: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.magic_ball_result_still {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards; /* Fade in over 2 seconds */
}

.api_data_result {
    opacity: 0;
    animation: fadeIn 5s ease-in-out forwards; /* Fade in over 2 seconds */
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.magic_ball_restart.fade-out {
    animation: fadeOut 0.5s ease-in-out forwards; /* Fade out over 2 seconds */
}

/*Responsive Design*/

/* Startpage */

@media (max-width: 600px) {

    .heart_icon {
        width: 80px;
        top: 15px;
        left: 15px;
    }

    .text_box {
        padding: 20px 15px;
        width: 80%;
        max-width: none;
        margin: 15px auto;
    }

    h1 {
        font-size: clamp(18px, 8vw, 40px);
        margin-bottom: 12px;
    }

    p1, p2 {
        font-size: clamp(20px, 5vw, 25px);
        margin-bottom: 10px;
    }

    .button_start {
        font-size: clamp(25px, 7vw, 35px);
        width: 50vw;
        min-width: 50px;
        max-width: 200px;
        height: 50px;
        padding: 0 12px;
        margin-top: 15px;
        margin-bottom: -5px;
    }

}

@media (max-width: 600px) {
    .button_start {
        font-size: clamp(18px, 7vw, 28px);
        width: 75vw;
        min-width: 120px;
        max-width: 320px;
        height: 44px;
        padding: 0 12px;
        margin-top: 15px;
        margin-bottom: -5px;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        box-sizing: border-box;
        white-space: nowrap;
    }
}

/* question page */
@media (max-width: 600px) {

    .magic_ball_still {
        width: 80vw;
        max-width: auto;
        height: auto;
        margin: 16px auto 10px auto;
    }

    .hey_diva {
        font-size: clamp(18px, 7vw, 30px);
        text-align: center;
        margin: 120px 0 10px 0; /* Increased top margin for space below heart_icon */
        width: 100vw;
    }

    .question_container {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 10px;
        width: 95vw;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .question_box {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 75vw;
        max-width: 350px;
        min-width: 120px;
        margin: 0 auto;
        background: var(--container-color);
        border: 3px solid #000;
        box-shadow: 0px 4px 4px #00000040;
        padding: 0 2vw;
        box-sizing: border-box;
    }

    .question_input {
        font-size: 18px;
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 6px;
        border: none;
        background: transparent;
    }

    .go_button {
        width: 20px;
        height: 30px;
        font-size: 18px;
        margin-left: 8px;
        margin-top: 5px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
    }

    .go_button_text {
        font-size: 18px;
        padding: 0 8px;
        width: 40px;
    }
    .countdown_container {
        position: static;
        width: 90vw;
        max-width: 350px;
        height: auto;
        align-items: center;
        font-size: 20px;
        margin: 16px auto 0 auto;
        padding: 10px;
        box-sizing: border-box;
        left: unset;
        bottom: unset;
        top: unset;
    }
}

/* Restart Page*/

@media screen and (max-width: 600px) {
    
    .magic_ball_restart {
        width: 90vw;
        height: 90vw;
    }
    
    .button_again_transparent,
    .button_new_transparent {
        max-width: 90%;
        width: 170px;
        height: 30px;
        font-size: 20px;
        margin-top: 20px;
    }

    .button_container_result_transparent {
        position: static;
        align-items: center;
        gap: 20px;
        margin-left: 20px;
    }

    .countdown_container {
        width: 50%;
        height: 40px;
        align-items: center;
        left: auto;
        bottom: 60px;
        top: auto;
        font-size: 20px;
        padding: 10px;
        box-sizing: border-box;
    }
}

/* Result Page*/

@media screen and (max-width: 600px) {
    .magic_ball_result {
        width: 90vw;
        height: 90vw;
    }

    .api_data_result {
        font-size: 14vw;
        height: 40vw;
        width: 20vw;
        max-width: 10vw;
        top: 60vw;
        left: 45vw;
    }

    .button_container_result {
        position: static;
        align-items: center;
        gap: 10px;
    }

    .button_again,
    .button_new {
        max-width: 90%;
        width: 180px;
        height: 30px;
        font-size: 20px;
        margin-top: 20vw;

    }
}

@media (max-width: 600px) {
    .magic_ball_result_wrapper {
        width: 90vw;
        height: 90vw;
        max-width: 600px;
        max-height: 400px;
    }
    .api_data_result {
        font-size: 12px;
        max-width: 15%;
    }
}
