/* CBA Cost Benefit Calculator v2 Styles */

.cba-calculator-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: #374151;
    line-height: 1.5;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 16px; /* Base font size */
}

.cba-calculator-container * {
    box-sizing: border-box;
}

/* Headers */
.cba-calculator-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cba-calculator-header h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.cba-calculator-header p {
    font-size: 1.125rem;
    color: #6b7280;
}

.cba-subtitle {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

/* Calculation Areas Selection */
.cba-calculation-areas {
    background-color: #f9fafb;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    margin-top: 3rem;
}

.cba-calculation-areas h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.cba-area-selector {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.cba-area-selector:hover {
    border-color: #2563eb;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.cba-area-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.cba-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    cursor: pointer;
    flex-shrink: 0;
}

.cba-area-label {
    flex: 1;
    cursor: pointer;
}

.cba-area-title {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.cba-area-question {
    display: block;
    font-size: 0.9375rem; /* 15px instead of 14px */
    color: #4b5563;
    line-height: 1.5;
}

.cba-sub-questions {
    margin-top: 0.5rem;
    margin-left: 1rem;
    font-size: 0.9375rem; /* 15px instead of 14px */
    color: #4b5563;
}

.cba-sub-questions li {
    margin-bottom: 0.25rem;
}

/* Input Sections */
.cba-input-sections {
    margin-bottom: 2rem;
    overflow: visible; /* Allow tooltips to show */
}

.cba-input-sections h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

/* Collapsible Sections */
.cba-worksheet-section {
    margin-bottom: 1rem;
}

.cba-collapsible-section {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: visible; /* Changed from hidden to allow tooltips */
}

.cba-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    cursor: pointer;
    background-color: #f9fafb;
    transition: background-color 0.2s ease;
}

.cba-section-title {
    flex-grow: 1;
}

.cba-section-header:hover {
    background-color: #f3f4f6;
}

.cba-section-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.cba-section-subheading {
    font-size: 0.875rem;
    color: #2B6CB0;
    margin: 0.25rem 0 0 0;
    font-style: italic;
}

.cba-section-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cba-savings-preview {
    font-size: 0.9375rem; /* 15px instead of 14px */
    color: #059669;
    font-weight: 500;
}

.cba-toggle-icon {
    font-size: 1.5rem;
    color: #6b7280;
    font-weight: 300;
    width: 1.5rem;
    text-align: center;
}

.cba-section-content {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    overflow: visible; /* Allow tooltips to show */
}

/* Sliders */
.cba-slider-group {
    margin-bottom: 1.5rem;
}

.cba-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative; /* Ensure tooltips position correctly */
}

.cba-slider-header label {
    font-size: 0.9375rem; /* 15px instead of 14px */
    font-weight: 500;
    color: #374151;
    flex: 1;
}

.cba-slider-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative; /* For tooltip positioning */
}

.cba-input-small {
    width: 120px; /* Slightly wider for larger numbers with commas */
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem; /* 16px - larger than before */
    text-align: right;
}

.cba-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
}

.cba-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cba-slider::-webkit-slider-thumb:hover {
    background: #1d4ed8;
}

.cba-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cba-slider::-moz-range-thumb:hover {
    background: #1d4ed8;
}

/* Worksheet Results */
.cba-worksheet-results {
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.cba-result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9375rem; /* 15px instead of 14px */
}

.cba-result-row span:first-child {
    color: #6b7280;
}

.cba-result-row span:last-child {
    font-weight: 500;
    color: #374151;
}

.cba-result-highlight {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
}

.cba-result-highlight span:first-child {
    font-weight: 600;
    color: #111827;
}

.cba-result-highlight span:last-child {
    font-weight: 700;
    color: #059669;
    font-size: 1rem;
}

/* Results Box */
.cba-results-box {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

/* Early results display (above customize inputs) */
.cba-early-results {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.cba-results-advanced {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.cba-results-content {
    width: 100%;
}

.cba-result-label {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.cba-result-amount {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cba-result-breakdown {
    font-size: 0.9375rem; /* 15px instead of 14px */
    opacity: 0.8;
}

.cba-result-breakdown p {
    margin: 0.25rem 0;
}

/* Buttons */
.cba-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: white;
    color: #2563eb;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cba-button:hover {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

.cba-button-primary {
    background-color: #2563eb;
    color: white;
}

.cba-button-primary:hover {
    background-color: #1d4ed8;
}

/* Export buttons container */
.cba-export-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem auto 0;
    width: auto;
}

.cba-export-buttons .cba-button {
    width: auto;
    min-width: fit-content;
}

/* No Selection Message */
.cba-no-selection {
    background-color: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 3rem;
    text-align: center;
    color: #6b7280;
}

/* Contact Form */
.cba-contact-form {
    background-color: #f9fafb;
    border-radius: 1rem;
    padding: 2rem;
    margin-top: 3rem;
}

.cba-contact-form h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.cba-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.cba-form-group {
    margin-bottom: 1rem;
}

.cba-form-group label {
    display: block;
    font-size: 0.9375rem; /* 15px instead of 14px */
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.cba-input,
.cba-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.cba-input:focus,
.cba-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.cba-textarea {
    resize: vertical;
}

/* Radio Button Groups */
.cba-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cba-radio-label {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid #d1d5db;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.cba-radio-label:hover {
    border-color: #2563eb;
    background-color: #f0f9ff;
}

.cba-radio-label input[type="radio"] {
    margin-right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: #2563eb;
    outline: none;
}

.cba-radio-label input[type="radio"]:focus {
    outline: none;
}

.cba-radio-label input[type="radio"]:checked ~ span {
    color: #2563eb;
    font-weight: 600;
}

.cba-radio-label span {
    font-size: 0.9375rem;
    color: #374151;
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .cba-radio-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .cba-radio-label {
        flex: 1;
        min-width: 150px;
    }
}

/* Giant Slider Section */
.cba-hero-section {
    background: linear-gradient(to bottom, #dbeafe, #ffffff);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.cba-hero-content {
    text-align: center;
    margin-bottom: 2rem;
}

.cba-hero-content h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .cba-hero-content h1 {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .cba-hero-content h1 {
        font-size: 3.75rem;
    }
}

.cba-hero-content p {
    font-size: 1.125rem;
    color: #6b7280;
    max-width: 48rem;
    margin: 0 auto;
}

.cba-hero-content .cba-savings-highlight {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.875rem;
    margin: 0 0.5rem;
}

/* Giant Slider Container */
.cba-giant-slider-container {
    max-width: 56rem;
    margin: 0 auto;
}

.cba-giant-slider-card {
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 2rem;
}

.cba-giant-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.cba-giant-slider-label {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
}

.cba-giant-slider-input {
    width: 8rem;
    padding: 0.5rem 0.75rem;
    text-align: right;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

.cba-giant-slider-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Giant Slider Track */
.cba-giant-slider-track {
    position: relative;
    height: 6rem;
    margin-bottom: 2rem;
}

.cba-giant-slider-gradient {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.cba-giant-slider-gradient-bar {
    width: 100%;
    height: 4rem;
    background: linear-gradient(to right, #dbeafe, #2563eb);
    border-radius: 0.5rem;
}

.cba-giant-slider-input-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* Giant Slider Thumb */
.cba-giant-slider-thumb {
    position: absolute;
    height: 100%;
    pointer-events: none;
    transform: translateX(-50%);
    transition: left 0.1s ease-out;
}

.cba-giant-slider-thumb-outer {
    width: 1rem;
    height: 6rem;
    background-color: #2563eb;
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cba-giant-slider-thumb-inner {
    width: 0.5rem;
    height: 4rem;
    background-color: white;
    border-radius: 9999px;
}

/* Giant Slider Scale */
.cba-giant-slider-scale {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    font-size: 0.9375rem; /* 15px instead of 14px */
    color: #6b7280;
}

/* Giant Slider Results */
.cba-giant-slider-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: #dbeafe;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-top: 2rem;
}

.cba-giant-slider-icon {
    width: 3rem;
    height: 3rem;
    color: #10b981;
}

.cba-giant-slider-amount {
    font-size: 0.9375rem; /* 15px instead of 14px */
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.cba-giant-slider-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #111827;
}

/* Employee Count Medium Slider */
.cba-employee-slider-section {
    max-width: 56rem;
    margin: 2rem auto 0;
}

.cba-employee-slider-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.cba-employee-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.cba-employee-slider-label {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
}

.cba-employee-slider-input {
    width: 6rem;
    padding: 0.375rem 0.5rem;
    text-align: right;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.9375rem;
}

.cba-employee-slider-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Employee Slider Track - 30% height of giant slider */
.cba-employee-slider-track {
    position: relative;
    height: 1.8rem; /* 30% of 6rem */
    margin-bottom: 0.75rem;
}

.cba-employee-slider-gradient {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.cba-employee-slider-gradient-bar {
    width: 100%;
    height: 1.2rem; /* 30% of 4rem */
    background: linear-gradient(to right, #e0e7ff, #6366f1);
    border-radius: 0.25rem;
}

.cba-employee-slider-input-hidden {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

/* Employee Slider Thumb */
.cba-employee-slider-thumb {
    position: absolute;
    height: 100%;
    pointer-events: none;
    transform: translateX(-50%);
    transition: left 0.1s ease-out;
}

.cba-employee-slider-thumb-outer {
    width: 0.75rem;
    height: 1.8rem; /* Match track height */
    background-color: #6366f1;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cba-employee-slider-thumb-inner {
    width: 0.375rem;
    height: 1.2rem; /* 30% of 4rem */
    background-color: white;
    border-radius: 9999px;
}

/* Employee Slider Scale */
.cba-employee-slider-scale {
    position: absolute;
    bottom: -1.25rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cba-calculator-header h2 {
        font-size: 1.875rem;
    }
    
    .cba-result-amount {
        font-size: 2.25rem;
    }
    
    .cba-results-advanced {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cba-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cba-section-summary {
        width: 100%;
        justify-content: space-between;
    }
}

/* Sticky Savings Display */
.cba-sticky-savings {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1e40af;
    color: white;
    padding: 1rem;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

.cba-sticky-savings-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.cba-sticky-label {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

.cba-sticky-amount {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .cba-sticky-savings-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .cba-sticky-label {
        font-size: 0.875rem;
    }
    
    .cba-sticky-amount {
        font-size: 1.25rem;
    }
}

/* ENCV Value Display Styles */
.cba-slider-values-row {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cba-value-label {
    font-weight: 600;
    color: #555;
    margin-right: 5px;
    min-width: 50px;
    display: inline-block;
}

.cba-encv-value {
    opacity: 0.9;
}

.cba-encv-input {
    background-color: #f5f5f5 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    border: 1px solid #ddd !important;
}

.cba-encv-input:disabled {
    opacity: 0.8;
}

/* Tooltip styles for ENCV values */
.input-with-tooltip {
    position: relative;
    display: inline-block;
    width: 100%;
}

.encv-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #1e40af;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    z-index: 10;
    font-weight: 500;
}

/* Desktop: tooltip on the right */
@media (min-width: 641px) {
    .encv-tooltip {
        left: calc(100% + 12px);
    }
    
    .encv-tooltip::before {
        content: '';
        position: absolute;
        top: 50%;
        right: 100%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-right-color: #1e40af;
    }
    
    /* Add margin to prevent edge clipping */
    .cba-slider-group:last-child {
        margin-right: 120px; /* Space for tooltip */
    }
}

/* Mobile: tooltip on the left */
@media (max-width: 640px) {
    .encv-tooltip {
        right: calc(100% + 12px);
    }
    
    .encv-tooltip::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 100%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-left-color: #1e40af;
    }
}

/* Show tooltip on hover or focus */
.input-with-tooltip:hover .encv-tooltip,
.input-with-tooltip input:focus + .encv-tooltip {
    opacity: 1;
}

/* Ensure tooltip text is readable */
.encv-tooltip-value {
    font-weight: 600;
    color: #10b981;
}

/* Documentation Styles */
.cba-documentation-simple {
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.5;
    color: #4a5568;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cba-area-documentation {
    background-color: #f7fafc;
    border-left: 4px solid #4299e1;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 0.9em;
    line-height: 1.5;
    color: #2d3748;
}

.cba-area-documentation h4 {
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2b6cb0;
}

.cba-area-documentation ul {
    margin: 8px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.cba-area-documentation li {
    margin: 4px 0;
}

/* Full documentation styles */
.cba-full-documentation {
    margin-top: 16px;
    font-size: 0.85em;
    max-height: 400px;
    overflow-y: auto;
}

.cba-full-documentation ul {
    list-style-type: disc;
    margin: 8px 0;
    padding-left: 24px;
}

.cba-full-documentation li {
    margin: 6px 0;
    line-height: 1.4;
}

.cba-full-documentation h4 {
    color: #2b6cb0;
    margin-bottom: 12px;
}

/* Toggle buttons styles */
.cba-areas-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.cba-toggle-buttons {
    display: flex;
    gap: 10px;
}

.cba-toggle-btn {
    background-color: #4299e1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cba-toggle-btn:hover {
    background-color: #3182ce;
}