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

:root {
    --background-color: #fff7e9;
    --text-color: #333;
    --secondary-color: #4a2c2a;
    --main-title-font-size: 10vw;
    --subtitle-font-size: 3vw;
    --button-font-size: 2.5vw;
}

html {
    font-size: 16px;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

#app-container {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

/* General title styling for all screens except start screen */
#app-container .main-title {
    color: #000000;
    font-family: 'Bahiana', sans-serif;
    font-size: clamp(40px, 8vw, 80px); /* Increased size */
    font-weight: 400;
    line-height: 1;
    /* margin: 40px 0 20px; Increased top margin */
    text-align: center;
    width: 100%;
    position: relative; /* Added for consistency */
    z-index: 10; /* Ensure it's above other elements */
    margin-bottom: 20px;
}

/* Override for start screen */
#app-container #start-screen .main-title {
    font-size: var(--main-title-font-size);
    line-height: 0.8;
    margin-bottom: 0.5vh;
}

/* Subtitle styling */
#app-container .subtitle {
    color: #000000;
    font-family: 'Arbutus Slab', sans-serif;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 400;
    margin: 0 0 30px;
    text-align: center;
}

/* Screen-specific layouts */
#quiz-screen, #result-screen, #personality-card-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100vh;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

/* Start screen specific layout */
#start-screen {
    justify-content: center;
    height: 100vh;
}

#start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 1200px;
}

#app-container #start-screen .subtitle {
    color: #000000;
    font-family: 'Arbutus Slab', sans-serif;
    font-size: var(--subtitle-font-size);
    font-weight: 400;
    margin-top: 0vh;
    margin-bottom: 1.5vh;
    max-width: 80%;
}

#app-container #start-screen .primary-button {
    background-color: #52320d;
    color: #ffffff;
    border: 3px solid #6d4312;
    padding: 10px 20px;
    margin-top: 0.5vh;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Arbutus Slab', sans-serif;
    font-size: var(--button-font-size);
    font-weight: 400;
    transition: background-color 0.3s, transform 0.1s;
}

.primary-button:hover {
    background-color: #6d4312;
    transform: translateY(-1px);
}


body, html {
    overflow: hidden; /* Prevents scrollbar */
    height: 100%; /* Ensures full height */
}

#quiz-screen {
    align-items: center;
    height: 100vh;
    width: 70%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
    /* overflow: hidden; Prevents scrollbar */
}

#question-counter {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    font-family: "Arbutus Slab", sans-serif;
    font-size: clamp(14px, 2vw, 18px);
}

.image-container {
    position: relative;
    width: 100%;
    max-width: 45vh; /* Limit width to maintain square aspect ratio */
    aspect-ratio: 1 / 1; /* Enforce square aspect ratio */
    margin: 10px auto; /* Center the container */
    display: flex;
    justify-content: center;
    align-items: center;
}

.question-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border: 4px solid #52320d;
    box-sizing: border-box;
}

#question-text {
    color: #000000;
    font-family: "Arbutus Slab", sans-serif;
    font-size: clamp(14px, 2.5vw, 20px);
    margin: 20px 0; /* Add vertical margin */
    text-align: left;
    max-width: 100%;
    padding: 0 10px; /* Add horizontal padding */
}

#answer-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.answer-button {
    background: #52320d;
    border-radius: 5px;
    border-style: solid;
    border-color: #6d4312;
    border-width: 3px;
    color: #ffffff;
    width: 100%;
    text-align: left;
    font-size: clamp(11px, 3vw, 20px);
    font-family: "Arbutus Slab", sans-serif;
    margin-bottom: 8px;
    padding: 8px 16px;
    font-weight: lighter;
    letter-spacing: 0.3px;
}

.answer-button:hover {
    transform: translateY(-1px)
}

/* Result Screen Styles */
#result-screen {
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding-top: 40px;
    background-color: var(--background-color);
}

.result-content {
    display:flex;
    flex-direction: column;
    align-items: center;
    align-content: center;
    text-align: center;
}

#chocolate-box-container {
    justify-content: center;
    align-items: center;
    align-content: center;
    width: 100%;
    max-width: 300px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#chocolate-box-container:hover {
    transform: scale(1.05);
}

.image-button {
    width: 100%;
    height: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

#chocolate-box-container:hover .image-button {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Media queries */
@media (max-width: 768px) {
    :root {
        --main-title-font-size: 15vw;
        --subtitle-font-size: 4vw;
        --button-font-size: 3.5vw;
    }

    #quiz-screen {
        width: 90%
    }

    #app-container .main-title {
        font-size: clamp(24px, 5vw, 40px);
    }

    #app-container .subtitle {
        font-size: clamp(14px, 2.5vw, 20px);
    }
}

@media (max-width: 600px) {
    #result-screen .subtitle {
        font-size: clamp(14px, 2.5vw, 20px);
    }

    .unwrap-text {
        font-size: clamp(12px, 2vw, 16px);
    }
}

@media (max-width: 450px) {
    #quiz-screen, #result-screen {
        padding-top: 8px; /* Room for phone camera*/
        padding-left: 0px;
        padding-right: 0px;
    }

    #app-container .main-title {
        font-size: clamp(20px, 4vw, 30px);
    }

    #app-container .subtitle {
        font-size: clamp(12px, 2vw, 16px);
    }

    .unwrap-text {
        font-size: clamp(10px, 1.8vw, 14px);
    }
}

@media (max-width: 320px) {
    :root {
        --main-title-font-size: 18vw;
        --subtitle-font-size: 5vw;
        --button-font-size: 4.5vw;
    }
    
    #app-container #start-screen .primary-button {
        padding: 6px 12px;
    }

    #quiz-screen {
        width: 100%
    }
}

@media (max-height: 600px) {
    .image-container {
        max-height: 30vh;
    }
    
    #question-text {
        font-size: clamp(12px, 2vw, 16px);
        margin: 5px 0;
    }
    
    .answer-button {
        font-size: clamp(10px, 1.8vw, 14px);
        padding: 3px 10px;
        margin-bottom: 6px;
    }
}

@media (max-height: 450px) {
    #app-container .main-title {
        font-size: clamp(24px, 5vw, 40px);
        margin-top: 10px;
    }

    .image-container {
        max-height: 30vh;
    }
    
    #question-text {
        font-size: clamp(6px, 2vw, 10px);
        margin: 5px 0;
    }
    
    .answer-button {
        font-size: clamp(5px, 1.8vw, 10px);
        padding: 3px 6px;
        margin-bottom: 3px;
    }
}

@media (max-width: 768px) {
    .image-container {
        max-width: 90%; /* Adjust for smaller screens */
    }
}

@media (max-height: 600px) {
    .image-container {
        max-height: 40vh;
    }
    
    #question-text {
        margin: 15px 0; /* Slightly reduce margin for shorter screens */
    }
}

@media (max-height: 450px) {
    .image-container {
        max-height: 35vh;
    }
    
    #question-text {
        margin: 10px 0;
        font-size: clamp(12px, 2vw, 16px);
    }
}

@media (max-width: 768px) {
    #quiz-screen {
        width: 90%;
    }
    
    .image-container {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    #quiz-screen {
        width: 95%;
        padding: 10px;
    }
    
    #question-counter {
        margin-bottom: 10px;
    }
    
    .image-container {
        margin-bottom: 15px;
    }
    
    #question-text {
        margin: 15px 0;
    }
}

@media (max-height: 600px) {
    .image-container {
        max-height: 40vh;
    }
    
    #question-text {
        margin: 15px 0;
    }
}

@media (max-height: 450px) {
    .image-container {
        max-height: 35vh;
    }
    
    #question-text {
        margin: 10px 0;
        font-size: clamp(12px, 2vw, 16px);
    }
}


/* Media queries */
@media (max-width: 768px) {
    #app-container .main-title {
        font-size: clamp(36px, 7vw, 70px);
        margin: 30px 0 15px;
    }

    #start-screen .main-title {
        font-size: clamp(50px, 10vw, 100px);
    }

    #app-container .subtitle {
        font-size: clamp(14px, 2.5vw, 20px);
        margin: 0 0 25px;
    }
}

@media (max-width: 480px) {
    #app-container .main-title {
        font-size: clamp(32px, 6vw, 60px);
        margin: 20px 0 10px;
    }

    #start-screen .main-title {
        font-size: clamp(40px, 9vw, 80px);
    }

    #app-container .subtitle {
        font-size: clamp(12px, 2vw, 18px);
        margin: 0 0 20px;
    }
}

#personality-card-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding-top: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.you-are-text {
    margin-bottom: 10px;
    text-align: center;
}

.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0 20px;
}

.personality-card-image {
    display: block;
    width: auto;
    height: auto;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 60vh;
    object-fit: cover;
}

.button-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    flex-shrink: 0;
}

#personality-card-screen .primary-button {
    background-color: #52320d;
    color: #ffffff;
    border: 3px solid #6d4312;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Arbutus Slab', sans-serif;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 400;
    transition: background-color 0.3s, transform 0.1s;
}

#personality-card-screen .primary-button:hover {
    background-color: #6d4312;
    transform: translateY(-1px);
}

.primary-button {
    background-color: #52320d;
    color: #ffffff;
    border: 3px solid #6d4312;
    padding: 10px 20px;
    border-radius: 15px;
    cursor: pointer;
    font-family: 'Arbutus Slab', sans-serif;
    font-size: clamp(14px, 2vw, 18px);
    font-weight: 400;
    transition: background-color 0.3s, transform 0.1s;
}

.primary-button:hover {
    background-color: #6d4312;
    transform: translateY(-1px);
}

/* Media Queries */
@media (max-width: 768px) {
    .card-container {
        max-width: 90%;
    }
    
    .personality-card-image {
        max-height: 50vh;
    }

    .button-container {
        flex-direction: row;
        align-items: center;
    }

    .primary-button {
        width: 30%;
        margin-bottom: 10px;
    }
}

@media (max-height: 600px) {
    #personality-card-screen {
        justify-content: center;
    }

    .personality-card-image {
        max-height: 40vh;
    }

    .button-container {
        margin-top: 10px;
    }
}

/* For extremely small screens */
@media (max-width: 320px) {
    #personality-card-screen {
        padding: 10px;
    }

    .personality-card-image {
        max-height: 35vh;
    }

    .primary-button {
        font-size: smaller;
        padding: 8px 16px;
    }
}