/* =====================================================================
   Custom Calculator Styles
   ===================================================================== */

.custom-calculator {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out;
}

.custom-calculator:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Calculator Header (uses data attribute) */
.custom-calculator h3 {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

/* Inputs Section */
.calc-inputs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Outputs Section */
.calc-outputs {
    background: #f8fafc;
    border-radius: 8px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    border: 1px solid #e2e8f0;
}

.calc-field,
.calc-result {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Labels */
.calc-field label,
.calc-result label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    margin: 0;
}

/* Shared group styling */
.input-group,
.output-group {
    display: flex;
    align-items: center;
    position: relative;
}

/* Inputs */
.input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px !important;
    font-size: 1rem;
    color: #1f2937;
    transition: all 0.2s ease-in-out;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Extra padding on the end so input text doesn't hide behind unit */
    padding-inline-start: 45px;
}

.input-group input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Units floating inside the input */
.input-group .unit {
    position: absolute;
    inset-inline-end: 14px;
    /* Automatically handles RTL and LTR */
    font-size: 0.875rem;
    color: #9ca3af;
    pointer-events: none;
    font-weight: 600;
}

/* Individual Result Box */
.calc-result {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.output-group {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #000000;
    /* A nice vibrant blue */
    line-height: 1;
}

.output-group .unit {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
}

/* Responsive tweaks for mobile */
@media (max-width: 500px) {
    /* .calc-inputs {
        grid-template-columns: 1fr;
    } */

    .calc-outputs {
        /* grid-template-columns: 1fr; */
        padding: 16px;
    }
}