/* Main wrapper */
.adp-calculator-wrapper {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: 100%;
    max-width: 1000px;
    /* Constrain width for better look */
    background: transparent;
    padding: 0;
    margin: 0 auto;
}

/* Two-column layout */
.adp-calculator {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: stretch;
}

/* Columns */
.adp-calculator-left,
.adp-calculator-right {
    flex: 1 1 300px;
    /* Flex-basis 300px, grow and shrink */
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.adp-calculator-right {
    gap: 20px;
    justify-content: space-between;
}

/* Section Titles / Questions */
/* Section Titles / Questions */
.adp-section-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 30px;
    color: #111827;
}

.adp-question {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Force single line on desktop for questions and ensure layout stays 2-column */
@media (min-width: 981px) {
    .adp-calculator {
        flex-wrap: nowrap;
        /* Prevent wrapping columns */
    }

    .adp-calculator-left,
    .adp-calculator-right {
        flex: 1;
        /* evenly distribute space */
        min-width: 0;
        /* Allow shrinking below content size to prevent blowout */
    }

    .adp-question {
        white-space: nowrap;
        /* Optional: ellipsis if it really doesn't fit */
        /* overflow: hidden; text-overflow: ellipsis; */
    }
}

/* Toggle Buttons */
.adp-toggle-group {
    margin-bottom: 30px;
}

.adp-toggle-buttons {
    display: flex;
    gap: 15px;
}

.adp-toggle-button {
    flex: 0 0 auto;
    min-width: 80px;
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

.adp-toggle-button--active {
    background: #3b82f6;
    /* Blue 500 */
    color: #fff;
    border-color: #3b82f6;
}

/* Input Rows (Slider + Number Input) */
.adp-input-group,
.adp-average-time-group {
    margin-bottom: 30px;
}

/* Interaction Container (The "Card") */
.adp-interaction-container {
    display: grid;
    grid-template-areas:
        "slider input"
        "labels .";
    grid-template-columns: 1fr auto;
    /* Slider takes remaining space, input takes content */
    align-items: center;
    /* Vertically align centers of row 1 items */
    gap: 0 20px;
    /* Gap between columns */
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 10px;
}

/* Assign Grid Areas */
.adp-slider {
    grid-area: slider;
    width: 100%;
    margin: 0;
    align-self: center;

    /* Reset Appearance */
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    /* Track will handle background */
    cursor: pointer;
}

/* WebKit Track (Chrome, Safari, Edge) */
.adp-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
}

/* WebKit Thumb */
.adp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

    /* Vertical Centering: (TrackHeight 6px - ThumbHeight 20px) / 2 = -7px */
    margin-top: -7px;
}

/* Firefox Track */
.adp-slider::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
}

/* Firefox Thumb */
.adp-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* Firefox centers thumb automatically on the track */
    border: none;
    /* Reset distinct border if needed */
}

.adp-min-max-labels {
    grid-area: labels;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 8px;
    align-self: start;
}

/* Time Input Wrapper (Blue Box) */
.adp-average-time-input-wrapper {
    grid-area: input;
    align-self: center;
    /* Ensure it centers in its own grid cell */
    display: flex;
    align-items: center;
    border: 1px solid #3b82f6;
    /* Blue border */
    border-radius: 6px;
    padding: 5px 10px;
    background: #fff;
}

/* Number Input (Left of Wrapper) */
.adp-average-time-input {
    width: 40px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: right;
    /* Or center? Reference looks centered-ish */
    outline: none;
    padding-right: 5px;
    -moz-appearance: textfield;
}

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

/* Unit Text (Right of Wrapper) */
.adp-average-time-unit {
    font-size: 14px;
    color: #374151;
    padding-left: 8px;
    border-left: 1px solid #e5e7eb;
    /* Divider */
    margin-left: 5px;
    line-height: 1.2;
}

/* Standard Number Input Wrapper (for Demands) */
.adp-number-input-wrapper {
    grid-area: input;
    align-self: center;
    /* Ensure it centers in its own grid cell */
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #3b82f6;
    /* Blue border matches time input */
    border-radius: 6px;
    padding: 5px 5px;
    background: #fff;
    width: 70px;
    /* Fixed width */
}

.adp-number-input {
    width: 100%;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.adp-number-input::-webkit-outer-spin-button,
.adp-number-input::-webkit-inner-spin-button {
    /* Keep spinners for the standard number input if desired, or hide them. Reference shows spinners for "20" */
    opacity: 1;
}

/* Tooltip Styling */
.adp-tooltip-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.adp-tooltip-icon:hover {
    background: #3b82f6;
    color: #fff;
}

.adp-tooltip-popup {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: #1f2937;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s, visibility 0.2s;
    text-align: left;
    white-space: normal;
}

.adp-tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.adp-tooltip-icon:hover .adp-tooltip-popup {
    visibility: visible;
    opacity: 1;
}

.adp-tooltip-popup ul {
    margin: 5px 0 0 15px;
    padding: 0;
    list-style-type: disc;
}

.adp-tooltip-popup li {
    margin-bottom: 2px;
}

/* Right Column - Results */
.adp-result-header {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0;
    color: #111827;
    text-align: center;
}

/* Main Result Box (Blue) */
.adp-main-result-box {
    background: #3b82f6;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    margin-bottom: 0;
    color: #fff;
}

.adp-main-result-value {
    flex: 0 0 40%;
    background: #2563eb;
    /* Slightly darker blue */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    padding: 20px;
}

.adp-main-result-label {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 20px;
    font-size: 16px;
    line-height: 1.3;
}

/* Secondary Results (Side by Side) */
.adp-secondary-results {
    display: flex;
    gap: 15px;
    margin-bottom: 0;
}

.adp-secondary-card {
    flex: 1;
    background: #f3f4f6;
    /* Light gray */
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
}

.adp-secondary-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 5px;
    white-space: nowrap;
    /* Prevent breaking */
}

.adp-secondary-label {
    font-size: 14px;
    color: #6b7280;
}

/* CTA Section */
.adp-cta-section {
    margin-top: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.adp-cta-button {
    display: block;
    width: 100%;
    background: #3b82f6;
    color: #fff;
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s;
    border: none;
    cursor: pointer;
}

.adp-cta-button:hover {
    background: #2563eb;
}

.adp-cta-main-text {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.adp-cta-sub-text {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

.adp-download-link {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    background: #fff;
    box-sizing: border-box;
    transition: background 0.2s;
}

.adp-download-link:hover {
    background: #eff6ff;
}

.adp-reset-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 10px;
    display: inline-block;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.adp-reset-link:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .adp-calculator {
        flex-direction: column;
    }

    .adp-calculator-left,
    .adp-calculator-right {
        flex: 1 1 auto;
        padding: 20px;
        /* Reduce padding on mobile */
    }

    /* Allow wrapping on mobile for secondary values */
    .adp-secondary-value {
        white-space: normal;
        font-size: 20px;
        /* Slightly smaller font to fit */
    }

    /* Ensure tooltip doesn't cause overflow on mobile */
    .adp-tooltip-popup {
        width: 240px;
        left: auto;
        right: -10px;
        /* Align right edge slightly past icon */
        transform: none;
        /* Remove centering transform */
        white-space: normal;
    }

    .adp-tooltip-popup::after {
        left: auto;
        right: 15px;
        /* Align arrow to point to icon */
        margin-left: 0;
    }
}