/* Custom Styles for NH Tax Calculator */

/* Radio button styling */
.radio-input {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid #2E6F62;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.radio-input:checked::after {
    content: '';
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #2E6F62;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-input:focus {
    outline: 2px solid #2F5D50;
    outline-offset: 2px;
}

/* Interactive slider styling */
.interactive-slider {
    position: relative;
    height: 44px;
    touch-action: none;
}

.slider-track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    background-color: #D6D9D6;
    border-radius: 9999px;
    transform: translateY(-50%);
}

.slider-fill {
    position: absolute;
    left: 0;
    top: 50%;
    height: 4px;
    background-color: #2F5D50;
    border-radius: 9999px;
    transform: translateY(-50%);
    transition: width 0.1s ease;
}

.slider-thumb {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background-color: #2F5D50;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: left 0.1s ease;
}

.slider-thumb:active {
    cursor: grabbing;
}

/* Toggle switch styling */
.toggle-switch {
    position: relative;
    display: inline-flex;
    height: 2rem;
    width: 52px;
    align-items: center;
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.toggle-knob {
    display: inline-block;
    height: 1.5rem;
    width: 1.5rem;
    border-radius: 9999px;
    background-color: #fafaf8;
    transition: transform 0.2s;
}

/* Number badges */
.number-badge {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Remove default grid styling from D3 */
.grid .domain {
    display: none;
}

/* Ensure tooltips are on top */
.chart-tooltip,
.line-chart-tooltip {
    z-index: 9999 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .space-y-8 > * {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Custom scrollbar for dropdown */
#city-dropdown::-webkit-scrollbar {
    width: 8px;
}

#city-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#city-dropdown::-webkit-scrollbar-thumb {
    background: #D6D9D6;
    border-radius: 4px;
}

#city-dropdown::-webkit-scrollbar-thumb:hover {
    background: #2F5D50;
}

/* Calculator layout transitions */
.calculator-left {
    transition: transform 1s ease;
    will-change: transform;
}

.calculator-left.no-transition {
    transition: none;
}

.calculator-right.is-hidden {
    display: none;
}

/* Font and base styles */
* {
    font-family: 'Source Sans 3', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Line height utilities */
.lh-tight { line-height: 1.2; }
.lh-relaxed { line-height: 1.5; }
.lh-24 { line-height: 24px; }
.lh-25 { line-height: 25.5px; }
.lh-27 { line-height: 27px; }
.lh-30 { line-height: 30px; }
.lh-36 { line-height: 36px; }

/* Heading styles with letter-spacing */
.heading-h1 { letter-spacing: -0.96px; line-height: 1.2; }
.heading-h2 { letter-spacing: -0.72px; line-height: 1.2; }
.heading-h3 { letter-spacing: -0.48px; line-height: 1.2; }
.heading-subtext { letter-spacing: -0.72px; line-height: 1.2; }

/* Hyperlink styles */
a {
    color: #C9A24D !important;
    font-weight: bold;
    text-decoration: underline;
}

/* Navigation link styles - override default link colors */
.nav-link {
    color: #2F2F2F !important;
    font-weight: normal;
    text-decoration: none;
}

/* Ensure SVG strokes in nav links are grey */
.nav-link svg {
    stroke: #5F6F7A !important;
}

/* Default paragraph styles */
p {
    color: #2F2F2F;
    font-size: 17px;
    max-width: 750px;
}

/* List styles */
ul {
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 2.5rem;
    margin: 0.5rem 0;
}

ul li {
    color: #2F2F2F;
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Plan bullets specific styling */
ul.plan-bullets {
    list-style-type: disc !important;
    list-style-position: outside;
    margin: 1.5rem 0 0 0;
    padding-left: 2.5rem;
    display: block;
}

ul.plan-bullets li {
    display: list-item;
    font-size: 20px;
    line-height: 30px;
    margin-bottom: 0.75rem;
}

#comparison-summary p {
    color: #2F5D50;
    font-size: 30px;
    line-height: 30px;
}

/* Force footer to be full width at bottom */
footer.site-footer {
    display: block !important;
    width: 100vw !important;
    max-width: none !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-radius: 0 !important;
    position: relative !important;
    box-sizing: border-box !important;
}

/* Ensure body has no bottom margin/padding */
body {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Responsive layout updates */
#calculator > div {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

#calculator-columns {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#calculator-left,
#calculator-right {
    width: 100%;
    max-width: 100%;
}

#calculator-left {
    transform: none;
}

#city-dropdown {
    width: 100% !important;
    max-width: 100% !important;
}

@media (min-width: 768px) {
    #calculator-columns {
        flex-direction: row;
        align-items: flex-start;
    }

    #calculator-left {
        width: 466.359px;
        flex-shrink: 0;
    }

    #calculator-right {
        width: 559.641px;
        flex: 1 1 auto;
    }
}

@media (max-width: 767px) {
    header > div {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    #text-section-container [class*="px-[140px]"],
    #take-action [class*="px-[140px]"] {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    #why-this-works div[class*="lg:ml-"],
    #why-this-works p[class*="md:ml-"],
    #why-this-works p[class*="lg:ml-"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    #text-section-container [class*="px-[140px]"],
    #take-action [class*="px-[140px]"] {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }

    #why-this-works div[class*="lg:ml-"] {
        margin-left: 2rem !important;
        margin-right: 0 !important;
    }

    #why-this-works p[class*="md:ml-"],
    #why-this-works p[class*="lg:ml-"] {
        margin-left: 1.5rem !important;
    }
}
