/*
 * Copyright (C) 2024 S&P Global.
 *
 * All Rights Reserved
 *
 * Notice: The information, data, processing technology, software (including source code),
 * technical and intellectual concepts and processes and all other materials provided
 * (collectively the "Property") are Copyright © 2020, S&P Global and/or its affiliates
 * (together "S&P Global") and constitute the proprietary and confidential information of
 * S&P Global. S&P Global reserves all rights in and to the Property. Any copying,
 * reproduction, distribution, transmission or disclosure of the Property, in any form, is
 * strictly prohibited without the prior written consent of S&P Global. Unless otherwise
 * agreed in writing, the Property is provided on an "as is" basis and S&P Global makes no
 * warranty, express or implied, as to its accuracy, completeness, timeliness, or to any
 * results to be obtained by recipient nor shall S&P Global in any way be liable to any
 * recipient for any inaccuracies, errors or omissions in the Property. Without limiting the
 * generality of the foregoing, S&P Global shall have no liability whatsoever to any
 * recipient of the Property, whether in contract, in tort (including negligence), under
 * warranty, under statute or otherwise, in respect of any loss or damage suffered by any
 * recipient as a result of or in connection with such Property, or any course of action
 * determined, by it or any third party, whether or not based on the Property. The S&P Global
 * logo is a registered trademark of S&P Global, and the trademarks of S&P Global used
 * herein are protected by international laws. Any other names may be trademarks of their
 * respective owners.
 */

@import "material-icons.css";
@import "fonts.css";

:root {
    /* Menu colors - using Bootstrap variables where appropriate */
    --n6-menu-color: var(--bs-body-color);
    --n6-menu-background-color: var(--bs-gray-200);
    --n6-corp-red-background: color-mix(in srgb, var(--bs-danger) 15%, transparent);

    --n6-text-inclusive: var(--bs-success);
    --n6-text-exclusive: var(--bs-danger);
    --n6-text-bg-green: #e2ffda;
    --n6-text-bg-red: #ffe8e8;
    --n6-text-bg-yellow: #fffbd8;
    --n6-editable-background: var(--bs-gray-100);

    --n6-highlight:var(--n6-text-bg-yellow);
    --n6-highlight-text: var(--bs-body-color);
    --n6-drag-bg: var(--n6-text-bg-yellow);
}

[data-bs-theme=dark]:root {
    /* ====================================
     * DARK THEME OVERRIDES
     * ====================================
     * Only override application-specific variables, corporate colors come from Bootstrap
     */

    --n6-menu-color: var(--bs-body-color);
    --n6-menu-background-color: var(--bs-gray-800);
    --n6-corp-red-background: color-mix(in srgb, var(--bs-danger) 15%, transparent);
    --n6-text-inclusive: rgba(172, 255, 172, 0.75);
    --n6-text-exclusive: #fe8a8a;
    --n6-text-bg-green: rgb(19, 63, 6);
    --n6-text-bg-red: #3f0a0a;
    --n6-editable-background: var(--bs-gray-800);

    --n6-highlight: var(--bs-body-bg);
    --n6-highlight-text: #fffbd8;
    --n6-drag-bg: rgba(255, 251, 216, 0.20);
}

[data-bs-theme=high-contrast]:root {

    --n6-text-bg-green: rgb(19, 63, 6);
    --n6-text-bg-red: #3f0a0a;

    --n6-highlight: var(--bs-body-bg);
    --n6-highlight-text: #fffbd8;
    --n6-drag-bg: rgba(255, 251, 216, 0.20);
}

/* ====================================
 * COMPONENT STYLES
 * ====================================
 * Using Bootstrap corporate colors instead of custom definitions
 */

/* Header */
#dm-header {
    border-top: solid 1px var(--bs-danger);
}

/* Search */
#search, .n6-filter {
    padding-left: 30px;
}

#search {
    width:250px;
    font-style:italic;
}

#search > span {
    border-bottom: solid 1px var(--bs-danger);
}

.n6-nav-list li[tabindex]:focus-visible {
    outline:solid 2px var(--bs-focus-ring-color)
}

.n6-input-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.n6-input-height input {
    min-height: 38px;
}

.n6-input-with-icon {
    position: relative;
    display: inline;
    align-items: center;
}

.n6-input-with-icon input {
    padding-left: 34px;
}

.n6-input-with-icon .material-icons {
    position: absolute;
    left: 12px;
    top:2px;
    pointer-events: none;
}

.n6-width-auto {
    width: auto !important;
}

.envSwitcher {
    font-weight: bold;
    min-width: 60px;
}

.envSwitcher select {
    border-width: 2px;
    padding: 0 0 0 2px;
    border-color: var(--env);
    font-size: 80%;
    font-weight: bold;
    height: 25px;
}

h2 {
    font-size: 18pt;
    font-weight: bold;
}

[data-bs-theme="dark"] h2,[data-bs-theme="high-contrast"] h2 {
    color: var(--bs-body-color);
}

.dm-corp-logo {
    background-image: url('../images/sp-logo-header.svg');
    width: 48px;
    height: 24px;
    display: inline-block;
    background-repeat: no-repeat;
    border-right: 1px solid var(--bs-border-color);
    padding-right: 60px;
}

[data-bs-theme=dark] .dm-corp-logo {
    background-image: url('../images/sp-logo-header-dark.svg');
}

/* BreadCrumbs */
.breadcrumb {
    --bs-breadcrumb-margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--n6-menu-color);
    text-decoration-line: none;
}

.breadcrumb-item:hover a {
    text-decoration-line: underline;
}

.n6-menu-item a, .n6-menu-item-active a {
    color: var(--n6-menu-color);
}

.n6-menu-item {
    margin-left: 4px
}

.n6-menu-item:hover {
    background-color: var(--n6-menu-background-color);
}

.n6-menu-item-active {
    background-color: var(--n6-menu-background-color);
    border-left: solid 4px var(--bs-danger); /* Using Bootstrap danger (corporate brand red) */
}

.n6-collapse-button {
    height: 40px;
    width: 40px;
}

/* Help */
.n6-help-link {
    color: var(--n6-menu-color);
    cursor: help;
    text-decoration: none;
}

.n6-help-link:hover {
    text-decoration: underline;
}

.n6-help {
    cursor: help;
    padding-top: 2px;
}

.autocomplete-suggestion b {
    font-weight: normal;
    background-color: var(--n6-drag-bg);
}

/* Grid */
.n6-grid thead {
    border-top: solid 1px var(--bs-border-color);
    border-bottom: solid 2px var(--bs-border-color);
}

/* Form */
.n6-data-form .n6-property-table th {
    min-height: 39px;
    height: 39px;
    vertical-align: middle;
}

.n6-select-property-header {
    height: 39px;
}

.n6-property-table tr:last-child > td,
.n6-property-table tr:last-child > th {
    border-bottom: 0 !important;
}

.n6-delete-hover {
    background-color: var(--n6-text-bg-red) !important;
}

/* Table */
.n6-shrink {
    width:1px;
    white-space: nowrap;
}

/* Width utilities - could potentially be replaced with Bootstrap utilities */
.n6-w-20 {
    width:20px;
    min-width: 20px;
}

.n6-w-40 {
    width:40px;
    min-width: 40px;
}

.n6-w-60 {
    width:60px;
    min-width: 60px;
}

.n6-w-80 {
    width:80px;
    min-width: 80px;
}

.n6-w-100 {
    width:100px;
    min-width: 100px;
}

.n6-w-200 {
    width:200px;
    min-width: 200px;
}

.n6-w-300 {
    width:300px;
    min-width: 300px;
}

.n6-w-400 {
    width:400px;
    min-width: 400px;
}

.n6-w-600 {
    width:600px;
    min-width: 600px;
}

.n6-text-bg-green {
    background-color: var(--n6-text-bg-green);
}

.n6-text-bg-green-important {
    background-color: var(--n6-text-bg-green)!important;
}

.n6-text-bg-red {
    background-color: var(--n6-text-bg-red);
}

.n6-text-bg-red-important {
    background-color: var(--n6-text-bg-red)!important;
}

.n6-text-bg-yellow {
    background-color: var(--n6-highlight)!important;
}

.n6-text-bg-secondary {
    background-color: var(--bs-secondary-bg)!important;
}

.n6-small-number {
    color:var(--bs-gray-600);
}

.n6-medium-number {
    font-weight: lighter;
}

.n6-large-number {
    color: var(--bs-info);
}

/* Icon */
.n6-icon {
    cursor: pointer;
    padding-bottom: 1px;
    text-decoration: none;
}

.n6-struct-add {
    cursor: pointer;
}

.n6-struct-add i:hover{
    background-color: var(--n6-text-bg-green) !important;
}

.n6-icon:hover, .n6-dangling-icon:hover, .n6-empty-icon:hover {
    text-decoration: none;
}

.n6-inclusive {
    color: var(--n6-text-inclusive);
}

.n6-exclusive {
    color: var(--n6-text-exclusive);
}

.n6-icon:hover, .n6-dangling-icon:hover, .n6-empty-icon:hover {
    text-decoration: none;
}

/* Flow cards */
.n6-card-body-relative {
    position: relative;
}
.n6-background-icon {
    color: rgba(128, 128, 128, 0.08);
    font-size: 100px !important;
    position: absolute;
    right: 10px;
    bottom: 10px;
    pointer-events: none;
}

/* Avatar */
.avatar {
    --bs-avatar-width: 32px;
    position: relative;
    width: var(--bs-avatar-width);
    height: var(--bs-avatar-width);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 14px;
    border-radius: 50%;
    -o-object-fit: cover;
    object-fit: cover;
    color: white;
    background-color: var(--env);
}

/* File upload */
.n6-file-drop-area {
    padding: 3px 5px 5px 5px;
    border: dashed 1px #b5b5b5;
    font-size: 80%;
}

.n6-file-drop-area:hover {
    border:solid 1px;
}

.n6-drag {
    background-color: var(--n6-drag-bg);
}

.n6-drag td {
    background-color: var(--n6-drag-bg);
}

.n6-drag-handle:hover {
    cursor: grab;
}

.n6-drag-handle:active {
    cursor: grabbing;
}

.n6-drag-handle {
    color: var(--bs-primary);
}

/* Badge */
.n6-badge {
    padding: .2em .4em;
    font-size: .8rem;
}

.text-bg-success {
    background-color: var(--bs-success) !important;
}

a {
    text-decoration: none;
}

.n6-decorated-link .material-icons {
    margin-right: 4px;
}

.n6-decorated-link:hover {
    text-decoration: underline;
}

.n6-image-icon {
    width: 16px;
}

.n6-highlight,.n6-today {
    color:var(--n6-highlight-text);
    background-color: var(--n6-highlight);
}

.n6-hover-highlight:hover {
    background-color:  var(--n6-drag-bg);
}

/* link button */
.n6-button-link {
    background: none!important;
    border: none;
    padding: 0!important;
    cursor: pointer;
}

/* keyboard shortcuts */
kbd {
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.1em 0.5em;
    margin: 0 0.2em;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px #fff inset;
    background-color: #f7f7f7;
}


/* content-editable */
.n6-empty-editable {
    display: block !important;
}

.n6-editable:hover {
    /*noinspection CssUnknownTarget*/
    cursor: url('/static/images/edit.png') 1 30, crosshair
}

.n6-editable-cell, .n6-editable-cell .card-body {
    background-color: var(--n6-editable-background) !important;
}

.n6-editable-dateTime {
    width: 180px;
    background-color: #f2f2f2;
}

.n6-mandatory::after {
    content: " *";
    color: var(--bs-danger); /* Using Bootstrap danger (corporate brand red) */
}

.n6-optional::after {
    content: " *";
    visibility: hidden;
}

.n6-modified {
    background: var(--n6-text-bg-green) !important;
    min-width: 10px;
}

.n6-added, .n6-added .n6-editable span, .n6-added .n6-modified {
    background:var(--n6-text-bg-green);
}

.n6-marked-for-remove, .n6-marked-for-remove .n6-modified, .n6-marked-for-remove .card-body, .n6-marked-for-remove {
    background:var(--n6-text-bg-red);
}

.n6-marked-for-remove, .n6-marked-for-remove span {
    color: #9a3935;
    text-decoration: line-through;
    background:var(--n6-text-bg-red);
}

.n6-marked-for-remove .badge {
    background-color: #878787;
    text-decoration: line-through;
}

.n6-marked-for-remove input {
    text-decoration: line-through;
    background:var(--n6-text-bg-red);
}

.n6-modified-previous {
    text-decoration: line-through;
    background:var(--n6-text-bg-red);
}

.n6-savebar-env {
    margin-left: 8px;
    margin-right: 16px;
    color: var(--env);
    font-weight: bold;
}

.n6-disabled{
    opacity: 0.65;
}

.progress {
    height: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}

.progress-bar {
    float: left;
    width: 0%;
    height: 100%;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    text-align: center;
    background-color: #337ab7;
    -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
    -webkit-transition: width .6s ease;
    -o-transition: width .6s ease;
    transition: width .6s ease;
}

/* TomSelect: Prevent input from wrapping to new line in single-select and when few items are selected */
.ts-wrapper.single .ts-control {
    flex-wrap: nowrap;
}

ins {
    background: var(--n6-text-bg-green) !important;
}

ins::before {
    content: "+";
    text-decoration: none;
    display: inline-block;
    padding-right: 8px;
    padding-left: 4px;
}

del {
    background:var(--n6-text-bg-red);
}

del::before {
    content: "-";
    text-decoration: none;
    display: inline-block;
    padding-right: 8px;
    padding-left: 4px;
}
