/* Color palette for score ranges */
:root {
    --color-high-warning: #e53935;
    --color-warning: #ffb300;
    --color-normal: #7cb342;
    --color-optimal: #43a047;
    --color-normal-light: #cbf2ae;
    --color-optimal-light: #9ccc65;
    
    /* Grayscale versions for inactive state */
    --color-high-warning-inactive: #555;
    --color-warning-inactive: #777;
    --color-normal-inactive: #999;
    --color-optimal-inactive: #bbb;
    --color-normal-light-inactive: #ccc;
    --color-optimal-light-inactive: #ddd;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    font-family: system-ui, -apple-system, sans-serif;
}
.container {
    display: flex;
    height: 100%;
}
.left-column {
    width: 75%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}
.right-column {
    width: 25%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    background: #e0e0e0;
}
.left-content {
    width: 100%;
}
.right-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /*padding-top: 40px;*/
}
.score-card {
    text-align: center;
    background: #fff;
    border-radius: 12px;
    padding: 15px 40px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    width: 100%;
}
.score-card + .score-card {
    margin-top: 20px;
}
.score-card-label {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}
.score-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}
.score-card-value.main-value {
    font-size: 3rem;
}
.beets-score-value,
.beets-score-confidence-value {
    color: rgb(11, 111, 251);
}
.score-card-formula {
    text-align: left;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    color: #555;
    line-height: 1.6;
}
.formula-line {
    /*margin-bottom: 4px;*/
    word-break: break-word;
}
.formula-result {
    font-weight: 600;
    color: #333;
    margin-top: 8px;
    font-size: 0.85rem;
}
.domain {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.domain-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #333;
}
.domain-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.domain-name {
    font-size: 1.25rem;
    font-weight: 600;
}
.domain-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: rgb(11, 111, 251);
}

/* Domain collapse toggle */
.domain-collapse-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    margin-right: 6px;
}
.domain-collapse-toggle:hover {
    color: #333;
}
.domain.collapsed .domain-collapse-toggle {
    transform: rotate(-90deg);
}
.domain.collapsed .components-table {
    display: none;
}
.domain.collapsed .domain-header {
    margin-bottom: 0;
    border-bottom: none;
}
.domain.collapsed {
    cursor: pointer;
}

/* Top row container for User Variables and Display cards */
.top-row-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.top-row-container .user-variables-card {
    flex: 0 0 70%;
    margin-bottom: 0;
}
.top-row-container .display-card {
    flex: 0 0 calc(30% - 20px);
    margin-bottom: 0;
}

/* Display Card */
.display-card .domain-header {
    border-bottom: 2px solid #333;
}
.display-card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.display-button-group {
    display: flex;
    gap: 10px;
}
.display-btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #333;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}
.display-btn:hover:not(:disabled) {
    background: #f0f0f0;
}
.display-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* User Variables Card */
.user-variables-card .domain-header {
    border-bottom: 2px solid #333;
}
.user-variables-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.user-var-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-var-label {
    font-weight: 600;
    min-width: 60px;
    color: #333;
}
.radio-group, .checkbox-group {
    display: flex;
    gap: 20px;
}
.radio-option, .checkbox-option {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.radio-option input, .checkbox-option input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: rgb(11, 111, 251);
}
.checkbox-option input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}
.checkbox-option:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
}
.user-var-spacer {
    width: 40px;
}
.slider-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.slider-input {
    width: 70px;
    height: 32px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #333;
    border-radius: 5px;
}
.slider-range {
    width: 150px;
    height: 8px;
    cursor: pointer;
    accent-color: rgb(11, 111, 251);
}
#user-age-slider {
    width: 600px;
}
.slider-display {
    min-width: 30px;
    font-weight: 600;
    color: #333;
    text-align: right;
}
.slider-unit {
    color: #666;
    font-size: 14px;
}
.domain-info {
    display: flex;
    gap: 20px;
}
.domain-weight {
    font-size: 1rem;
    color: #666;
}
.domain-score {
    font-size: 1rem;
    color: #999;
    font-weight: 600;
}
.components-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}
.components-table th,
.components-table td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}
.components-table th {
    background: #f0f0f0;
    font-weight: 600;
}
.components-table tr:last-child td {
    border-bottom: none;
}
.components-table th:nth-child(1),
.components-table td:nth-child(1) {
    width: 14%;
}
.components-table th:nth-child(2),
.components-table td:nth-child(2) {
    width: 9%;
}
.components-table th:nth-child(3),
.components-table td:nth-child(3) {
    width: 10%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: normal;
}
.components-table th:nth-child(4),
.components-table td:nth-child(4) {
    width: 36%; /* Variable value entry */
}
.components-table th:nth-child(5),
.components-table td:nth-child(5) {
    width: 6%; /* Composite */
}
.components-table th:nth-child(6),
.components-table td:nth-child(6) {
    width: 13%;
    text-align: center;
}
.components-table th:nth-child(7),
.components-table td:nth-child(7) {
    width: 12%;
    text-align: center;
}
.data-entry-cell {
    overflow: visible;
}
.data-entry-cell .gauge-card + .gauge-card {
    margin-top: 10px;
}
.score-cell {
    font-weight: 600;
    font-size: 1.2rem;
}
.value-cell {
    font-weight: 600;
    font-size: 1.2rem;
}

/* Gauge card styles */
.gauge-card {
    background: #fafafa;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.gauge-card.inactive .gauge-content {
    opacity: 0.5;
}
.gauge-card.inactive {
    cursor: pointer;
}
.gauge-active-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5px;
}
.gauge-active-toggle .active-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: rgb(11, 111, 251);
}
.gauge-active-toggle .active-label {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    cursor: pointer;
    display: none;
}
.gauge-card.inactive .active-label {
    color: #fafafa;
    display: none;
}
.gauge-content {
    flex: 1;
}
.gauge-card .header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.gauge-card .value-input {
    width: 90px;
    height: 36px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #222;
    border-radius: 5px;
    margin-right: 10px;
}
.gauge-card .info h2 {
    font-size: 13px;
    color: #333;
    margin-bottom: 1px;
}
.gauge-card .info .reading {
    font-size: 12px;
    color: #555;
}
.gauge-wrapper {
    position: relative;
    height: 30px;
    margin: 4px 0;
}
.gauge-bar {
    height: 12px;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    background: #ddd;
    cursor: pointer;
}
.gauge-bar > div {
    height: 100%;
}
.pointer {
    position: absolute;
    /*bottom: 6px;*/
    left: 50%;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid #00aaff;
    transform: translateX(-50%);
    transition: left 0.1s ease, border-bottom-color 0.25s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    cursor: ew-resize;
    user-select: none;
}
.pointer.dragging {
    transition: none;
}
.gauge-card.inactive .pointer {
    border-bottom-color:var(--color-normal-inactive) !important;
}
.result-label {
    font-size: 13px;
    font-weight: normal;
    color: #00aaff;
    transition: color 0.25s;
    margin-left: 6px;
}
.gauge-card.inactive .result-label {
    opacity: 0;
}
.result-main {
    padding: 1px 4px 3px 4px;
    border-radius: 6px;
    display: inline;
}
.result-sub {
    color: #666;
    font-size: 12px;
    display: inline;
    margin-left: 4px;
}
.error-msg {
    text-align: center;
    color: #d32f2f;
    font-size: 10px;
    margin-top: 4px;
}
.condition-label {
    text-align: right;
    color: #999;
    font-size: 13px;
    margin-top: 4px;
    /*font-style: italic;*/
}

/* Range colors */
/* Active state colors */
.range-high-warning { background: var(--color-high-warning); border-right: 1px solid #333; }
.range-warning { background: var(--color-warning); border-right: 1px solid #333; }
.range-normal { background: var(--color-normal-light); border-right: 1px solid #333; }
.range-optimal { background: var(--color-optimal-light); border-right: 1px solid #333; }

/* Inactive state colors - grayscale */
.gauge-card.inactive .range-high-warning { background: var(--color-high-warning-inactive); }
.gauge-card.inactive .range-warning { background: var(--color-warning-inactive); }
.gauge-card.inactive .range-normal { background: var(--color-normal-inactive); }
.gauge-card.inactive .range-optimal { background: var(--color-optimal-inactive); }

