html {
    height: 100%;
}

body {
    background: linear-gradient(45deg, #1c892a 0%, #059da5 100%);
    background-attachment: fixed;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

.acaforlogo {
    padding: auto;
    vertical-align: top;
    text-align: left;
    margin: 10px 35px;
    color: #ffffff;
    font-size: 400%;
    font-weight: bolder;
}

.logint {
    padding: 30px 50px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    width: 300px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

#resultsContainer {
    margin-top: 20px;
    width: 50%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    padding-bottom: 80px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: opacity 0.5s ease-in;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    min-height: 300px;
}

#resultsContent {
    width: 100%;
}

.category {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.trait {
    display: grid;
    grid-template-columns: 200px 200px 40px;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
    justify-content: center;
}

.trait-label {
    text-align: center;
    white-space: nowrap;
}

.progress-bar {
    width: 100%;
    background-color: #ddd;
    border-radius: 10px;
    height: 15px;
    overflow: hidden;
    position: relative;
}

.progress-bar .filled {
    height: 100%;
    transition: width 0.5s ease-in-out;
    border-radius: 10px;
    max-width: 100%;
}

.filled {
    background-color: #007BFF; /* Fallback color */
}

.score {
    text-align: left;
}

#savePdfBtn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    display: none;
    padding: 10px 20px;
}

@media (max-width: 800px) {
    #resultsContainer {
        width: 96.5%;
        margin: 20px auto;
        padding-bottom: 80px;
        overflow-x: hidden; /* Prevent horizontal overflow */
    }

    .trait {
        grid-template-columns: 1fr 1fr 40px; /* Flexible units for mobile */
        justify-content: center;
        max-width: 100%; /* Prevent overflow */
    }

    .trait-label {
        text-align: left;
        overflow-wrap: break-word; /* Break long words */
    }

    #savePdfBtn {
        position: absolute;
        bottom: 10px;
        left: 10px;
    }
}

/* Debugging visibility */
#savePdfBtn.visible {
    display: block !important;
}

/* Category-specific progress bar colors */
.filled.openness-filled {
    background-color: #4A90E2; /* Blue for Openness */
}

.filled.conscientiousness-filled {
    background-color: #50E3C2; /* Light Blue for Conscientiousness */
}

.filled.extraversion-filled {
    background-color: #7ED321; /* Green for Extraversion */
}

.filled.agreeableness-filled {
    background-color: #FACD18; /* Slightly darker yellow for Agreeableness */
}

.filled.neuroticism-filled {
    background-color: #F5A623; /* Orange for Neuroticism */
}