﻿/* --- CSS TRANSFORMATIONS --- */

#root {
    --red: #ff3b30;
    --yellow: #ffcc00;
    --green: #4cd964;
    --bg-card: linear-gradient(145deg, #ffffff, #f8faff);
    --text-main: #333;
    --text-muted: #666;
}

/* 1. Resetting your structure layout */
#root li[id^="Group"] {
    display: block;
    list-style: none;
    margin-bottom: 20px;
}

/* 2. Style the "Group" Header */
.GrouptextContainer .group-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-left: 10px;
    border-left: 4px solid #187a87;
    background: transparent;
    margin-top: 50px;
}

/* 3. Style the Question Container */
li[display="true"] {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.05);
}

.Question {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem; /* Space for faces */
}

/* 4. The Scale Container (ul.Answers) */
.Answers.ANTYPE6 {
    padding: 0;
    margin: 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    position: relative;
    overflow-x: auto;
    padding-bottom: 15px;
    padding-top: 15px;
}

    /* The Gradient Bar Background */
.Answers.ANTYPE6::before {
    content: '';
    position: absolute;
    bottom: 32px;
    left: 10px;
    right: 10px;
    height: 6px;
    border-radius: 10px;
    z-index: 0;
    background: linear-gradient(to right, var(--red) 0%, var(--red) 63%, var(--yellow) 63%, var(--yellow) 81%, var(--green) 81%, var(--green) 100% );
}

/* 5. Individual Item Styling (.rdbtn label) */
.rdbtn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    cursor: pointer;
    width: 100%;
    min-width: 40px;
    margin: 0 8px;
    font-weight: normal;
    z-index: 1;
}

    /* HIDE the default input */
    .rdbtn input[type="radio"] {
        display: none;
    }

    /* HIDE the existing FontAwesome icons span */
    .rdbtn span:first-of-type {
        display: none;
    }

    /* STYLE the Number span */
    .rdbtn span:last-of-type {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-color: #fff;
        border: 2px solid #e5e7eb;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        color: #9ca3af;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin-top: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        font-size: 0.9rem;
    }

    /* 6. The Faces (Using Images) */
    /* We attach the image to the pseudo-element */
    .rdbtn::before {
        content: '';
        width: 48px; /* Size of the icon */
        height: 48px;
        margin-bottom: 5px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.5; /* Dimmed by default */
        transition: all 0.3s ease;
        transform: scale(0.9);
    }

    /* --- MAPPING IMAGES TO VALUES (0 to 10) --- */
    /* nth-of-type(1) is the 0 value, nth-of-type(11) is the 10 value */

    .rdbtn:nth-of-type(1)::before {
        background-image: url('../images/survey3/0.png');
    }

    .rdbtn:nth-of-type(2)::before {
        background-image: url('../images/survey3/1.png');
    }

    .rdbtn:nth-of-type(3)::before {
        background-image: url('../images/survey3/2.png');
    }

    .rdbtn:nth-of-type(4)::before {
        background-image: url('../images/survey3/3.png');
    }

    .rdbtn:nth-of-type(5)::before {
        background-image: url('../images/survey3/4.png');
    }

    .rdbtn:nth-of-type(6)::before {
        background-image: url('../images/survey3/5.png');
    }

    .rdbtn:nth-of-type(7)::before {
        background-image: url('../images/survey3/6.png');
    }

    .rdbtn:nth-of-type(8)::before {
        background-image: url('../images/survey3/7.png');
    }

    .rdbtn:nth-of-type(9)::before {
        background-image: url('../images/survey3/8.png');
    }

    .rdbtn:nth-of-type(10)::before {
        background-image: url('../images/survey3/9.png');
    }

    .rdbtn:nth-of-type(11)::before {
        background-image: url('../images/survey3/10.png');
    }


    /* 7. Hover and Checked States */

    /* HOVER: Full opacity and scale up */
    .rdbtn:hover::before {
        opacity: 1;
        transform: scale(1.1);
    }

    .rdbtn:hover span:last-of-type {
        border-color: #9ca3af;
    }

    /* CHECKED Logic for the IMAGE (Face) */
    /* When checked, make face full opacity and bounce up slightly */
    .rdbtn:has(input:checked)::before {
        opacity: 1;
        transform: scale(1.2) translateY(-5px);
    }

    /* CHECKED Logic for the NUMBER CIRCLE (Coloring) */
    /* We keep this to match the bar colors */

    /* Red Zone (0-6) */
    .rdbtn:nth-child(-n+7) input:checked ~ span:last-of-type {
        background-color: var(--red);
        border-color: var(--red);
        color: white;
        transform: scale(1.2);
        box-shadow: 0 4px 10px rgba(255, 59, 48, 0.4);
    }

    /* Yellow Zone (7-8) */
    .rdbtn:nth-child(n+8):nth-child(-n+9) input:checked ~ span:last-of-type {
        background-color: var(--yellow);
        border-color: var(--yellow);
        color: #713f12;
        transform: scale(1.2);
        box-shadow: 0 4px 10px rgba(255, 204, 0, 0.4);
    }

    /* Green Zone (9-10) */
    .rdbtn:nth-child(n+10) input:checked ~ span:last-of-type {
        background-color: var(--green);
        border-color: var(--green);
        color: white;
        transform: scale(1.2);
        box-shadow: 0 4px 10px rgba(76, 217, 100, 0.4);
    }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .Answers.ANTYPE6 {
        padding-bottom: 25px;
    }

        .Answers.ANTYPE6::after {
            content: 'Scroll →';
            position: absolute;
            right: 0;
            bottom: 0;
            font-size: 10px;
            color: #999;
        }
        .Answers.ANTYPE6::before {
            opacity:0;
        }
}
