﻿div.popup-datatemplate {
    display: none;
}

div.popup {
    display: none;
    z-index: 1000;
    position: fixed;
    width: 50%;
    overflow: auto;
    padding-top: 5px;
}

@media only screen and (max-width: 767px) {
    div.popup {
        display: none;
        z-index: 1000;
        top: 0;
        left: 0;
        margin: 0 !important;
        width: 100%;
        height: 100%;
        transform: none;
    }
}

div.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    z-index: 900;
}

a.popup-savebutton, 
a.popup-cancelbutton {
    margin-left: 5px;
    margin-right: 5px;
}

a.popup-editbutton,
a.popup-deletebutton {
    margin-right: 5px;
}

div.popup textarea {
    resize: vertical;
}

div.popup-datarow {
    margin: 5px 0 5px 0;
    padding-bottom: 5px;
}

    div.popup-datarow:after {
        pointer-events: none;
        content: '';
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 4px;
        border-radius: 8px;
        border: 1px solid #999;
        box-shadow: 0px 0px 3px rgba(000,000,000,0.6);
    }

    div.popup-datarow div.popup-buttons {
        padding-top: 5px;
    }

    div.popup-datarow .datafield {
        clear: both;
    }

    div.popup-datarow .popup-editbutton {
        background: url(../../images/icons/edit.png) left center no-repeat;
    }

    div.popup-datarow .popup-deletebutton {
        background: url(../../images/icons/delete.png) left center no-repeat;
    }

    div.popup-datarow div.popup-itemheader .popup-itemheaderlabel {
        margin-bottom: 0;
    }

    div.popup-datarow div.popup-itemheader {
        border-bottom: 1px #999 solid;
        overflow: hidden;
    }

        div.popup-datarow div.popup-itemheader a {
            width: 20px;
            height: 20px;
            margin-top: 12px;
        }

/* Change the behaviour of columns for popup datasets, we don't want the last item to float right */
/* On mobile the float is removed anyway so we won't change anything there. */

@media only screen and (min-width: 768px) {
    div .popup-datarow.columns:last-child {
        float: left;
    }
}
/* Make the first column in a new row clear both and take off the left margin */
div.popup-datarow.two.columns:nth-child(6n+2),
div.popup-datarow.three.columns:nth-child(4n+2),
div.popup-datarow.four.columns:nth-child(3n+2),
div.popup-datarow.five.columns:nth-child(2n+2),
div.popup-datarow.six.columns:nth-child(2n+2),
div.popup-datarow.seven.columns,
div.popup-datarow.eight.columns,
div.popup-datarow.nine.columns,
div.popup-datarow.ten.columns,
div.popup-datarow.eleven.columns {
    clear: both;
    margin-left: 0;
}

/* Make the fieldset scroll instead of the whole popup.*/
div.popup-fieldset {
    overflow-y: auto;
    max-height: 500px;
    margin-bottom: 10px; /* Adds a little space between this and the save/cancel buttons */
}

@media only screen and (max-height: 600px) {
    div.popup-fieldset {
        max-height: 300px;
    }
}

@media only screen and (max-height: 400px) {
    div.popup-fieldset {
        max-height: 200px;
    }
}
