/* ============================================================
   Optical Density / Transmission Converter – UI styling
   Matches the look of the SCHOTT filter calculator (filtercalc.css)
   ============================================================ */

/* Bordered frame around the input form */
.od-form-box {
    max-width: 640px;
    padding: 20px 24px;
    margin: 24px 0 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.od-converter {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin: 0;
}

.od-column {
    flex: 1;
    min-width: 0;
}

.od-label {
    display: block;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
    color: gray;
    margin-bottom: 8px;
}

.od-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.od-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 8px 12px;
    box-sizing: border-box;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: normal;
    color: #333;
    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;
}

.od-input::-webkit-inner-spin-button,
.od-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.od-input: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;
}

/* Brief yellow flash on the receiving field after live conversion */
.od-input.flash {
    animation: od-flash 600ms ease-out;
}

@keyframes od-flash {
    0%   { background-color: #ffffcc; }
    100% { background-color: #fafafa; }
}

.od-unit {
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

.od-arrow {
    font-size: 26px;
    line-height: 1;
    color: #3093c7;
    padding-bottom: 6px;
    user-select: none;
}

/* Inline error message — styled like .red-box in filtercalc.css */
.od-error {
    background-color: #fbe0e8;
    padding: 10px 12px;
    margin: 10px 0;
    border-radius: 5px;
    color: #000;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.od-hidden {
    display: none;
}

/* ---- Reference table (collapsible) ---- */
.od-reference {
    margin: 16px 0 8px;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
}

.od-reference > summary,
.od-explanation > summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #3366cc;
    padding: 6px 0;
    list-style: none;
    user-select: none;
}

.od-reference > summary::-webkit-details-marker,
.od-explanation > summary::-webkit-details-marker {
    display: none;
}

.od-reference > summary::before,
.od-explanation > summary::before {
    content: "▸ ";
    display: inline-block;
    transition: transform 0.15s linear;
}

.od-reference[open] > summary::before,
.od-explanation[open] > summary::before {
    content: "▾ ";
}

.od-reference-table {
    width: 100%;
    max-width: 420px;
    margin: 10px 0;
    border-collapse: collapse;
    font-size: 13px;
}

.od-reference-table th,
.od-reference-table td {
    padding: 6px 12px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.od-reference-table th {
    background: #fafafa;
    color: #555;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 12px;
    border-bottom: 1px solid #ccc;
}

.od-reference-table tbody tr {
    cursor: pointer;
    transition: background 0.1s linear;
}

.od-reference-table tbody tr:hover {
    background: #ffffcc;
}

/* ---- Formula explanation (collapsible) ---- */
.od-explanation {
    margin: 16px 0 8px;
    max-width: 640px;
    font-family: 'Open Sans', Verdana, Arial, Helvetica, sans-serif;
}

.od-explanation-content {
    padding: 14px 18px;
    margin-top: 6px;
    background: #fafafa;
    border-left: 3px solid #3366cc;
    border-radius: 0 3px 3px 0;
}

.od-explanation-content p {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
    margin: 0 0 12px;
}

.od-explanation-content p:last-child {
    margin-bottom: 0;
}

.od-formula {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    color: #1c5a85;
    background: #fff;
    padding: 10px 16px;
    margin: 8px 0 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

.od-formula sub,
.od-formula sup,
.od-explanation-content sub,
.od-explanation-content sup {
    font-size: 0.75em;
}

/* Stack inputs vertically on narrow screens */
@media (max-width: 600px) {
    .od-converter {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .od-arrow {
        transform: rotate(90deg);
        text-align: center;
        padding-bottom: 0;
    }
}
