/* variables used throughout the entire widget */
#InformaSurveyWidget {
    --survey-background-color: #fdfdfd;
    --survey-text-color: #000;
    --survey-border-color: var(--main-color); /* note the dependency on --main-color here.  Thinking about this...

    /* checkmark */
    --check-size: 75px;
    --check-border-width: 5px;
    --checkmark-width:calc(var(--check-size)/2);
    --checkmark-height:calc(var(--checkmark-width)/2);
    --checkmark-left:calc(var(--checkmark-width)/2);
    --checkmark-top:50%;
    --checkmark-color:#19b8a2;

}

/* we may want to make sure the container for our widget has a min height so that space is pre-allocated for it */
/* but the widget isn't always displayed, so we might not */
.InformaSurveyWidgetContainer:has(#InformaSurveyWidget) {
    min-height: 105px;
}

#InformaSurveyWidget {
    margin: 0;
    padding: 0;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
    background-color: var(--survey-background-color);
    border: .4rem solid var(--survey-border-color);
    border-radius: .8rem;
    display: none;
    min-height: 105px;
    max-height: 105px;
    height: 105px;
    overflow: hidden;
}

#InformaSurveyWidget h1 {
    color: var(--survey-text-color);
    font-size: .8rem;
    text-align: center;
    margin: 0 0 0 0;
}

#InformaSurveyWidget .survey-widget {
    padding: .5rem;
    display: grid;
    height: 100%;
}

#InformaSurveyWidget .survey-panel {
    grid-column: 1;
    grid-row: 1;
}

/* rating panel */
#InformaSurveyWidget .survey-panel.survey-rating {
}

/* comment panel */
#InformaSurveyWidget .survey-panel.survey-comment {
    text-align: center;
    line-height: 1;
}

/* thank you panel */
#InformaSurveyWidget .survey-panel.survey-ratingsaved {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* completed panel */
#InformaSurveyWidget .survey-panel.survey-complete {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* container for all of the rating glyphs */
#InformaSurveyWidget .survey-rating-glyphs {
    cursor: pointer;
    padding: .3rem 0 0 0;
    display: flex;
    justify-content: space-between;
    width: 100%;    
}

/* individual rating glyph */
#InformaSurveyWidget .survey-rating-level {
    font-size: 2em;
    opacity: .7;
    transition: opacity .3s; 
}
#InformaSurveyWidget .survey-rating-level:hover {
    opacity: 1.0;
}

#InformaSurveyWidget .survey-rating-scaletext {
    font-size: .6rem;
    opacity: .6;
    width: 100%;
    padding: 0 .2rem 0 .2rem;
}

#InformaSurveyWidget .survey-rating-scaletext .notsatisfied {
    float: left;
}

#InformaSurveyWidget .survey-rating-scaletext .verysatisfied {
    float: right;
}

#InformaSurveyWidget .survey-complete-contents {
    display: grid;
}

#InformaSurveyWidget .survey-complete-contents i {
    color: green;
    font-size: 1.5em;
    text-align: center;
    margin-top: .3em;
    font-style: normal;
}
#InformaSurveyWidget .survey-complete-contents p {
    color: green;
    font-size: .8em;
    font-weight: bold;
    text-align: center;
    margin-top: .5em;
}

#InformaSurveyWidget .survey-comment textarea {
    font-size: .8rem;
    padding:5px; 
    border:2px solid #ccc; 
    border-radius: 5px;
    width: 100%;
    resize: none;
    margin-top: .5em;
}

.survey-comment-error {
    border: red solid 2px !important;
    transition: border .5s;
}

#InformaSurveyWidget .survey-comment textarea:focus {
    border-color: var(--survey-border-color);
}

#InformaSurveyWidget .survey-comment textarea::placeholder {
    text-align: left;
}

#InformaSurveyWidget .survey-comment button {
    padding: .4em; 
    background: var(--survey-border-color); 
    color: #fff;
    cursor: pointer;
    border-radius: 5px; 
    font-size: .7rem;
    padding-left: 1.4em;
    padding-right: 1.4em;
    margin-top: .2rem;
}

/* animated check mark */
#InformaSurveyWidget .checkmark-wrapper {
    width: var(--check-size);
    height: var(--check-size);
    position: relative;
    margin-left: auto;
    margin-right: auto;
}
#InformaSurveyWidget .checkmark-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    border: var(--check-border-width) solid #f8f8f8;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    z-index: 0;
}
#InformaSurveyWidget .checkmark-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    border: var(--check-border-width) solid transparent;
    border-left-color: var(--checkmark-color);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
    z-index: 1;
    animation: circle-frames linear forwards .75s;
}
#InformaSurveyWidget .checkmark {
    width: var(--checkmark-width);
    height: var(--checkmark-height);
    position: absolute;
    opacity: 0;
    left: var(--checkmark-left);
    top: var(--checkmark-top);
    display: block;
    border-left: var(--check-border-width) solid var(--checkmark-color);
    border-bottom: var(--check-border-width) solid var(--checkmark-color);
    transform-origin: left top;
    transform: rotate(-45deg);
    animation: check-frames linear both 1s;
}

@keyframes check-frames {
    0% {
        height: 0;
        width: 0;
        opacity: 0;
    }
    90% {
        height: 0;
        width: 0;
        opacity: 0;
    }
    95% {
        height: var(--checkmark-height);
        width: 0;
        opacity: 1;
    }
    100% {
        height: var(--checkmark-height);
        width: var(--checkmark-width);
        opacity: 1;
    }
}
@keyframes circle-frames {
    0% {
        border-color: transparent;
        border-left-color: var(--checkmark-color);
    }
    70% {
        transform: rotate(-360deg);
        border-color: transparent;
        border-left-color: var(--checkmark-color);
    }
    90% {
        transform: rotate(-360deg);
        border-color: var(--checkmark-color);
    }
    100% {
        transform: rotate(-360deg);
        border-color: var(--checkmark-color);
    }
}

