/* ============================================================
   Filter Calculator – form & UI styling
   Companion to screen7.css for the SCHOTT filter calculator
   ============================================================ */

/* ---- Status bar ---- */
#status {
    padding: 8px 12px;
    margin: 12px 0;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1.5;
}

#status.loading {
    background: #fff8e1;
    color: #7a6200;
    border: 1px solid #ffe082;
}

#status.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

#status.error {
    background: #fce4ec;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

/* ---- Filter rows ---- */
#filter-selects {
    margin: 16px 0 8px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-row select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 9px;
    box-sizing: border-box;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #555;
    background-color: #fafafa;
    border: 1px solid #ccc;
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
    transition: border 0.2s linear, box-shadow 0.2s linear;
    cursor: pointer;
}

.filter-row select:focus {
    border-color: rgba(82, 168, 236, 0.8);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset,
                0 0 8px rgba(82, 168, 236, 0.6);
    outline: none;
}

.filter-row .filter-thickness {
    width: 70px;
    height: 40px;
    padding: 8px;
    box-sizing: border-box;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #555;
    text-align: right;
    background-color: #fafafa;
    border: 1px solid #ccc;
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
    transition: border 0.2s linear, box-shadow 0.2s linear;
}

.filter-row .filter-thickness:focus {
    background-color: #ffffcc;
    border-color: rgba(82, 168, 236, 0.8);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset,
                0 0 8px rgba(82, 168, 236, 0.6);
    outline: none;
}

.filter-row .thickness-unit {
    font-size: 13px;
    color: #888;
    white-space: nowrap;
}

/* ---- Thickness tooltip (anchor to the right edge) ---- */
.filter-row .tooltip-text {
    left: auto;
    right: 0;
    margin-left: 0;
}

/* ---- Remove filter button ---- */
.remove-filter-btn {
    height: 40px;
    width: 40px;
    padding: 0;
    font-size: 14px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    color: #999;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 1px;
    box-sizing: border-box;
    transition: color .15s, border-color .15s, background .15s;
}

.remove-filter-btn:hover {
    color: #c00;
    border-color: #c00;
    background: #fff0f0;
}

/* ---- Button row ---- */
.button-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 0;
    flex-wrap: wrap;
}

/* ---- Add filter button ---- */
#add-filter-btn {
    display: inline-block;
    height: 40px;
    padding: 0 18px;
    box-sizing: border-box;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #3366cc;
    background: #fafafa;
    border: 1px solid #ccc;
    border-radius: 1px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

#add-filter-btn:hover:not(:disabled) {
    background: #dce4f2;
    border-color: #3366cc;
}

#add-filter-btn:disabled {
    cursor: default;
    opacity: 0.5;
    color: #999;
}

/* ---- Calculate button ---- */
#calculate-btn {
    display: inline-block;
    height: 40px;
    padding: 0 24px;
    box-sizing: border-box;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background: #3093c7;
    background-image: linear-gradient(to bottom, #3093c7, #1c5a85);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: #B4B5B5 2px 2px 5px;
    text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
    transition: background .15s, box-shadow .15s;
}

#calculate-btn:hover {
    background: #26759e;
    background-image: linear-gradient(to bottom, #26759e, #133d5b);
    box-shadow: #B4B5B5 1px 1px 2px;
}

#calculate-btn:active {
    position: relative;
    top: 1px;
}

/* ---- Wavelength section ---- */
.wavelength-section {
    margin-top: 24px;
}

.wavelength-section h2 {
    margin-bottom: 10px;
}

.wavelength-presets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wavelength-preset {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    padding: 4px 0;
}

.wavelength-preset input[type="radio"] {
    margin: 0 4px 0 0;
    cursor: pointer;
}

.wavelength-preset .preset-label {
    font-size: 13px;
    color: #888;
}

.wavelength-preset-custom input[type="number"] {
    width: 80px;
    height: 32px;
    padding: 4px 8px;
    box-sizing: border-box;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: normal;
    color: #555;
    text-align: right;
    background-color: #fafafa;
    border: 1px solid #ccc;
    border-radius: 1px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
    transition: border 0.2s linear, box-shadow 0.2s linear;
    -moz-appearance: textfield;
}

.wavelength-preset-custom input[type="number"]::-webkit-inner-spin-button,
.wavelength-preset-custom input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wavelength-preset-custom input[type="number"]:focus {
    background-color: #ffffcc;
    border-color: rgba(82, 168, 236, 0.8);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset,
                0 0 8px rgba(82, 168, 236, 0.6);
    outline: none;
}

.wavelength-preset-custom input[type="number"]:disabled {
    background-color: #eee;
    color: #aaa;
    cursor: default;
}

/* ---- Curve section ---- */
.curve-section {
    margin-top: 28px;
}

.curve-section h2 {
    margin-bottom: 10px;
}

#curve-container {
    padding: 12px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
    position: relative;
}

#curve-image {
    max-width: 100%;
    height: auto;
}

#curve-image.loading {
    opacity: 0.4;
}

#curve-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    transform: translate(-50%, -50%);
}

#curve-container:has(#curve-image.loading) #curve-spinner {
    display: block;
}

#curve-image.hidden {
    display: none;
}

/* ---- Tooltips / info popups ---- */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    font-weight: bold;
    line-height: 20px;
    background-color: #999;
    color: #fff;
    border-radius: 50%;
    box-sizing: border-box;
    font-size: 14px;
    font-family: "Times New Roman", Times, serif;
    text-transform: none;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    background-color: rgba(51, 102, 204, 0.8);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: normal;
    text-align: left;
    line-height: 140%;
    border-radius: 6px;
    padding: 20px;
    width: 280px;
    position: absolute;
    z-index: 100;
    top: 120%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ---- Info & helper boxes ---- */
.helper {
    font-size: 13px;
    color: #888;
    display: block;
    background-color: rgba(51, 102, 204, 0.05);
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.helper-small {
    font-size: 12px;
    color: #888;
}

/* ---- Alert boxes ---- */
.red-box {
    background-color: #fbe0e8;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    color: #000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.blue-box {
    background-color: #ffba00;
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ---- Labels ---- */
.label-text {
    font-weight: bold;
    font-size: 13px;
    text-align: left;
    text-transform: uppercase;
    color: gray;
}

.label-headline {
    font-weight: bold;
    font-size: 14px;
    text-align: left;
    text-transform: uppercase;
    color: gray;
}

/* ---- Submit buttons ---- */
.submit-on,
.submit-off {
    border-radius: 2px;
    font-size: 12px;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    padding: 12px 46px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    border: none;
}

.submit-on {
    box-shadow: #B4B5B5 2px 2px 5px;
    text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
    background: #3093c7;
    background-image: linear-gradient(to bottom, #3093c7, #1c5a85);
}

.submit-on:hover,
.submit-on:active {
    background-color: #26759e;
    box-shadow: #B4B5B5 1px 1px 2px;
    background-image: linear-gradient(to bottom, #26759e, #133d5b);
    position: relative;
    top: 1px;
}

.submit-off {
    background: #ccc;
    background-image: linear-gradient(to bottom, #f2f2f2, #d9d9d9);
    color: #999;
    cursor: default;
}

/* ---- Two-column layout: wavelength + calc params ---- */
.settings-columns {
    display: flex;
    gap: 40px;
    margin-top: 24px;
}

.settings-columns .wavelength-section {
    flex: 1;
    margin-top: 0;
}

.calc-params-section {
    flex: 1;
}

.calc-params-section h2 {
    margin-bottom: 10px;
}

.calc-params-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 6px;
}

.calc-params-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-params-group-separator {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #ddd;
}

.calc-param {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    padding: 4px 0;
}

.calc-param input[type="radio"],
.calc-param input[type="checkbox"] {
    margin: 0 4px 0 0;
    cursor: pointer;
}

.calc-param-note {
    font-size: 12px;
    color: #888;
    margin-left: 26px;
    margin-bottom: 4px;
}

/* -- Tooltip anchor override for calc-params (keep within column) -- */
.calc-params-section .tooltip-text {
    left: auto;
    right: 0;
    margin-left: 0;
}

/* ---- Cemented-mode notice ---- */
.cemented-notice {
    background: #fff3cd;
    color: #856404;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 4px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s ease;
}

.cemented-notice.fade-out {
    opacity: 0;
}

.cemented-notice-btn {
    padding: 4px 16px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #856404;
    border-radius: 4px;
    background: #fff;
    color: #856404;
    white-space: nowrap;
    flex-shrink: 0;
}

.cemented-notice-btn:hover {
    background: #856404;
    color: #fff;
}

/* ---- Responsive adjustments ---- */
@media (max-width: 800px) {
    .settings-columns {
        flex-direction: column;
        gap: 24px;
    }

    .calc-params-section .tooltip-text {
        left: 50%;
        right: auto;
        margin-left: -140px;
    }
}

@media (max-width: 600px) {
    .filter-row {
        flex-wrap: wrap;
    }

    .filter-row select {
        flex: 1 1 100%;
    }

    .filter-row .filter-thickness {
        width: 60px;
    }

    .wavelength-row {
        gap: 6px;
    }

    .wavelength-row input[type="number"] {
        width: 70px;
    }
}
