/* Styling for Kørselsfradrag Beregner Værktøj */
body{
}

.background{
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(100% 100% at 50% 100%, var(--bg-dark), var(--bg-dark2));
    z-index: -1;
}

.background .image{
    opacity: .5;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 256px;
    
    background-image: url("/img/tools/nature_bg.svg");
    background-repeat: repeat;
    background-size: auto 100%;
    background-position-x: center;
}

.koerselsfradrag .background .image{
    background-image: url("/img/tools/car_bg.svg");
}

.header.scrolled{
    position: sticky ;
    gap: 16px; 
    border: 2px solid var(--card-border50);
    background: var(--card-bg-top50); 
    box-shadow: inset 0 0 40px var(--card-bg-top), var(--shadow-low);
    min-width: calc(100% - 3rem);
}

.header .header-link{
    text-decoration: none; 
    text-align: center;
    font-size: 16px;
    font-family: 'Roboto Flex', sans-serif;
    font-weight: 400;
    color: var(--text-dark);
}

.header .logo-link .logo{
    height: 32px;
    margin: 16px 8px;
}

.desktop-only-nav
{
    width: fit-content;
}

.header .navigation:not(.desktop-only-nav)
{
    flex: unset;
    width: fit-content;
}

button.burger-menu-button{
    order: 0;
    display: flex;
}
    .mobile-top-actions{
        display: none !important;
    }

.header .actions{
    flex: 2 !important;
}

.mobile-nav-menu label {
    width: 90%;
    margin-top: 8px;
}

.dark-mode-text{
    display: unset;
}
.light-mode-text{
    display: none;
}

[data-theme='dark'] .dark-mode-text{
    display: none !important;
}
[data-theme='dark'] .light-mode-text{
    display: unset !important;
}

.mobile-nav-menu a:not(.default) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 90%;
    position: relative;
    margin: 2px 0;
    font-family: 'Roboto flex', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    border-radius: 12px;
    padding: 9px 16px;
}

.mobile-nav-menu a:not(.default) span{
    --size: 1.5rem;
    height: var(--size);
    min-height: var(--size);
    max-height: var(--size);
    width: var(--size);
    min-width: var(--size);
    max-width: var(--size);
    border-radius: 4px;
    background: var(--bg-dark);
    color: var(--primary);
    font-size: calc(var(--size) * 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -0.45rem;
}

.mobile-nav-menu a:not(.default).free::after{
    content: "Gratis";
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 12px;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 8px;
    color: var(--text-light);
    pointer-events: none;
}

.mobile-nav-menu a.login{
    border-bottom: var(--b) solid var(--bg-dark2);
    --el-gradient-color-1: var(--card-bg-top);
    --el-gradient-color-2: var(--bg-darker);
    color: var(--text-dark-accent);
    box-shadow: inset 0 0 16px -4px var(--card-bg-top);
}

.mobile-nav-menu a.login:hover,
.mobile-nav-menu a.login:focus{
    color: var(--primary);
}

.mobile-nav-menu .actions {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    margin: 12px 0 4px;
}
.mobile-nav-menu .actions a{
    margin: 0;
}

.mobile-nav-menu .sep {
    height: 1px;
    background: var(--bg-dark);
    width: 80%;
    margin: 8px 0;
}

#dynamic-tool-links  {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

#dynamic-tool-links label {
    margin-left: 16px;
}

/* Main layout and hero section */
.tool-main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    padding-top: 32px; /* Space below sticky header */ 
}

.tool-hero {
    text-align: center;
    max-width: var(--context-width);
    width: calc(100% - 32px);
}

.tool-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
    margin-bottom: 16px;
    max-width: 70rem;
    color: var(--text-dark-accent);
}

.tool-hero .subtitle {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-dark);
    max-width: 700px;
    margin: 0 auto;
}

/* The Calculator Card */
.calculator-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.calculator-card {
    width: 100%;
    max-width: min(750px, calc(100% - 64px));
    background: var(--card-bg-top);
    padding: 32px;
    border-radius: 40px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-large);
}

.calculator-card form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark-accent);
}

.input-group input {
    font-family: 'Roboto Flex', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary20);
}

.calculator-card .row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

.calculator-card .row .input-group {
    flex: 1;
}

.calculator-card button#calculateButton {
    margin-top: 1rem;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    align-self: center;
}

.error-message {
    color: var(--warning);
    font-weight: 500;
    text-align: center;
    min-height: 1.2em;
}

/* Results Area */
.results-container {
    margin-top: 2rem;
    border-top: 1px solid var(--card-border);
    padding-top: 2rem;
}

.results-container h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.result-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg);
    border-radius: 1rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item .label {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark-mute);
}

.result-item .value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

.result-item.accent .value {
    color: var(--primary);
    font-size: 2.2rem;
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--text-dark-mute);
    text-align: center;
    margin-top: 1.5rem;
}

/* Yderkommune Notice Box */
.notice-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--primary10);
    border: 1px solid var(--primary40);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 2rem;
}

.notice-box .material-icons-round {
    color: var(--primary);
    font-size: 2rem;
}

.notice-box p {
    margin: 0;
    color: var(--text-dark);
}

/* Prose and FAQ section */
.prose-section {
    background: var(--card-bg-top);
    width: fit-content;
    margin:  0 auto;
    padding: 16px 64px 64px;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
    border-radius: 64px;
}

.prose-section article,
.prose-section aside {
    max-width: 800px;
    width: 100%;
}

.prose-section article h2, .faq-section h2 {
    margin-top: 2.5rem; 
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    font-weight: 900; 
    font-size: 36px;
    color: var(--text-dark-accent);
}

.prose-section p, .prose-section li {
    line-height: 1.7;
    font-size: 1.1rem;
    color: var(--text-dark80);
}

.prose-section ul {
    list-style-type: '✓ ';
    padding-left: 1.5rem;
}

.prose-section li {
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.faq-section {
    margin-top: 3rem;
}

.faq-section details {
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
}
.faq-section details:last-of-type {
    border-bottom: none;
}

.faq-section summary {
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    position: relative;
    padding-right: 2rem;
}

.faq-section summary::after {
    content: '+';
    font-family: 'Montserrat', sans-serif;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    font-size: 1.5rem;
    color: var(--primary);
}

.faq-section details[open] summary::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq-section details p {
    margin-top: 1rem;
    padding-left: 0.5rem;
}

/* CTA section */
.cta-section {
    width: 100%;
    background: var(--primary-gradient-color);
    padding: 4rem 1rem;
    margin-top: 2rem;
}

.cta-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.cta-content h2, .cta-content p {
    color: var(--text-light);
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.cta-content p {
    font-size: 1.1rem;
    max-width: 600px;
}

.cta-content .primary-link {
    background: var(--default);
    color: var(--primary);
    border-bottom: 3px solid #d0e3ff;
}

[data-theme='dark'] .cta-content .primary-link {
    background: var(--card-bg-dark);
    color: var(--text-light-accent);
}

.callback{
    --m: 1rem;
    --p: 2rem;
    width: calc(100% - (2 * var(--m)) - (2 * var(--p)));
    padding: var(--p);
    margin: var(--m) 0;
    max-width: 864px;
    
    border-radius: 64px;
    height: fit-content;
    background: var(--primary);
    background-image: radial-gradient(85% 100% at 50% 100%, var(--primary-light), transparent);
    box-shadow: inset 0 0 30vmin -0.5vmin var(--bg-dark);
    display: flex;
    flex-direction: row;
    gap: 32px;
}

.callback .content{
    flex: 1; 
    padding: 32px;
    padding-bottom: 0;
}
.callback .content h2{
    margin-top: 0;
    font-weight: 900;
    color: var(--text-light);
    font-size: 32px;
    line-height: 100%;
} 

.callback .content p{
    color: var(--text-light);
}

.callback .images{
    position: relative;
    width: 256px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.callback .images img{
    position: absolute;
    height: 140%;
    bottom: 0;
    transform: rotate(0deg) scale(1) translateX(0px);
    z-index: 1;
    filter: drop-shadow(rgba(0, 0, 0, 0.3) 0px 8px 10px);
}

.callback .images .app-roster{
    transform: rotate(-10deg) scale(0.8) translate(-99px, -25px);
    z-index: 0;
    filter: drop-shadow(rgba(0, 0, 0, 0.3) 0px 2px 5px);
}

.callback .cta{
    margin-left: auto;
    box-shadow: inset 0 0 2rem -4px var(--card-bg-top);
    backdrop-filter: blur(10px);
    opacity: 1;
    background: var(--card-bg50);
    padding: 12px 12px 4px;
    border-radius: 25px;
    border: .1rem solid var(--card-bg);
    width: fit-content;
    display: flex;
    flex-direction: column;
}

.callback .cta label{
    width: 100%;
    font-weight: 400;
    font-family: 'Roboto Flex', sans-serif;
    text-align: center;
    margin:  1px auto 0;
    font-size: 10px;
    color: var(--text-dark-mute);   
}

.footer-section{
    min-height: unset;
}

.footer .content img {
    height: 4rem;
}

@media (max-width: 800px) {
    .mobile-top-actions{
        display: flex !important;
    }
    button.burger-menu-button{
        order: 1;
    }
    .mobile-nav-menu{
        left: unset;
        right: 8px;
    }
}

@media (max-width: 900px) {
    .callback .images img{ 
        height: 130%; 
    } 
    .callback .images{
        min-width: 256px; 
    }
}

/* Add these new styles to your /css/tool.css file */

/* --- Mode Switcher --- */
.mode-switcher {
    display: flex;
    background-color: var(--bg);
    border-radius: 0.75rem;
    padding: 0.25rem;
    border: 1px solid var(--card-border);
    margin-bottom: 1rem;
}

.switch-label {
    flex: 1;
    position: relative;
    display: inline-block;
}

.switch-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-text {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark-mute);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.switch-label input[type="radio"]:checked + .mode-text {
    background-color: var(--card-bg-dark);
    color: var(--text-light-accent);
    box-shadow: 0 2px 10px -2px var(--shadow-color-15);
}
[data-theme='light'] .switch-label input[type="radio"]:checked + .mode-text {
     background-color: var(--default);
     color: var(--primary);
}


/* --- Input Field State Control --- */
.address-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.5s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
    overflow: hidden;
}

.distance-input {
    transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.5s ease;
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
}

/* Style for when distance mode is active */
.distance-mode .address-inputs {
    opacity: 0;
    max-height: 0;
    pointer-events: none;
    margin: -1.5rem 0; /* Collapse the margin */
}

.distance-mode .distance-input input {
    border-color: var(--primary);
}


/* Style for when address mode is active */
.address-mode .distance-input {
    opacity: 0.5;
    pointer-events: none;
}
.address-mode .distance-input input {
    background-color: var(--bg-mute);
}


/* --- Loader and Spinner --- */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
    border-radius: 0.5rem;
}

.loader span {
    font-weight: 500;
    color: var(--text-dark);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--primary20);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Make sure the calculate button is hidden when the loader is active */
#calculateButton[style*="display: none"] {
    display: none !important;
}

/* Ensure form layout remains consistent when button is hidden */
#deductionForm {
    position: relative;
}


/* --- Tooltips --- */
.tooltip-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    vertical-align: middle;
}
.tooltip-container .material-icons-round {
    font-size: 1.1rem;
    color: var(--text-dark-mute);
    cursor: help;
}
.tooltip-text {
    visibility: hidden;
    width: 220px;
    background-color: var(--card-bg-dark);
    color: var(--text-light);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 10;
    bottom: 150%;
    left: 50%;
    margin-left: -110px; /* Use half of the width to center */
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 400;
    font-size: 0.85rem;
    box-shadow: var(--shadow-medium);
}
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--card-bg-dark) transparent transparent transparent;
}
.tooltip-container:hover .tooltip-text,
.tooltip-container:focus-within .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* --- Advanced Day Calculator --- */
.advanced-day-calculator {
    margin-top: -1.2rem;
    margin-bottom: 0.5rem;
}
.advanced-day-calculator summary {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Hide default arrow */
    padding: 0 0 0.5rem;
    text-align: right;
    font-size: 0.9rem;
}
.advanced-day-calculator summary::-webkit-details-marker {
  display: none;
}
.advanced-day-calculator .details-content {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg);
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
}
.day-calc-result {
    font-weight: 600;
    color: var(--text-dark-accent);
    align-self: center;
}

/* --- Bridge Tolls --- */
.bridge-tolls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-mute);
    border-radius: 0.75rem;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}
.checkbox-label input[type="checkbox"] {
    width: 1.15em;
    height: 1.15em;
    accent-color: var(--primary);
}


/* --- Result Breakdown --- */
.result-breakdown {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}
.result-breakdown h4 {
    margin-bottom: 1rem;
    text-align: center;
}
.breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.9rem;
}
.breakdown-row .label {
    color: var(--text-dark-mute);
}
.breakdown-row .value {
    font-weight: 600;
    color: var(--text-dark);
}

/* --- Styling for Select Dropdowns --- */
.input-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'Roboto Flex', sans-serif;
    font-size: 1rem;
    padding: 0.8rem 1rem;
    padding-right: 2.5rem; /* Make space for the arrow */
    border-radius: 0.5rem;
    border: 1px solid var(--card-border);
    background-color: var(--bg);
    color: var(--text-dark);
    width: 100%;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    transition: all 0.2s ease;
}

[data-theme='dark'] .input-select {
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

.input-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary20);
}

/* --- Styling for Tab Content --- */
.tab-pane {
    display: none;
    animation: fadeIn 0.5s;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Small Notice Box --- */
.notice-box-small {
    font-size: 0.85rem;
    text-align: center;
    padding: 0.75rem;
    background-color: var(--bg-mute);
    border-radius: 0.5rem;
    margin: 1rem 0;
    color: var(--text-dark-mute);
}

/* --- Print Button --- */
#printButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem auto 0;
    background: var(--bg-mute);
    color: var(--text-dark);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
#printButton:hover {
    background-color: var(--card-border);
}

/* --- PRINT STYLES --- */
@media print {
    /* Hide everything that isn't the result */
    body > *:not(.tool-main-content),
    .tool-main-content > *:not(.calculator-section),
    .header, .footer-section, .prose-section, .callback, .quick-bento,
    #deductionForm, .disclaimer, #printButton {
        display: none !important;
    }

    /* Reset styles for printing */
    body {
        background: #fff !important;
    }
    .calculator-card, .results-container {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure text is black for printing */
    * {
        color: #000 !important;
    }
    
    .result-item.accent .value {
        color: #0056b3 !important; /* A dark blue for accent */
    }

    /* Add a simple header to the printout */
    .calculator-section::before {
        content: 'Beregning af Kørselsfradrag - PowerPlan.io - ' attr(data-print-date);
        display: block;
        text-align: center;
        margin-bottom: 2rem;
        font-size: 1rem;
        border-bottom: 1px solid #ccc;
        padding-bottom: 1rem;
    }
}
