/* Grunnleggende reset og variabler */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --background-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --positive-color: #22c55e;
    --negative-color: #ef4444;
    --success-bg: #ecfdf5;
    --success-border: #10b981;
    --success-text: #065f46;
    --error-bg: #fef2f2;
    --error-border: #ef4444;
    --error-text: #991b1b;
    --card-bg: white;
    --hover-bg: #f0f0f0;
    --details-bg: #f8f9fa;
    /* Gradient variabler */
    --hero-gradient: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    /* Overlay variabler */
    --overlay-bg: rgba(255, 255, 255, 0.78);
    --card-overlay-bg: rgba(255, 255, 255, 0.95);
    --shell-surface: #ffffff;
    --theme-color: var(--shell-surface);
        color-scheme: light;
}

/* Mørk modus variabler */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --secondary-color: #2563eb;
    --background-color: #1e293b42;
    --text-color: #f1f5f9;
    --border-color: #475569;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --success-bg: #064e3b;
    --success-border: #10b981;
    --success-text: #6ee7b7;
    --error-bg: #7f1d1d;
    --error-border: #ef4444;
    --error-text: #fca5a5;
    /* Ekstra variabler */
    --card-bg: #334155;
    --hover-bg: #475569;
    --details-bg: #3b4b5c;
    /* Gradient variabler */
    --hero-gradient: linear-gradient(rgba(51, 65, 85, 0.9), rgba(51, 65, 85, 0.8));
    /* Overlay variabler */
    --overlay-bg: rgba(51, 65, 85, 0.9);
    --card-overlay-bg: rgba(51, 65, 85, 0.95);
    --shell-surface: #334155;
    --theme-color: var(--shell-surface);
        color-scheme: dark;
}

html {
    height: 100%;
    background-color: var(--background-color, #f8fafc);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Tilgjengelighet - skjul visuelt men behold for skjermlesere */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.info-box h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-box p {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: var(--text-color);
}

.info-box p:last-child {
    margin-bottom: 0;
}

.full-width {
    grid-column: 1 / -1;
    margin-bottom: 2rem;
}

.calculator-grid.side-by-side {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.size-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.size-field {
    flex: 0 0 100px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 0.5rem;
}

.unit-buttons {
    display: flex;
    gap: 0.3rem;
}

.price-input-group input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 0.5rem;
}

.unit-btn {
    height: 38px; /* Samme høyde som input-feltene */
    padding: 0 0.5rem;
    min-width: 2rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.unit-btn:hover {
    background: var(--hover-bg);
}

.unit-btn.active {
    background: var(--primary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
}

/* Toggle-knapp for skatt-beregning */
.tax-toggle-btn {
    width: 15%;
    height: 38px;
    padding: 0 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: center;
}

.tax-toggle-btn:hover {
    background: var(--hover-bg);
}

.tax-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Style for resultatene */
.results .summary {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.results .details {
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.savings-chart-wrapper {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-header h4 {
    margin: 0;
    color: var(--primary-color);
}

.chart-header p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.9rem;
}

.savings-chart-wrapper canvas {
    width: 100%;
    height: 320px;
    max-height: 60vh;
    display: block;
}

.savings-chart-wrapper canvas.is-hidden {
    display: none;
}

.chart-empty-state {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    color: var(--text-color);
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.chart-empty-state.visible {
    display: flex;
}

.table-toggle-button {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    align-self: flex-start;
    transition: var(--transition);
}

.table-toggle-button:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cost-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.cost-group {
    background: var(--background-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.cost-group h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.cost-group p {
    margin-bottom: 0.5rem;
}

.cost-group .total {
    margin-top: 1rem;
    font-weight: bold;
    color: var(--text-color);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: transparent;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    --page-bg-image: url('../images/background.webp');
    transition: var(--transition);
}

/* Spesifikke bakgrunnsbilder for hver side */
.home-page    { --page-bg-image: url('../images/background.webp'); }
.about-page   { --page-bg-image: url('../images/background.webp'); }
.contact-page { --page-bg-image: url('../images/background.webp'); }
.kalkulatorer-page { --page-bg-image: url('../images/background.webp'); }
.savings-page { --page-bg-image: url('../images/sparekalkulator.webp'); }
.price-page   { --page-bg-image: url('../images/matvarepris.webp'); }
.power-page   { --page-bg-image: url('../images/strømavtale.webp'); }
.ev-page      { --page-bg-image: url('../images/elbil-vs-fossilbil.webp'); }

.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    background-image: var(--page-bg-image);
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    will-change: transform;
    transform: translateZ(0);
}

.page-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--overlay-bg);
}

.coming-soon-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.coming-soon-badge:hover {
    background-color: var(--secondary-color);
    text-decoration: none;
}

/* Kontaktskjema alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert.success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.alert.error {
    background-color: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

.alert p {
    margin: 0.25rem 0;
}

.alert p:last-child {
    margin-bottom: 0;
}

/* Navigasjon */
.navbar {
    background-color: var(--shell-surface);
    padding: 1rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: env(safe-area-inset-top);
    background-color: var(--shell-surface);
    z-index: -1;
    pointer-events: none;
}

/* Mørk modus navbar */
[data-theme="dark"] .navbar {
    background-color: var(--shell-surface);
    border-bottom: 1px solid var(--border-color);
}

.nav-brand {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-brand a {
    text-decoration: none;
    color: inherit;
}

/* Nav controls wrapper */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Mørk modus toggle */
.dark-mode-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.dark-mode-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.dark-mode-toggle .sun-icon,
.dark-mode-toggle .moon-icon {
    font-size: 1.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.dark-mode-toggle .moon-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
}

[data-theme="dark"] .dark-mode-toggle .sun-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(180deg);
}

[data-theme="dark"] .dark-mode-toggle .moon-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Dropdown meny */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border-radius: 0.375rem;
    z-index: 1;
}

.dropdown-content a {
    padding: 0.75rem 1rem;
    display: block;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Hamburger meny for mobil */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Animasjon for hamburger til X */
.mobile-open .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

.mobile-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-open .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

/* Hero-seksjon - tilbake til original med CSS bakgrunn */
.hero {
    background: var(--hero-gradient);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-color);
    opacity: 0.9;
}

/* Container og hovedinnhold */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Feature cards */
.features {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-bottom: 4rem;
}

.feature-card {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(37, 99, 235, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    background-color: var(--hover-bg);
    border-color: rgba(37, 99, 235, 0.2);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-color);
}

.coming-soon {
    cursor: default;
}

.coming-soon-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

/* Benefits grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.benefit-item {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.benefit-item h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Kalkulator-spesifikk styling */
.calculator {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.calculator h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.calculator-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
        "ev fuel"
        "distance .";
    padding-top: 1rem;
}

.savings-top-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    grid-template-areas: none;
    align-items: stretch;
}

.savings-common .field-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.savings-common .field-grid .input-field {
    margin-bottom: 0;
}

.savings-input-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    grid-template-areas: none;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.savings-input-grid .input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.tax-settings .input-field {
    margin-bottom: 0.5rem;
}

.tax-settings .tax-toggle-btn {
    width: 100%;
}

.tax-settings .info-text {
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.85;
}

.input-group {
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 0.5rem;
}

.input-group h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.input-field {
    margin-bottom: 1rem;
    transition: var(--transition);
}

.input-field.active {
    transform: translateY(-2px);
}

.input-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-field input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: var(--transition);
}

.input-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.input-field label {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    gap: 0.5rem;
}

.input-field label span {
    display: inline-block;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    background: var(--card-bg);
    color: var(--primary-color);
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    position: relative;
    vertical-align: top;
}

.info-icon:hover:after {
    content: attr(data-tooltip);
    position: absolute;
    background: var(--card-bg);
    padding: 0.75rem;
    border-radius: 0.375rem;
    box-shadow: var(--shadow-md);
    width: 250px;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    color: var(--text-color);
    font-weight: normal;
    z-index: 10;
    text-align: left;
}

.info-icon:hover:before {
    content: '';
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: white transparent transparent transparent;
    z-index: 10;
}

.info-icon .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: white transparent transparent transparent;
}

.distance-group {
    grid-area: distance;
}

/* Knapper */
.button {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin: 0 auto;
}

.button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Resultater */
.results {
    margin-top: 2rem;
    transition: var(--transition);
}

.results.hidden {
    display: none;
}

.result-card {
    background: var(--background-color);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.result-summary {
    margin: 1.5rem 0 2rem;
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.summary-card {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-card h4 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.summary-card h4 span {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.7;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.summary-row.is-hidden {
    display: none;
}

.summary-row.total {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-weight: 600;
}

.summary {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0.375rem;
}

.summary .highlight {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
}

.cost-details {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.cost-group h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.cost-group p {
    margin-bottom: 0.5rem;
}

.cost-group .total {
    margin-top: 1rem;
    font-weight: bold;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Om siden og kontakt */
.about-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.contact-section {
    max-width: 700px;
    width: calc(100vw - 4rem);
    max-width: min(700px, calc(100vw - 4rem));
    margin: 0 auto;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.contact-section h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.contact-info {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-color);
    border-radius: 0.5rem;
}

.contact-info h3 {
    margin: 0 0 1rem 0;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.contact-info p {
    margin: 0;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
}

.contact-intro {
    margin-bottom: 2rem;
}

.contact-form {
    width: 100%;
    max-width: none;
}

.contact-form form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: none;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.form-group label {
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--background-color);
    color: var(--text-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.form-group textarea {
    resize: vertical;
}

.about-section h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.about-section h2 {
    color: var(--primary-color);
    margin: 2rem 0 1rem;
}

.feature-list {
    list-style: none;
    margin-left: 1rem;
}

.feature-list li {
    margin-bottom: 0.5rem;
    position: relative;
}

.feature-list li::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -1rem;
}

/* Main content wrapper for sticky footer */
main {
    flex: 1;
}

/* Footer */
footer {
    background: var(--shell-surface);
    padding: 3rem 2rem 1rem;
    margin-top: auto;
    box-shadow: var(--shadow-sm);
    position: relative;
}

footer::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: env(safe-area-inset-bottom);
    background-color: var(--shell-surface);
    z-index: -1;
    pointer-events: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Scroll til toppen knapp */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.scroll-to-top:hover svg {
    transform: translateY(-2px);
}

/* Animasjoner */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Comprehensive Mobile Responsiveness */

/* Tablet og større mobiler (768px og mindre) */
@media (max-width: 768px) {
    /* Generell layout */
    .container {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    
    /* Navigasjon - Hamburger meny */
    .navbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    /* Nav controls på mobil */
    .nav-controls {
        gap: 0.5rem;
    }
    
    /* Mørk modus knapp - mindre på mobil */
    .dark-mode-toggle {
        width: 40px;
        height: 40px;
    }
    
    .dark-mode-toggle .sun-icon,
    .dark-mode-toggle .moon-icon {
        font-size: 1.3rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        position: relative;
        z-index: 1002;
        background: var(--card-bg);
        border-radius: 4px;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--card-bg);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 5rem 0 2rem 0;
        gap: 0;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
        z-index: 1001;
        overflow-y: auto;
    }
    
    .nav-links.mobile-active {
        right: 0;
    }
    
    .nav-links a {
        width: 100%;
        padding: 1rem 2rem;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.1rem;
        border-radius: 0;
        display: block;
        text-decoration: none;
        color: var(--text-color);
        transition: background-color 0.2s ease;
    }
    
    .nav-links a:hover {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--primary-color);
    }
    
    .nav-links a.active {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--primary-color);
        font-weight: bold;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    /* Dropdown på mobil - deaktiver dropdown-funksjonalitet fullstendig */
    .dropdown {
        width: 100%;
    }
    
    /* Overstyr desktop hover-funksjonalitet på mobil */
    .dropdown:hover .dropdown-content,
    .dropdown .dropdown-content {
        display: block !important; /* Alltid synlig på mobil */
        position: static !important;
        animation: none !important;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* Forbedret mobilmeny - vis kalkulatorer som undermeny med innrykk */
    .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        border-radius: 0;
        margin-left: 0;
        margin-top: 0;
        padding-left: 2rem;
    }
    
    /* "Kalkulatorer" hovedmeny - samme styling som andre hovedmeny-elementer */
    .dropdown > .nav-link {
        display: block;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-color);
        text-decoration: none;
        transition: background-color 0.2s ease;
        font-size: 1rem;
    }
    
    /* Active state for Kalkulatorer hovedknapp - samme som andre hovedmeny-elementer */
    .dropdown > .nav-link.active {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--primary-color);
        font-weight: bold;
    }
    
    /* Hover state for Kalkulatorer hovedknapp */
    .dropdown > .nav-link:hover {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--primary-color);
    }
    
    .dropdown-content a {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--border-color);
        display: block;
        width: 100%;
        text-decoration: none;
        color: var(--text-color);
        transition: background-color 0.2s ease;
        font-weight: 400;
    }
    
    .dropdown-content a:hover {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--primary-color);
    }
    
    .dropdown-content a.active {
        background-color: rgba(37, 99, 235, 0.1);
        color: var(--primary-color);
        font-weight: bold;
    }
    
    /* Overlay når meny er åpen */
    .mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 1000;
    }
    
    /* Hero seksjon */
    .hero {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    /* Feature cards på hjemsiden */
    .features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .feature-card {
        padding: 1.5rem;
    }
    
    /* Benefits grid */
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .benefit-item {
        padding: 1.5rem;
    }
    
    /* Kalkulatorer */
    .calculator {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .calculator h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        grid-template-areas: 
            "ev"
            "fuel"
            "distance";
    }
    
    .calculator-grid.side-by-side {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .savings-top-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .savings-top-grid .info-box {
        grid-column: auto;
    }

    .savings-top-grid:has(.info-box) {
        display: flex;
        flex-direction: column;
    }

    /* Reverser rekkefølgen på mobil slik at info-boksen kommer øverst */
    .calculator-grid:has(.info-box) {
        display: flex;
        flex-direction: column-reverse;
    }

    .calculator-grid.savings-top-grid:has(.info-box) {
        flex-direction: column;
    }
    
    /* Alternativ for eldre browsere som ikke støtter :has() */
    .common-inputs.calculator-grid {
        display: flex;
        flex-direction: column-reverse;
    }
    
    .input-group {
        padding: 1.25rem;
    }
    
    .input-group h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    /* Input felter */
    .input-field input,
    .form-group input,
    .form-group textarea {
        padding: 0.625rem;
        font-size: 16px; /* Forhindrer zoom på iOS */
    }
    
    .size-input-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .size-field {
        flex: 1 1 120px;
        min-width: 120px;
    }
    
    .unit-buttons {
        gap: 0.25rem;
    }
    
    .unit-btn {
        min-width: 2.5rem;
        font-size: 0.85rem;
    }
    
    /* Knapper */
    .button {
        width: 100%;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .tax-toggle-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Resultater */
    .results {
        margin-top: 1.5rem;
    }
    
    .result-card {
        padding: 1.5rem;
    }
    
    .cost-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cost-group {
        padding: 1rem;
    }
    
    /* Om siden og kontakt */
    .about-section,
    .contact-section {
        max-width: none;
        width: calc(100vw - 2rem);
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    .contact-info {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .contact-info h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .contact-info p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .contact-form form {
        gap: 1rem;
    }
    
    /* Footer */
    footer {
        padding: 2rem 1rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    /* Scroll til toppen knapp - mobil */
    .scroll-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
    
    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
    
    /* Info boxes */
    .info-box {
        padding: 1rem;
    }
    
    .info-box h2 {
        font-size: 1.1rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .distance-controls {
        flex-direction: row;
        align-items: center;
    }
    
    .info-icon {
        right: -24px;
    }
}

/* Små mobiler (480px og mindre) */
@media (max-width: 480px) {
    /* Container */
    .container {
        margin: 0.5rem auto;
        padding: 0 0.5rem;
    }
    
    .nav-brand {
        font-size: 2rem;
    }
    
    .nav-links {
        width: 100%;
        padding: 4rem 1.5rem 2rem;
    }
    
    .nav-links a {
        padding: 0.875rem;
        font-size: 1rem;
    }
    
    /* Hero */
    .hero {
        padding: 1.5rem 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    /* Kalkulatorer */
    .calculator {
        padding: 1rem;
    }
    
    .calculator h1 {
        font-size: 1.5rem;
    }
    
    .input-group {
        padding: 1rem;
    }
    
    .input-group h2 {
        font-size: 1rem;
    }
    
    /* Input felter - ekstra små skjermer */
    .size-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .size-field {
        flex: none;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .unit-buttons {
        justify-content: center;
    }
    
    .unit-btn {
        flex: 1;
        min-width: auto;
    }
    
    /* Om siden og kontakt */
    .about-section,
    .contact-section {
        width: calc(100vw - 1rem);
        padding: 1rem;
    }
    
    .contact-section h1,
    .about-section h1 {
        font-size: 1.5rem;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .contact-info {
        padding: 0.75rem;
    }
    
    .contact-info h3 {
        font-size: 1rem;
    }
    
    .contact-info p {
        font-size: 13px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    /* Scroll til toppen knapp - små skjermer */
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .scroll-to-top svg {
        width: 18px;
        height: 18px;
    }
    
    /* Feature cards */
    .feature-card {
        padding: 1rem;
    }
    
    .benefit-item {
        padding: 1rem;
    }
    
    /* Info tooltips - gjør dem mobile-vennlige */
    .info-icon:hover:after {
        width: 200px;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Meget små skjermer (360px og mindre) */
@media (max-width: 360px) {
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .calculator h1 {
        font-size: 1.25rem;
    }
    
    .nav-brand {
        font-size: 1.1rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
    
    .unit-btn {
        font-size: 0.8rem;
        padding: 0 0.25rem;
    }
    
    .contact-section h1,
    .about-section h1 {
        font-size: 1.25rem;
    }
}
