/* CSS for PollBlock Student View */

.poll-question {
    /* Make sure vertical whitespace below poll question is consistent across browsers.
     * Some browsers use custom user agent stylesheets that modify the value of the "display" property
     * for <legend> elements. */
    display: inline;
}

.poll-answer-text {
    margin-bottom: 0;
    font-weight: bold;
    vertical-align: middle;
    display: table-cell;
    padding-left: .5em;
}

.percentage-gauge {
    display: inline-block;
    background-color: #e5ebee;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.poll-result-input-container {
    display: inline-block;
    vertical-align: middle;
}

.poll-result-input-container input {
    margin: 0 .5em 0 0;
}

.poll-input-container input[type="radio"] {
    margin: 0;
}

.percentage-gauge-background {
    position: absolute;
    display: inline-block;
    background-color: #fafbfc;
}

.percentage-gauge-container {
    display: inline-block;
    width: calc(100% - 75px);
    vertical-align: middle;
    position: relative;
    background-color: #fafbfc;
}

.poll-results.has-images .percentage-gauge-container {
    width: 65%;
}

.poll-answers, ul.poll-answers-results {
    max-width: 80%;
}

.poll-answers {
    margin-bottom: 1em;
    padding-left: 1em;
}

.poll-results-wrapper:focus {
    outline: none;
}

ul.poll-answers-results {
    list-style-type: none !important;
}

.poll-answer {
    display: table-row;
    border-bottom-width: .5em;
    vertical-align: middle;
    margin-top: 5px;
}

li.poll-spacer {
    height: .25em;
}

div.poll-block ul.poll-results li.poll-result {
    /* The selector above needs all three parts to trump some margin setting from the LMS. */
    width: 100%;
    margin-bottom: 4px;
}

.poll-answer-label {
    margin-left: .2em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 5px;
    margin-top: 5px;
    position: relative;
    padding-left: .5em;
}

.poll-image {
    width: 25%;
    display: table-cell;
    vertical-align: middle;
    margin-left: .5em;
}

.poll-image.result-image {
    background-color: #fafbfc;
}

li.poll-result .poll-image {
    width: 22%;
    display: inline-block;
    margin-left: 0;
}

.poll-image-td {
    width: 25%;
}

.poll-image img {
    vertical-align: middle;
}

.poll-image img, .poll-image-td img{
    width: 100%;
}

.poll-image-td{
    display: inline-block;
}

.poll-percent-container {
    display: inline-block;
    text-align: left;
    padding-left: .2em;
    vertical-align: middle;
}

.poll-percent-display {
    font-weight: bold;
}

.poll-top-choice {
    color: #e37222;
}

.poll-footnote {
    margin-top: 1em;
    margin-bottom: 1em;
    font-size: smaller;
    font-weight: bold;
}

.survey-table {
    width: 100%;
    border-collapse: collapse;
    border: 0;
}

.survey-table td{
    text-align: center;
}

.survey-table td label{
    display: block;
    padding: 5px 0;
}

.survey-table td, .survey-table th {
    border: 1px solid #CCC;
    border-top: 0;
}

.survey-table tbody tr:last-child td,
.survey-table tbody tr:last-child th {
    border-bottom: 0;
}

.survey-table tr td:first-child,
.survey-table tr th:first-child {
    border-left: 0;
}

.survey-table tr td:last-child,
.survey-table tr th:last-child {
    border-right: 0;
}

.survey-table thead {
    border-top: 0;
    background: none;
}

.survey-table thead tr td,
.survey-table thead tr th {
    font-weight: bold;
    font-size: .9rem;
}

.survey-table .survey-row {
    background: none !important;
}

.survey-table .survey-row .survey-question {
    text-align: left;
}

.survey-table .survey-option label {
    text-align: center;
    vertical-align: middle;
}

.survey-option input {
    margin: 0;
    padding: 0;
}

th.survey-answer {
    text-align: center;
    width: 7%;
    line-height: 1em;
    padding-bottom: .25em;
}

.poll-header {
    text-transform: uppercase;
}

.survey-percentage {
    font-weight: bolder;
    font-size: 1.2rem;
}

.survey-question {
    font-weight: bold;
    vertical-align: middle;
    padding-top: .15em;
    padding-bottom: .15em;
}

.survey-choice {
    background-color: #e5ebee;
}

/* Counteract Markdown's wrapping in paragraphs */
.survey-question p, div.percentage-gauge-container label.poll-answer-label p{
    margin-bottom: 0;
    padding: 0;
}

/* Keep the paragraph spacing, but make the spacing vertically even. */
.poll-answer label.poll-answer-text p {
    margin-bottom: .5em;
    margin-top: .5em;
}

.poll-voting-thanks span {
    margin-top: .25em;
    margin-bottom: .25em;
    padding: .5em;
    display: inline-block;
    background-color: #e5ebee;
    color: #e37222;
}

.poll-hidden {
    display: none;
}

.poll-submissions-count {
    font-weight: bold;
}

.view-results-button-wrapper {
    text-align: right;
    cursor: pointer;
}

.poll-block-form-wrapper {
    display: none;
}

.poll-input-container {
    display: table-cell;
    vertical-align: middle;
    height: 100%;
    padding-right: .5em;
    width: 5%;
}

.visible-mobile-only{
    display: none;
    visibility: hidden;
}

@media only screen and (max-width: 767px){
    .visible-mobile-only{
        display: inline-block;
        visibility: visible;
    }

    .survey-table .survey-question{
        display: block;
        border: 0;
        padding-bottom: 10px;
    }

    .survey-table thead{
        display: none;
        visibility: hidden;
    }

    .survey-table .survey-option .visible-mobile-only{
        width: calc(100% - 20px);
    }
    .survey-table .survey-option{
        display: block;
        border: 1px solid #ccc;
        text-align: left;
        padding: 0 10px;
        margin-bottom: 10px;
        border-radius: 5px;
    }

    .survey-table .survey-option:last-child{
        border-right: 1px solid #ccc;
    }

    .survey-table tr:last-child td{
        border-bottom: 1px solid #ccc;
    }

    .survey-table tr:last-child td:first-child{
        border-bottom: 0;
    }

    .survey-table .survey-option label{
        text-align: left;
        padding: 8px 0;
    }

    .survey-table tbody tr:last-child td{
        border-bottom: 1px solid #ccc;
    }

    /*Polls*/

    .poll-answers, ul.poll-answers-results{
        max-width: none;
    }

    .percentage-gauge-container label.poll-answer-label p{
        margin-top: 0;
        line-height: 24px;
    }
}
