html,
body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html,
body {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Environment Banner - shows in non-production environments */
.environment-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    text-align: center;
    padding: 4px 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: white;
}

.environment-banner-spacer {
    height: 24px;
    flex-shrink: 0;
}

/* Set CSS variable for banner height when banner exists */
:root:has(.environment-banner) {
    --banner-height: 24px;
}

:root:not(:has(.environment-banner)) {
    --banner-height: 0px;
}

.env-dev {
    background-color: #d70036; /* Blue */
}

.env-qa {
    background-color: #d70036; /* Orange/Amber */
}

.env-uat {
    background-color: #ff9c00; /* Purple */
}

.env-test {
    background-color: #ff9c00; /* Green */
}

/* Forecast Grid - Pending Changes Indicator */
.has-pending-change,
td.has-pending-change {
    background-color: #fff3cd !important; /* Yellow/orange background for unsaved changes */
}

.pending-change {
    position: relative;
}

.pending-change::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background-color: #ff9800;
    border-radius: 50%;
}

.valid.modified:not([type="checkbox"]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.button-link {
    text-decoration: unset;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 0.625rem;
}

.title.title-secondary {
    padding-top: 0.313rem;
    padding-bottom: 0;
    color: var(--bs-secondary-color);
}

.title-header-text {
    font-size: 2.5rem;
    line-height: 3rem;
    font-weight: 600;
    letter-spacing: 0rem;
    padding: 0.3125rem 0;
}

.title-content-text {
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 2.5rem;
    letter-spacing: 0rem;
}

.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.block-content {
    width: 31.25rem;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 100%;
}

.or {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.or .or-line {
    border-bottom: 1px solid var(--bs-body-color);
    width: 100%;
    opacity: 0.2;
}

.or .or-text {
    padding: 0 0.625rem 0px 0.625rem;
    font-size: 0.75rem;
    line-height: 1.125rem;
    color: var(--bs-body-color);
    opacity: 0.7;
}

.links-area {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-top: 0.625rem;
}

.links-container {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}

.links-container .dot {
    height: 0.3125rem;
    width: 0.3125rem;
    margin: 0 0.1875rem;
    border-radius: 50%;
    background-color: var(--bs-body-color);
    opacity: 0.7;
}

.manage-layout {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.info-message::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.15;
    background: var(--bs-primary);
    z-index: -1;
}

.info-message {
    padding: 0.625rem 1rem 0.625rem 1rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.info-message.info-panel {
    margin-bottom: 0.625rem;
}

.manage-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.large-input {
    height: 4.3125rem;
    font-size: 1.875rem;
}

.title-content-text-secondary {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.button-group {
    display: flex;
    flex-direction: row;
    gap: 0.625rem;
}

.confirm-button {
    margin-top: 0.3125rem;
}

.display-desktop {
    display: block;
}

.display-mobile {
    display: none;
}

.icon-external-provider {
    width: 1rem;
    height: 1rem;
}

.icon-google {
    background-image: url("/images/account/providers/google-logo.svg");
}

.icon-facebook {
    background-image: url("/images/account/providers/facebook-logo.svg");
}

.icon-microsoft {
    background-image: url("/images/account/providers/microsoft-logo.svg");
}

.icon-twitter {
    background-image: url(../images/account/providers/twitter-logo.svg);
}

/* Forecast Grid Styles */
.grid-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

.forecast-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: max-content;
}

.forecast-grid .formula-hint {
    font-size: 0.75rem;
    color: var(--bs-info);
    cursor: help;
    margin-left: 4px;
    vertical-align: middle;
}

.forecast-grid th,
.forecast-grid td {
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    white-space: nowrap;
}

/* Top border on header cells */
.forecast-grid thead th {
    border-top: 1px solid #ddd;
}

/* Left border on first column */
.forecast-grid th:first-child,
.forecast-grid td:first-child {
    border-left: 1px solid #ddd;
}

/* Header styling */
.forecast-grid th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

/* Fixed column styling */
.forecast-grid th.fixed-column,
.forecast-grid td.fixed-column {
    position: sticky !important;
    background-color: #f8f9fa !important;
    z-index: 15 !important;
    overflow: visible;
}

/* Fixed column header styling */
.forecast-grid th.fixed-column {
    background-color: #e9ecef !important;
    z-index: 20 !important;
}

/* First column positioning */
.forecast-grid th.first-column,
.forecast-grid td.first-column {
    left: 0 !important;
    z-index: 25 !important;
    overflow: visible !important;
}

/* Second column positioning (default for tabs with 80px first column) */
.forecast-grid th.second-column,
.forecast-grid td.second-column {
    left: 80px !important;
    z-index: 25 !important;
    overflow: visible !important;
}

/* All tab specific: second column starts after Contract Name (280px) */
#all-tab-grid .forecast-grid th.second-column,
#all-tab-grid .forecast-grid td.second-column {
    left: 280px !important;
}

/* Third column positioning (80 + 220 = 300px) */
.forecast-grid th.third-column,
.forecast-grid td.third-column {
    left: 300px !important;
    z-index: 25 !important;
    overflow: visible !important;
}

/* Fourth column positioning (80 + 220 + 120 = 420px) */
.forecast-grid th.fourth-column,
.forecast-grid td.fourth-column {
    left: 420px !important;
    z-index: 25 !important;
    overflow: visible !important;
}

/* Fixed column border fix - use ::before for left border on columns 2-4 */
.forecast-grid th.second-column::before,
.forecast-grid td.second-column::before,
.forecast-grid th.third-column::before,
.forecast-grid td.third-column::before,
.forecast-grid th.fourth-column::before,
.forecast-grid td.fourth-column::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
    z-index: 30;
}

/* Left border on first column (grid outer edge) */
.forecast-grid th.first-column::before,
.forecast-grid td.first-column::before {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
    z-index: 100;
}

/* Top border on sticky header fixed columns - use inset box-shadow for visibility */
.forecast-grid thead th.fixed-column {
    box-shadow: inset 0 1px 0 #ddd;
}

/* Right border on the last fixed column to separate from scrolling content */
/* Note: Different tabs have different numbers of fixed columns, so we add ::after to all */
.forecast-grid th.second-column::after,
.forecast-grid td.second-column::after,
.forecast-grid th.third-column::after,
.forecast-grid td.third-column::after,
.forecast-grid th.fourth-column::after,
.forecast-grid td.fourth-column::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
    z-index: 30;
}

/* Header and footer cell dividers using pseudo-element */
.forecast-grid thead th,
.forecast-grid tfoot td {
    position: relative;
    overflow: visible;
}

/* Left border dividers for header cells (non-fixed columns) */
.forecast-grid thead th:not(.fixed-column)::before,
.forecast-grid tfoot td:not(.fixed-column)::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #ddd;
    z-index: 30;
}

/* past-month styling removed - actuals now use .actual-cell class instead */
.past-month {
    /* No special background - only .actual-cell gets green styling */
}

.cell-content {
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.cell-content.editable:hover {
    background-color: #f0f0f0;
}

.cell-content.readonly {
    cursor: default;
}

/* Footer styling */
.totals-row {
    background-color: #f8f9fa;
    font-weight: 600;
}

.totals-row th,
.totals-row td {
    position: sticky !important;
    bottom: 0 !important;
    background-color: #f8f9fa !important;
    z-index: 10 !important;
    border-top: 2px solid #ddd;
}

/* Fixed column footer styling */
.totals-row th.fixed-column,
.totals-row td.fixed-column {
    background-color: #f8f9fa !important;
    z-index: 15 !important;
}

.totals-row th.first-column,
.totals-row td.first-column {
    left: 0 !important;
    z-index: 25 !important;
}

.totals-row th.second-column,
.totals-row td.second-column {
    left: 80px !important;
    z-index: 25 !important;
}

/* All tab specific: totals row second column */
#all-tab-grid .totals-row th.second-column,
#all-tab-grid .totals-row td.second-column {
    left: 280px !important;
}

.totals-row th.third-column,
.totals-row td.third-column {
    left: 300px !important;
    z-index: 25 !important;
}

.totals-row th.fourth-column,
.totals-row td.fourth-column {
    left: 420px !important;
    z-index: 25 !important;
}

@media (max-width: 768px) {
    .display-desktop {
        display: none;
    }

    .display-mobile {
        display: block;
    }
}

/* ========================================
   SNAPSHOT PAGE STYLES
   ======================================== */

/* 5-column layout: BC # (80px), Contract Name (220px), Original Value (120px), AWA (120px), Duration (80px) */

/* Fixed column styling */
.snapshot-grid th.fixed-column,
.snapshot-grid td.fixed-column {
    position: sticky;
    background-color: #f8f9fa;
    z-index: 20;
    overflow: visible;
}

.snapshot-grid th.fixed-column {
    background-color: #e9ecef;
}

/* Column positions */
.snapshot-grid .first-column { left: 0; }
.snapshot-grid .second-column { left: 80px; }
.snapshot-grid .third-column { left: 300px; }
.snapshot-grid .fourth-column { left: 420px; }
.snapshot-grid .fifth-column { left: 540px; }

/* Left border on first column (grid outer edge) */
.snapshot-grid th.first-column::before,
.snapshot-grid td.first-column::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #dee2e6;
    z-index: 1;
}

/* Fixed column border fix - use ::before for left border on columns 2-5 */
.snapshot-grid th.second-column::before,
.snapshot-grid td.second-column::before,
.snapshot-grid th.third-column::before,
.snapshot-grid td.third-column::before,
.snapshot-grid th.fourth-column::before,
.snapshot-grid td.fourth-column::before,
.snapshot-grid th.fifth-column::before,
.snapshot-grid td.fifth-column::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #dee2e6;
    z-index: 1;
}

/* Right border on the last fixed column to separate from scrolling content */
.snapshot-grid th.fifth-column::after,
.snapshot-grid td.fifth-column::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #dee2e6;
    z-index: 1;
}
