/* These styles are made for Site-wide updates to form fields style - rounded edges
The project uses two frameworks: Ace and Bootstrap.
Almost all components are built on the Ace.
Ace doesn't have classes for "rounded" shapes (only for some elements).
So, there were done changes in the css to round component elements.
*/
/* Use "var" (doesn't support by Internet Explorer) when all clients will stop use the Internet Explorer browser:
var(--radius50)
var(--radius14)
var(--radius5)
var(--radius2)
var(--radius1)

body {
    --radius50: 50px;
    --radius14: 14px;
    --radius5: 5px;
    --radius2: 2px;
    --radius1: 1px;
}
*/

/* widgets: panels, login page, forgot password page, signup page*/
.widget-header {
    border-radius: 14px 14px 0 0;
    background-image: linear-gradient(#f5f5f5, #f5f5f5) !important;
}

.widget-body,
.widget-main,
.form-actions { /* wrapper around buttons (Search, Reset filters, Continue ...) */
    border-radius: 0 0 14px 14px;
}

.form-actions {
    margin-bottom: 0;
}

/* For Ad-hoc pages there is two form-actions, one for Search and Reset Filters and another one for IRB Projects, Irb Reviewers ...
So, the rounded border is removed for the first form-actions */  /* 4.b */
.form-actions:has(+ .form-actions) {
    border-radius: 0;
    border-bottom: none;
}

.rounded-form-actions-container .form-actions { /* Messaging Panel*/
    border-radius: 14px;
    border-top: 1px solid #F5F5F5; /* the same as background is */
    .row {
        margin-left: 0;
    }
}

.not-rounded-bottom {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.rounded-container { /* 5.b */
    border-radius: 14px;
    border: solid 1px #ddd;
}

.widget-box,
.collapsed>.widget-header, /* collapsed panel */
.signup-box .widget-body,
.signup-box .widget-main,
.login-box .widget-body,
.login-box .widget-main,
.forgot-box .widget-body,
.forgot-box .widget-main,
.fieldComparisonSideLeft,
.fieldComparisonSideRight {
    border-radius: 14px;
}

.login-box .btn,
.unlock-protocol-button {
    border-radius: 50px !important;
}

.widget-box.with-top-nav { /* IRB, IACUC, IBC Tasks -> task -> top nav */
    border-radius: 0;
}

#stickySummaryPanel > .widget-header, #stickySummaryPanelCP > .widget-header {
    background: white none !important; /* 6a */
}

#bottom-menu .widget-box, /* static footer */
#bottom-menu .widget-header,
.shcts-panel-right-menu .widget-box,
.shcts-panel-right-menu .widget-header {
    border-radius: 0;
}

/* footer of login/forgot/sign-up pages*/
.login-box .toolbar,
.forgot-box .toolbar,
.signup-box .toolbar {
    border-radius: 0 0 14px 14px;
    border: 0!important; /* 1.a */
}

.block, .block .clearfix, .block .input-icon .input-icon-right {
    border-radius: 14px;
}

/* tab */
.tab-content {
    border-radius: 0 14px 14px;
}

/* selection */
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single,
.select2-results,
.ace-file-container,
.header-filter {
    border-radius: 5px;
}

.select2-dropdown--below,
.select2-dropdown--below .select2-results__options:last-of-type { /* selector expands down*/
    border-radius: 0 0 5px 5px !important;
}
.select2-dropdown--above,
.select2-dropdown--above .select2-results__options:first-of-type { /* selector expands up*/
    border-radius: 5px 5px 0 0 !important;
}

.form-group,
.form-control,
select {
    border-radius: 5px !important;
}

.input-icon>input {
    border-radius: 5px !important;
}

input[type=checkbox].ace-checkbox-2 + .lbl::before,
input[type=checkbox].ace.ace-black + .lbl::before {
    border-radius: 2px !important;
}

input[type=text], input[type=email], input[type=url], input[type=search], input[type=tel], input[type=password],
input[type=datetime], input[type=datetime-local], input[type=date], input[type=month], input[type=time],
input[type=week], input[type=number], textarea, option {
    border-radius: 5px !important;
}

/* date filter */
input[type=text][id^=fromDatefilter], input[type=text][id^=fromDatefield] {
    border-radius: 5px 0 0 5px !important;
}

input[type=text][id^=toDatefilter], input[type=text][id^=toDatefield] {
    border-radius: 0 5px 5px 0 !important;
}

.btn,
.unlock-protocol-div, /* blue/yellow view */
.btn-colorpicker,
.dropdown .dropdown-toggle {
    border-radius: 5px !important;
}

.btn-corner:first-child, .btn-comments:first-child {
    margin-left: -4px; /* two button groups in PanelActions must looks like one group */ /* 6.f */
}
.btn-corner>.btn, .btn-corner>.btn:first-child {
    margin-right: 2px; /* a space between buttons in the button group */ /* 6.f */
}
.ace-icon {
    border-radius: 2px;
}

.alert,
.label,
.well, /* logout */
.popover,
.gritter-item-wrapper {
    border-radius: 5px !important;
}

.popover-title {
    border-radius: 5px 5px 0 0;
}

/* dropdown */
.dropdown-menu,
.submenu {
    border-radius: 5px !important;
}

/* modal */
.modal-dialog  .form-actions { /* Conversation modal -> IRB -> Edit Protocol -> Review Comments -> Table -> Actions -> Add Comment */
    margin-bottom: 0 !important;
}
.modal-dialog .widget-toolbar {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
.admin-review { /* 6.e */
    padding: 0 10px !important;
}
.modal-content, .modal-body .row {
    border-radius: 14px;
    margin-left: 0;
    margin-right: 0;
}
.modal-body {   /* 3.a, 6.c */
    padding-bottom: 5px;
}
.modal-content {
    border: solid 1px #ddd;
}
.modal-footer {
    border-radius: 0 0 14px 14px;
    height: auto;
    min-height: 14px; /* equals to .modal-content border-radius; otherwise, it looks like there is no border on the bottom corners */
    background-color: #fff;
    border-top: #fff;
}

/* datetimepicker */
.bootstrap-datetimepicker-widget,
.bootstrap-datetimepicker-widget .dropdown-menu,
.datepicker-months .month,
.datepicker-years .year,
.datepicker td,
table th.picker-switch { /* select month / select year on hoover*/
    border-radius: 5px !important;
}
.bootstrap-datetimepicker-widget td>a,
.bootstrap-datetimepicker-widget table td span,
.bootstrap-timepicker-widget table td a:hover {
    border-radius: 5px !important;
}

/* tables */
/* "overflow: hidden;" doesn't used to avoid a hiding of some drop-down elements */
.dataTables_wrapper {
    border-radius: 14px !important;
}
.dataTables_wrapper .row {
    border: solid 1px #ddd;
}

.table-header { /* "Results for ..." on blue background */
    min-height: 30px;
    padding: 10px;
    border-radius: 14px 14px 0 0;
}
.table-bordered { /* for tables that don't have pagination */
    border-style: hidden; /* hide standard table border */
    border-collapse: separate;
    border-radius: 14px !important;
}
.table>thead>tr>th:last-child { /* override Ace style*/
    border-right-color: #ddd;
}
.table>thead:first-child>tr:first-child>th { /* override Ace style*/
    border-top: solid 1px #ddd;
}

.table-bordered thead {
    border-radius: 14px 14px 0 0 !important;
}
/* first table row, left and right cell */
.table-bordered th:first-of-type,
.table-bordered th.footable-first-column {
    border-top-left-radius: 14px !important;
}
.table-bordered th:last-of-type,
.table-bordered th.footable-last-column {
    border-top-right-radius: 14px !important;
}

.table-bordered tbody {
    border-radius: 0 0 14px 14px !important;
}
/* last table row, left and right cell */
.table-bordered tr:last-of-type td:first-of-type,
.table-bordered tr:last-of-type td.footable-first-column,
.table-bordered .hidden-print:first-of-type .footable-first-column,
tr.unRead:last-of-type td:first-of-type
{
    border-bottom-left-radius: 14px !important;
}
.table-bordered tr:last-of-type td:last-of-type,
.table-bordered tr:last-of-type td.footable-last-column, /* for hidden elements (like IACUC -> Edit Protocol -> Requirements)*/
.table-bordered .hidden-print:last-of-type .footable-last-column {
    border-bottom-right-radius: 14px !important;
}

/* for tables that have pagination and/or table header: first table row, left and right cell */
.not-rounded-top th:first-of-type,
.not-rounded-top th.footable-first-column {
    border-top-left-radius: 0 !important;
}
.not-rounded-top th:last-of-type,
.not-rounded-top th.footable-last-column {
     border-top-right-radius: 0 !important;
}
/* for tables that have pagination, but don't have table header (pagination part should be rounded)*/
.rounded-top .row {
    border-radius: 14px 14px 0 0;
}

/* for tables that have expanded "row details" ("+" sign that open footable-row-detail). My Tasks, for example.
 When it is first time rendered, the footable-row-detail doesn't exist in dom tree;
 when "+" sign open, a footable-row-detail appears and becomes the last row, so the "tr:last-of-type" becomes applicable for it;
 then when "+" is closed footable-row-detail is still in dom, but with "display: none".
 So from this moment is seen pre-last row without rounded corners.
 To fix it :has is used ("if tr1 has another tr2 with "display: none" after it and this tr2 is the last one
 with "footable-row-detail" than make tr1 bottom left radius 14px ")
 */
.table-bordered tr:has(+ tr.footable-row-detail:last-of-type:is([style*="display: none"])) td:first-of-type,
.table-bordered tr:has(+ tr.footable-row-detail:last-of-type:is([style*="display: none"])) td.footable-first-column {
    border-bottom-left-radius: 14px !important;
}

.table-bordered tr:has(+ tr.footable-row-detail:last-of-type:is([style*="display: none"])) td:last-of-type,
.table-bordered tr:has(+ tr.footable-row-detail:last-of-type:is([style*="display: none"])) td.footable-last-column
{
    border-bottom-right-radius: 14px !important;
}

.display-tags-cont { /* My Tasks -> Tags */
    border: solid #ddd 1px !important;
    display: table-cell;
}

.tree-theme-windows table {
    border-collapse: separate;
}

/* pagination */
.pagination>li:last-child>a, .pagination>li:last-child>span{
    border-top-right-radius: 5px !important;
    border-bottom-right-radius: 5px !important;
}
.pagination>li:first-child>a, .pagination>li:first-child>span {
    border-top-left-radius: 5px !important;
    border-bottom-left-radius: 5px !important;
}

/* wysiwyg */
.wysiwyg-toolbar {
    border-radius: 5px 5px 0 0;
}

.wysiwyg-editor {
    border-radius: 0 0 5px 5px !important;
    border: 2px solid #E5E5E5 !important;
}

/* navigation */
.nav-tabs {
    border-bottom: none;
    margin-bottom: 1px !important;
}
.nav-pills {
    margin-left: 0;
}
.nav-tabs>li>a, .nav-tabs>li>a:focus {
    border-radius: 4px 4px 0 0 !important;
    border-color: #ddd;
    margin-right: 0;
}
/* Panel shortcuts: Edit SR -> Left navigation menu -> hover */
a.shortcuts-panel-link:hover {
    border-radius: 4px;
}
ul.submenu>li>a,
ul.submenu>li:hover>a {
    border-radius: 5px;
}

.nrms-wicket-mfu-container { /* File upload panel */
    padding-bottom: 10px !important;
    border-radius: 5px;
}
.itemdiv.dialogdiv>.body { /* Conversation panel */
    border-radius: 5px;
}