@import url('./main-layout.css');
@import url('./views/logs-view.css');
@import url('./views/quantified-analytes-view.css');
@import url('./views/a-i-result-view.css');
@import url('./views/x-i-cs-view.css');
@import url('@fontsource/barlow-condensed/index.css');

/* Modal backdrop - whitening effect to fade background content */
vaadin-dialog-overlay::part(backdrop) {
    background-color: rgba(255, 255, 255, 0.50);
}

/* Default compact grids - reduce padding and font size */
/*
vaadin-grid::part(cell) {
    padding-top: var(--vaadin-padding-xs, var(--lumo-space-xs)) !important;
    padding-bottom: var(--vaadin-padding-xs, var(--lumo-space-xs)) !important;
}

vaadin-grid {
    font-size: var(--lumo-font-size-s);
}
*/

/* Table status label styling */
.table-status-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    padding: 4px 0;
}

.table-status-label vaadin-button {
    margin-left: 8px;
}

/*
html {
    font-size: 125%;
    --lumo-line-height-m: 1.4;
    --lumo-line-height-s: 1.2;
    --lumo-line-height-xs: 1.1;
    --lumo-border-radius-s: calc(var(--lumo-size-m) / 6);
    --lumo-border-radius-m: calc(var(--lumo-size-m) / 2);
    --lumo-border-radius-l: var(--lumo-size-m);
    --lumo-size-xl: 3rem;
    --lumo-size-l: 2.5rem;
    --lumo-size-m: 2rem;
    --lumo-size-s: 1.75rem;
    --lumo-size-xs: 1.5rem;
    --lumo-space-xl: 1.875rem;
    --lumo-space-l: 1.25rem;
    --lumo-space-m: 0.625rem;
    --lumo-space-s: 0.3125rem;
    --lumo-space-xs: 0.1875rem;
    --lumo-font-family: Barlow Condensed;

}
*/

/* Tertiary buttons should have underline to appear as hyperlinks */
vaadin-button[theme~="tertiary"]::part(label) {
    text-decoration: underline;
}

/* Section box styling for dialogs */
.section-box {
    position: relative;
    background: rgba(30, 40, 60, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 20px 20px 20px;
    /* top-left NOT rounded to blend with title */
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    margin-top: -1px;
    /* overlap with title's bottom border */
}

/* Cursor indicator for help elements */
.help-cursor {
    cursor: help;
}

.section-box-title {
    position: relative;
    /* Removed z-index: 1 to prevent appearing on top of overlay dialogs */
    display: inline-block;
    background: rgba(30, 40, 60, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    /* seamless connection with section below */
    border-radius: 12px 12px 0 0;
    /* only top corners rounded */
    padding: 0.4rem 1.25rem;
    margin-bottom: 0;
    /* no gap between title and section content */
    /* font-size: var(--lumo-font-size-m); */
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    /* ensure no underline */
}

/* Fix checkbox alignment with label in Vaadin 25/Aura theme */
vaadin-checkbox {
    align-items: center;
}

vaadin-checkbox::part(label) {
    padding-top: 0;
    margin-bottom: 1px;
    /* Subtle lift for the text to match center of icon */
}

vaadin-checkbox::part(checkbox) {
    /* Standard adjustment for regular checkboxes */
}

/* Toggle Switch Styling for Checkboxes */
vaadin-checkbox[theme~="toggle-switch"] {
    cursor: pointer;
    align-items: flex-start;
    /* Align top of toggle with top of label */
}

vaadin-checkbox[theme~="toggle-switch"]::part(checkbox) {
    width: 2.5em;
    height: 1.25em;
    border-radius: 1em;
    background-color: var(--lumo-contrast-20pct);
    border: none;
    transition: background-color 0.2s;
    margin-right: 0.85rem;
    /* Reduced space between toggle and label 20% */
    position: relative;
    flex-shrink: 0;
    margin-top: 0.45rem;
    /* Lowered even more to align top of track with top of text */
}

vaadin-checkbox[theme~="toggle-switch"][checked]::part(checkbox) {
    background-color: var(--lumo-primary-color);
}

/* The thumb of the switch */
vaadin-checkbox[theme~="toggle-switch"]::part(checkbox)::after {
    content: "";
    position: absolute;
    top: 0.125em;
    left: 0.125em;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    background-color: #fff;
    transition: transform 0.2s;
    box-shadow: var(--lumo-box-shadow-s);
}

vaadin-checkbox[theme~="toggle-switch"][checked]::part(checkbox)::after {
    transform: translateX(1.25em);
}

/* Hide the default checkmark */
vaadin-checkbox[theme~="toggle-switch"]::part(checkbox)::before {
    display: none;
}


/* Dialog viewport constraints - prevent exceeding screen size */
vaadin-dialog-overlay::part(overlay) {
    max-width: 95vw;
    max-height: 90vh;
}

vaadin-dialog-overlay::part(content) {
    overflow-y: auto;
    overflow-x: hidden;
}

/*
[theme~="dark"] {
    --lumo-shade-5pct: rgba(33, 33, 33, 0.05);
    --lumo-shade-10pct: rgba(33, 33, 33, 0.1);
    --lumo-shade-20pct: rgba(33, 33, 33, 0.2);
    --lumo-shade-30pct: rgba(33, 33, 33, 0.3);
    --lumo-shade-40pct: rgba(33, 33, 33, 0.4);
    --lumo-shade-50pct: rgba(33, 33, 33, 0.5);
    --lumo-shade-60pct: rgba(33, 33, 33, 0.6);
    --lumo-shade-70pct: rgba(33, 33, 33, 0.7);
    --lumo-shade-80pct: rgba(33, 33, 33, 0.8);
    --lumo-shade-90pct: rgba(33, 33, 33, 0.9);
    --lumo-primary-color-50pct: rgba(235, 89, 5, 0.5);
    --lumo-primary-color-10pct: rgba(235, 89, 5, 0.1);
    --lumo-error-color-50pct: rgba(231, 24, 24, 0.5);
    --lumo-error-color-10pct: rgba(231, 24, 24, 0.1);
    --lumo-success-color-50pct: rgba(62, 229, 170, 0.5);
    --lumo-success-color-10pct: rgba(62, 229, 170, 0.1);
    --lumo-shade: hsl(0, 0%, 13%);
    --lumo-primary-color: hsl(22, 96%, 47%);
    --lumo-primary-text-color: hsl(22, 100%, 42%);
    --lumo-error-color: hsl(0, 81%, 50%);
    --lumo-error-text-color: hsl(0, 86%, 45%);
    --lumo-success-color: hsl(159, 76%, 57%);
    --lumo-success-contrast-color: hsl(159, 29%, 10%);
    --lumo-success-text-color: hsl(159, 61%, 40%);

}
*/

/* Global Zebra Striping for all Grids */
/*
vaadin-grid::part(odd-row-cell) {
    background-color: var(--lumo-contrast-5pct);
}
*/

/* Alignment aid for components without a top label to match neighbors with labels */
.naked-field-alignment {
    margin-top: 29px !important;
}

/* Dim labels when parent help-wrapper is disabled */
.help-field-wrapper[disabled] .help-field-label,
.help-field-wrapper[disabled] label {
    opacity: 0.5 !important;
    transition: opacity 0.2s ease;
}

.help-field-wrapper .help-field-label,
.help-field-wrapper label {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Specific fix for native labels (like Analysis Mode) */
.native-label-dim[disabled] {
    opacity: 0.5 !important;
}

vaadin-horizontal-layout[disabled] .range-text-field-hyphen {
    color: var(--lumo-disabled-text-color) !important;
}