/* Set a maximum width for the site */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px !important;
    }
}

/* Header */
@media (min-width: 430px) and (max-width: 767px) { /* stop logos stretching too tall */
    .rpw-logo {
        padding-bottom: 18% !important;
    }
}

/* set back to fixed size on MD+ devices */
@media (min-width: 768px) {
    .rpw-logo {
        flex: 1;
        padding-bottom: 0 !important;
        height: 98px;
    }

    .rpw-logo {
        max-width: 389px;
    }
}

#header {
    background-color: #83a81b;
}

.rpw-logo {
    padding-bottom: 22%;
    background: url(/static-resources/img/header-f54a83b8e99fa703187c75d9b9f7f01b.png) no-repeat #83a81b;
    background-size: contain;
}

/* Green colouration of the navigation bar */
[id="nav-agricultural:nav"], [id="nav-thirdparty:nav"] {
    background-color: #638014 !important;
}

[id="land-nav"] {
    text-align: center !important;
}

/* Simple placeholder styling to create a blank area */
.placeholder {
    min-height: 200px;
    color: #757575;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scroll wrapper for tables */
.table-wrapper {
    overflow-x: auto;
}

.table-wrapper table {
    overflow-x: auto;
    min-width: 900px;
}


.table-wrapper-soft {
    overflow-x: auto;
}

.table-wrapper-soft table {
    overflow-x: auto;
}

/* Soften DTs from bootstrap default */
dt {
    font-weight: 600 !important;
}

/* Card headers made from H tags need styles reset */
.card-header {
    font-size: 1rem !important;
    font-weight: normal !important;
    line-height: 1.5 !important;
}

/* It is preferred that the headers are slightly padded away from their content by default */
.h3, h3 {
    font-size: 1.75rem;
    margin-bottom: .75rem;
}

/* Small grants table with fixed left hand column */
.optionMatrix {
    overflow-x: scroll;
    margin-left: 240px;
    overflow-y: visible;
    margin-bottom: 30px;
}

.optionMatrix td, .optionMatrix th {
    margin: 0;
    min-width: 80px;
}

.optionMatrix .fieldIdCol {
    position: absolute;
    width: 240px;
    left: 0;
    top: auto;
}

.optionMatrix .fieldIdCol button {
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
    overflow: hidden;
    text-align: left;
}

@media (min-width: 0px) and (max-width: 767px) {
    .optionMatrix { margin-left: 180px; }
    .optionMatrix .fieldIdCol { width: 180px; }
}

/* Full screen modal styles. Has been used to make a full screen map */
.modal.modal-full-screen .modal-dialog {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    max-width: 100vw;
    max-height: 100vh;
}

.modal-full-screen .modal-dialog .modal-content {
    height: 100vh;
}

.modal-full-screen .modal-dialog .modal-header {
    padding: 0 10px 3px 0;
}

.modal-full-screen .modal-dialog .modal-body {
    padding: 0;
}

/* Remove bottom margins from the last paragraphs in message boxes */
.alert p:last-child {
    margin-bottom: 0 !important;
}

.select-one-radio-styling > div {
    padding-top: 10px !important;
}

/* Document upload override styles */
[id="createMessageForm:files"] .name, [id="messageForm:files"]  .name, [id="uploadGlastirDocumentForm:files"]  .name{
    margin-bottom: 0;
}

[id="createMessageForm:files"] #fileupload-controls, [id="messageForm:files"] #fileupload-controls, [id="uploadGlastirDocumentForm:files"] #fileupload-controls {
    display: inline-block;
}

[id="createMessageForm:files"] #fileupload-progress, [id="messageForm:files"] #fileupload-progress, [id="uploadGlastirDocumentForm:files"] #fileupload-progress{
    display: inline-block;
    vertical-align: top;
    padding-top: 5px;
    padding-left: 12px;
    margin-bottom: 15px;
}

[id="createMessageForm:files"] .progress-extended, [id="messageForm:files"] .progress-extended, [id="uploadGlastirDocumentForm:files"] .progress-extended{
    font-size: 10px;
    margin-top: -15px;
}

[id="createMessageForm:files"] .template-download:before, [id="createMessageForm:files"] .template-download:after,[id="uploadGlastirDocumentForm:files"] .template-download:before, [id="uploadGlastirDocumentForm:files"] .template-download:after, #messageConversation .chatbox .compose-message:before, #messageConversation .chatbox .compose-message:after {
    display: table;
    content: "";
    clear: both;
}

[id="createMessageForm:files"] .template-download [class^='span'] , [id="createMessageForm:files"] .template-upload [class^='span'],
[id="messageForm:files"] .template-download [class^='span'] , [id="messageForm:files"] .template-upload [class^='span'],
[id="uploadGlastirDocumentForm:files"] .template-download [class^='span'] , [id="uploadGlastirDocumentForm:files"] .template-upload [class^='span']
{
    width: auto;
    float: none;
    margin-left: 0;
}

[id="createMessageForm:files"] .template-download, [id="createMessageForm:files"] .template-upload ,
[id="messageForm:files"] .template-download, [id="messageForm:files"] .template-upload,
[id="uploadGlastirDocumentForm:files"] .template-download, [id="uploadGlastirDocumentForm:files"] .template-upload
{
    padding: 10px;
    padding-right: 120px;
    position: relative;
    height: auto;
}

/* file name */
[id="createMessageForm:files"] .template-download div:first-child, [id="createMessageForm:files"] .template-upload div:first-child,
[id="messageForm:files"] .template-download div:first-child, [id="messageForm:files"] .template-upload div:first-child,
[id="uploadGlastirDocumentForm:files"] .template-download div:first-child, [id="uploadGlastirDocumentForm:files"] .template-upload div:first-child
{
    display: inline-block;
    vertical-align: baseline;
}

[id="createMessageForm:files"] .name, [id="messageForm:files"] .name, [id="uploadGlastirDocumentForm:files"] .name {
    margin-bottom: 0;
    max-width: 500px;
    text-overflow: ellipsis;
    overflow: hidden;
    vertical-align: bottom;
}

/* buttons */
[id="createMessageForm:files"] .template-download div:first-child + div, [id="createMessageForm:files"] .template-upload div:first-child + div,
[id="messageForm:files"] .template-download div:first-child + div, [id="messageForm:files"] .template-upload div:first-child + div ,
[id="uploadGlastirDocumentForm:files"] .template-download div:first-child + div, [id="uploadGlastirDocumentForm:files"] .template-upload div:first-child + div
{
    display: block;
    float: right !important;
    position: absolute;
    right: 0;
    top: 5px;
}

/* size */
[id="createMessageForm:files"] .template-download div:first-child + div + div, [id="createMessageForm:files"] .template-upload div:first-child + div + div ,
[id="messageForm:files"] .template-download div:first-child + div + div, [id="messageForm:files"] .template-upload div:first-child + div + div ,
[id="uploadGlastirDocumentForm:files"] .template-download div:first-child + div + div, [id="uploadGlastirDocumentForm:files"] .template-upload div:first-child + div + div
{
    display: inline-block;
    padding-left: 25px;
    width: 100px;
    vertical-align: top;
}

[id="createMessageForm:files"] .template-upload div:first-child + div + div .size, [id="messageForm:files"] .template-upload div:first-child + div + div .size, [id="uploadGlastirDocumentForm:files"] .template-upload div:first-child + div + div .size {
    display: none;
}

[id="createMessageForm:files"] .template-upload div:first-child + div + div .progress, [id="messageForm:files"] .template-upload div:first-child + div + div .progress, [id="uploadGlastirDocumentForm:files"] .template-upload div:first-child + div + div .progress {
    margin-bottom: 5px;
}

[id="createMessageForm:files"] .template-download div:first-child + div + div + div, [id="createMessageForm:files"] .template-upload div:first-child + div + div  + div,
[id="messageForm:files"] .template-download div:first-child + div + div + div, [id="messageForm:files"] .template-upload div:first-child + div + div  + div ,
[id="uploadGlastirDocumentForm:files"] .template-download div:first-child + div + div + div, [id="uploadGlastirDocumentForm:files"] .template-upload div:first-child + div + div  + div
{
    display: none;
}

.template-download.template-download-complete .name:before {
    display: inline-block;
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    color: #578a14;
    margin-right: 5px;
    background-color: #cbff65;
    border: 1px solid #98c76c;
    width: 22px;
    height: 22px;
    text-align: center;
    border-radius: 9px;
    font-weight: 900
}

.template-upload .name:before, .template-download .name:before  {
    display: inline-block;
    content: "\f00d";
    font-family: "Font Awesome 5 Free";
    color: #ff3e3e;
    margin-right: 5px;
    background-color: #ff9b9b;
    border: 1px solid #ff0000;
    width: 22px;
    height: 22px;
    text-align: center;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 900
}

.progress {
    margin-top: 5px;
}

.progress .bar {
    background-color: #5577DD;
}

/* Ensure the remove document button doesn't disappear on mobile */
button.btn.btn-danger.delete span {
    display: block;
}

/* Document list */
ul.file-list {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

ul.file-list > li {
    height: auto;
    min-height: 48px;
    margin-bottom: 10px;
}

ul.file-list > li > a {
    display: block;
    padding: 8px 0 0 58px;
    height: auto;
    min-height: 41px;
}

ul.file-list > li .ghost-document {
    display: block;
    padding: 0 0 0 58px;
}


ul.file-list span {
    color: #757575;
    display: block;
    word-wrap: break-word;
}

ul.file-list span:hover {
    cursor: pointer;
}

ul.file-list > li /* General file */ , ul.file-list > li.textplain /* TXT file */ {
    background-image: url(/static-resources/img/ftypes/file-f7de4076e9bca23e363ef487b4b0d8e4.png);
    background-repeat: no-repeat;
}

ul.file-list > li.pdf /* PDF */ {
    background-image: url(/static-resources/img/ftypes/pdf-c901e34bc0b0f0515e301b75e39fb995.png);
    background-repeat: no-repeat;
}

ul.file-list > li.doc /* DOC */ {
    background-image: url(/static-resources/img/ftypes/doc-b0dca9cd05e14c0b5c0c2de027a09e2a.png);
    background-repeat: no-repeat;
}

ul.file-list > li.excel /* Excel file */ {
    background-image: url(/static-resources/img/ftypes/excel-a65d2dcd2ad5675a8d043f4c6397d459.png);
    background-repeat: no-repeat;
}

ul.file-list > li.tiff /* Tiff */ {
    background-image: url(/static-resources/img/ftypes/tiff-45acc6c19c944c9a3365c07900f61c4e.png);
    background-repeat: no-repeat;
}

/* utility for 200px height */
.height-200 {
    height: 200px;
    overflow: auto;
}

/* utility for setting flex: 1 - useful for ie11 fixes */
.flex-1 {
    flex: 1;
}

/* Home page document list items */
.topic {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

/* Form page status bars */
ul.form-status {
    padding-left: 0;
    list-style: none;
    margin-bottom: 0;
    display: flex;
}

ul.form-status li {
    flex: 0;
    text-align: center;
    display: none;
    justify-content: center;
    align-items: center;
    height: 40px;
    text-indent: -9999px;
    border-width: 0;
    border-color: #c7c7c7;
    background-color: #f8f9fa;
    border-right-style: dashed;
}

ul.form-status li.stepActive {
    display: flex;
    flex: 1;
    text-indent: 0;
    background-color: #f8f2a8;
}

ul.form-status li.stepComplete, ul.form-status li:last-child.stepActive {
    background-color: #c8f2ad;
}

/* Map container */
.mapContainer {
    border: 1px solid #dddddd;
    width: 100%;
    position: relative;
    min-height: 752px;
}

.angular-app {
    width: 100%;
}

.mapContainer iframe {
    height: 750px;
    min-height: 750px;
    min-width: 1020px;
    width: 100%;
    border: 0;
    margin-bottom: -6px;
}

.fill-angular-app-section {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.fill-angular-app {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
}

.fill-angular-app iframe {
    width: 100%;
    min-height: 75vh;
    flex-grow: 1;
    border: none;
    margin: 0;
    padding: 0;
}

.mapFrame {
    overflow: auto;
    flex: 1;
    position: relative;
}

.mapContainer.expandedMap iframe {
    height: 100%;
}

.mapContainer.expandedMap {
    position: fixed;
    min-height: auto;
    height: 100vh;
    width: 100%;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    border: 0;
}

.mapContainer .map-return {
    width: 100vw;
    display: none;
    background-color: white;
}

.mapContainer.expandedMap .map-return {
    display: block;
}

.mapPanHelper {
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    min-height: 750px;
    min-width: 1020px;
    width: 100%;
    left: 0;
    background-color: rgba(0,0,0,0.5);
}

.expandedMap .mapPanHelper.showPanHelper {
    display: block;
}

.mapPanIndicator {
    position: fixed;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    display: none;
    z-index: 100;
}

.mapPanIndicator i {
    color: white;
    font-size: 4rem;
}

.mapPanIndicator p {
    background-color: #0000008c;
    padding: 0 2px;
    border-radius: 5px;
}

/* Accessibility fixes */
a, .btn-link {
    color: #005ebc;
}

.btn-link-bold {
    color: #005ebc;
    font-weight:bold;
}

/* form.profile-form targeting the bootstrap menu & dropdown providing criteria overrides */
form.profile-form .navbar-nav .dropdown-menu {
    position: absolute !important;
}

form.profile-form .collapse {
    display: contents;
}

form.profile-form.form-inline {
    flex-flow: nowrap !important;
}

form.profile-form .nav-link:hover {
    text-decoration: underline;
}

form.profile-form .navbar-light .navbar-nav .nav-link {
    color: #005ebc !important;
}

form.profile-form .navbar {
    flex-wrap: nowrap;
    padding: 0 !important;
}

form.profile-form .nav-link {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

form.profile-form .dropdown-menu .dropdown-item {
    color: #005ebc !important;
}

.page-link {
    color: #005ebc !important;
}

.page-item.active .page-link {
    color: #fff !important;
    background-color: #0068d6;
}

.navbar-dark .navbar-nav .nav-link {
    color: white !important;
}

.navbar-light .navbar-nav .nav-link {
    color: rgba(0, 0, 0, 0.54) !important;
}

.btn-primary {
    background-color: #006fe6 !important;
}

.btn-info {
    background-color: #128091 !important;
}

.btn-outline-secondary {
    color: #545454 !important;
}

.btn-success {
    background-color: #218739 !important;
}

.badge-info {
    background-color: #117C8D !important;
}

.badge-success {
    color: white !important;
    background-color: darkgreen !important;
}

.hide {
    display: none;
}

.no-wrap {
    white-space: nowrap;
}

.btn-spacer {
    margin-left: 2px;
}

.menu-item-separator {
    color: grey;
}

.no-top-border th {
    border-top: none;
}

.grid td {
    display: block;
    float: left;
    width: 100%;
    box-sizing: border-box;
}
.grid td:nth-child(1n+2) {
    clear: left;
}

.grid td label {
    margin-left: 10px;
}

.small-label {
    font-size: 1rem;
}

label[for="equalityMonitoringInformationForm:dateOfBirth:input"] {
    all: unset;
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

/* UA dashboard status colors */
.ua-status-not-started { background-color: #6C757D; color: #ffffff; }
.ua-status-draft { background-color: #FFC107; color: #000000; }
.ua-status-submitted { background-color: #006FE6; color: #ffffff; }
.ua-status-in-progress { background-color: #1BC0DA; color: #000000; }
.ua-status-failed { background-color: #DC3545; color: #ffffff; }
.ua-status-complete { background-color: #008800; color: #ffffff; }
.ua-status-default { background-color: #6C757D; color: #ffffff; }

/* UA declaration customer comment box - fixed-height scrollable contenteditable div that
   replaces the bootstrap:inputTextarea on the UA5/UA6/UA9/UA11 declaration screens. */
.ua-comment-box {
    height: 134px;
    overflow-y: auto;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    resize: none;
    border: 1px solid light-dark(#6c757d, #e9ecef);
    margin-bottom: 15px;
}

.ua-comment-display {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* UA declaration textarea styling - dark borders matching input fields */
/* Only applied to UA5, UA6, UA9, and UA11 which have textarea comment fields */
#habitat-maintenance-declaration-screen textarea,
#temporary-habitat-creation-on-improved-land-declaration-screen textarea,
#woodland-maintenance-declaration-screen textarea,
#historic-environment-declaration-screen textarea {
    border: 1px solid light-dark(#6c757d, #e9ecef) !important;
}

/* Red border for textarea validation errors */
#habitat-maintenance-declaration-screen textarea.border-danger,
#temporary-habitat-creation-on-improved-land-declaration-screen textarea.border-danger,
#woodland-maintenance-declaration-screen textarea.border-danger,
#historic-environment-declaration-screen textarea.border-danger,
#habitat-maintenance-declaration-screen .border-danger textarea,
#temporary-habitat-creation-on-improved-land-declaration-screen .border-danger textarea,
#woodland-maintenance-declaration-screen .border-danger textarea,
#historic-environment-declaration-screen .border-danger textarea {
    border: 1px solid #dc3545 !important;
}

/* h:selectOneRadio spacing - adds gap between each radio option */
/* h:selectOneRadio spacing - adds gap between each radio option */
.ua-radio-group { margin-top: 0.5rem; }
.ua-radio-group input[type="radio"] { margin-bottom: 0.75rem; }
.ua-radio-group label { margin-bottom: 0.75rem; }
.ua-radio-group tr { height: 2.5rem; }

/* Indented section with left border, applies padding to all child elements */
.ua-indented-section { border-left: 5px solid #e9ecef; padding-left: 1rem; }

.ua-comment-char-counter { display:block; text-align:left; font-size:0.85em; color:#6c757d; margin-top:2px; }

.ua-navigation-highlight {padding-top:.5rem; padding-bottom:.5rem; background-color: #638014;}
.ua-navigation-highlight a {color: #ffffff;}

/* Declaration exception field error boxes with upward-pointing triangle */
/* The alert box itself - creates space above for the triangle */
.ua-declaration-exception-error-container { position: relative; margin-top: 10px; }

/* Outer (border) triangle - sits above the alert box */
.ua-declaration-exception-error-triangle-border {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #f5c6cb;
    z-index: 1;
}

/* Inner (fill) triangle - overlays the alert top border to create a seamless join */
.ua-declaration-exception-error-triangle-fill {
    position: absolute;
    top: -9px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 9px solid #f8d7da;
    z-index: 2;
}

/* Error icon - red triangle with white exclamation mark, shown inside the right edge of an invalid input */
.ua-input-error-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    width: 13px;
    height: 11px;
    pointer-events: none;
}

.ua-input-error-icon::before {
    content: '';
    display: block;
    width: 13px;
    height: 11px;
    background-color: #dc3545;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.ua-input-error-icon::after {
    content: '!';
    display: block;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-weight: bold;
    font-size: 8px;
    line-height: 1;
}

/* Warning icon - yellow circle with white 'i', shown inside the right edge of a warning input */
.ua-input-warning-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: #ffc107;
    pointer-events: none;
}

.ua-input-warning-icon::after {
    content: 'i';
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-style: italic;
    font-size: 11px;
    line-height: 1;
}

/* Warning triangle variants for the alert callout boxes */
.ua-declaration-exception-warning-triangle-border {
    position: absolute;
    top: -10px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #ffeeba;
    z-index: 1;
}

.ua-declaration-exception-warning-triangle-fill {
    position: absolute;
    top: -9px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 9px solid #fff3cd;
    z-index: 2;
}

/* Triangle horizontal positions - each points at the relevant declaration exception input column */

/* Points to the sheet reference input box (col-2, first column ~8.33% from left) */
.ua-declaration-exception-error-position-sheet-ref { left: 8.33%; }

/* Points to the field number input box (col-2, second column ~25% from left) */
.ua-declaration-exception-error-position-field-num { left: 25%; }

/* Points to the area affected input box (col-2, third column ~41.67% from left — used on woodland/UA6 screens) */
.ua-declaration-exception-error-position-area-affected { left: 41.67%; }

/* Points to the comment input box (col-6, third column ~58.33% from left) */
.ua-declaration-exception-error-position-comment { left: 58.33%; }

/* Fixed-width table wrapper for responsive tables */
.field-parcel-exceptions-table {
    overflow: hidden !important;
    box-sizing: border-box;
}

.field-parcel-exceptions-table table {
    width: 100% !important;
    table-layout: fixed;
    box-sizing: border-box;
}

.field-parcel-exceptions-table table td,
.field-parcel-exceptions-table table th {
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}
