/* --- GLOBALT --- */
/* html og body er fjernet for å ikke overstyre hovedsidens design */

/* --- CONTAINER (Erstatter iframe-body og tidligere .container) --- */
.kalkulator-container {
  max-width: 900px;
  margin: 0 auto;
  background-color: #ffffff;
  color: #222;
  font-family: "Segoe UI", Arial, sans-serif;
  padding: 0px 20px 20px 20px;
  width: 100%;
  box-sizing: border-box;
}

/* --- RESPONSIV MENY --- */
.nav-menu {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 15px 5px;
  width: 100%;
  box-sizing: border-box;
}

.nav-link {
  flex: 1;
  max-width: 180px;
  min-width: 0; 
  text-decoration: none;
  font-weight: bold;
  font-size: 0.85rem; 
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 4px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #333;
  transition: all 0.2s ease;
  line-height: 1.2;
}

/* Markerer den aktive siden på PC */
.nav-link.active {
  background-color: #0d9488;
  color: #ffffff;
  border-color: #0d9488;
}

.nav-link:hover {
  background-color: #e5e7eb;
  transform: translateY(-1px);
}

.nav-sep {
  display: none;
}

/* --- TO-KOLONNE LAYOUT (desktop) --- */
.calculator-layout {
  display: flex;
  gap: 40px;
  margin-top: 0px;
}

.input-column {
  flex: 0 0 420px;
}

.results-column {
  flex: 1;
  min-width: 0;
}

/* --- OVERSKRIFTER --- */
h1.main-title {
  font-size: 18pt; /* Fra index */
  margin-top: 20px;
  margin-bottom: 0.3rem;
  color: #333;
  text-align: left;
}

h2.secondary-title, h2 {
  font-size: 1.15rem;
  color: #111827;
  margin-top: 30px;
  margin-bottom: 20px;
  text-align: left;
  font-weight: 600;
}

.section-title {
  margin-top: 35px;
  font-size: 0.9rem;
  color: #111827;
  font-weight: 600;
  margin-bottom: 5px;
}

.section-title:first-child {
  margin-top: 0;
}

.header-subtext, p.subtitle {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 20px;
  text-align: left;
}

/* --- FIKS (mer luft før streken) --- */
hr {
  margin: 30px 0 25px 0;
  border: none;
  border-top: 1px solid #ddd;
}

/* --- LABELS & INPUTS --- */
label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
}

input, select, button {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  box-sizing: border-box;
  height: 38px;
  background-color: #ffffff;
}

/* Fjern piltaster i number inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* --- PERSONLIGE FELT (highlight) --- */
#prosentTop {
  background-color: #ccf3f0;
  border: 2px solid #0d9488;
}

/* --- CHECKBOX STYLING --- */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  cursor: pointer;
  accent-color: #0d9488;
  padding: 0 !important;
  margin: 0 !important;
}

.checkbox-label {
  margin: 0 !important;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

#feriepengeFelterContainer {
  transition: opacity 0.3s ease;
}

/* --- FERIETREKK OVERSIKT --- */
#ferietrekkOversikt {
  animation: fadeIn 0.3s ease;
  background: white; /* Default background */
}

#ferietrekkOversikt h3 {
  margin-bottom: 15px;
}

#ferietrekkOversikt table {
  background: white;
  border-radius: 6px;
}

#ferietrekkOversikt th,
#ferietrekkOversikt td {
  border-bottom: none;
}

#ferietrekkOversikt td {
  background-color: transparent !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- INPUT LAYOUT --- */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 22px;
}
.full-width {
  flex: 1;
  width: 100%;
}
.ferietrekk-row {
  align-items: center;
  margin-top: 10px;
}

/* --- RESULTATER (høyre kolonne) --- */
.results-container {
  background-color: #f4f7f9; 
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e1e8ed;
  margin-bottom: 20px; 
  width: 100%; 
  box-sizing: border-box; 
  display: block;
}

.align-spacer {
  display: block;
  visibility: hidden; 
  margin-bottom: 0px; 
  font-size: 1rem;    
  line-height: 1.5;
  height: 1.5em;      
}

/* --- TABELLER --- */
table {
  width: 100%;
  max-width: 420px;
  margin-top: 15px;
  border-collapse: collapse;
}
th, td {
  padding: 8px 12px;
  font-size: 0.9rem;
  border-bottom: none;
}
th {
  text-align: left;
  background: transparent;
  white-space: normal;
  font-weight: normal;
}
td {
  text-align: right;
  background-color: transparent;
  white-space: nowrap;
}

.results-container table {
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.results-container table:last-of-type {
  border-bottom: none;
}

.currency {
  font-weight: bold;
}

/* --- INFO/BEREGNINGSTEKST --- */
#beregningInfo {
  margin-top: 0;
  margin-bottom: 15px;
  color: #333 !important;
}

.calculation-info {
  font-size: 0.85rem;
  color: #666;
  font-weight: 400;
  /* ENDRET */
  margin-top: 0; 
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.4;
  min-height: 24px;
}

/* --- KNAPPER --- */
.button-row {
  margin: 12px 0 22px 0;
}

button#resetBtn {
  width: auto;
  background: #6b7280;
  color: #fff;
  border: none;
  padding: 10px 25px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
}
button#resetBtn:hover { background: #4b5563; }
button#resetBtn:active { transform: scale(0.98); background: #374151; }

/* --- ANNONSE-DESIGN --- */
.info-box {
  display: block; 
  text-decoration: none; 
  margin: 0 0 10px 0; 
  background-color: #ffffff; 
  border: 2px solid #ced4da; 
  border-radius: 8px;
  color: inherit;
  transition: all 0.2s ease;
  overflow: hidden;
}

.info-box:hover {
  background-color: #fafafa; 
  border-color: #ced4da;
  transform: translateY(-1px); 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); 
}

.ad-label-external {
  font-size: 12px; 
  font-weight: 700; 
  color: #555; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  margin: 35px auto 8px auto; 
  text-align: center;
  background-color: #f1f5f9;
  padding: 4px 10px;
  border-radius: 4px;
  display: table; 
}

.banner-content {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  gap: 20px;
}

.banner-logo {
  flex: 0 0 auto;
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-logo img {
  max-width: 100%;
  height: auto;
  display: block;
}

.banner-text-area { flex: 1; text-align: left; }

.banner-title {
  font-weight: bold;
  font-size: 1.1rem;
  color: #111;
  line-height: 1.3;
  margin-bottom: 0px; 
}

.banner-text-body {
  font-weight: normal; 
  font-size: 0.95rem;   
  color: #111;
  line-height: 1.3;
  margin-bottom: 4px;
}

.disclaimer-text {
  font-size: 0.75rem; 
  color: #666; 
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 30px; 
  margin-left: 0;
  margin-right: 0;
  max-width: none;
  text-align: center; 
}

.banner-cta { flex: 0 0 auto; }

.fake-button {
  display: inline-block;
  background-color: #D1304C; 
  color: #fff;
  padding: 10px 18px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.95rem;
  text-align: center;
  white-space: nowrap;
}

.info-box:hover .fake-button { background-color: #b91c1c; }

/* --- FAQ SEKSJON --- */
.faq-section {
  margin-top: 40px; 
  padding-top: 30px;
  border-top: 1px solid #e1e8ed;
}

.faq-section h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.faq-section h3 {
  font-size: 1.2rem;
  margin-top: 30px;
  margin-bottom: 10px;
  color: #0d9488; 
  font-weight: 700;
}

.faq-section p, .faq-section li {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
  margin-bottom: 15px;
}

.faq-section strong {
  color: #222;
}

/* --- INFO-ICON & TOOLTIP --- */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  font-size: 0.7rem;
  font-weight: bold;
  color: white;
  background: #0d9488;
  border-radius: 50%;
  cursor: help;
  position: relative;
  user-select: none;
  vertical-align: middle;
}

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  right: 0;
  bottom: 130%;
  background: #111827;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: normal;
  white-space: normal;
  width: 220px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 1000;
  line-height: 1.4;
}

.info-icon::before {
  content: '';
  position: absolute;
  right: 5px;
  bottom: 120%;
  border: 6px solid transparent;
  border-top-color: #111827;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 1000;
}

.info-icon:hover::after,
.info-icon:hover::before {
  opacity: 1;
  visibility: visible;
}

/* --- SCROLL HINT TEXT (Default skjult) --- */
.mobile-scroll-hint {
    display: none;
}

/* --- MEDIA QUERIES (Mobil/Tablet) --- */

@media (max-width: 1024px) {
  /* Skjul vanlig tooltip på mobil/tablet */
  .info-icon::after,
  .info-icon::before {
    display: none;
  }
  
  /* Modal overlay for tooltips */
  .tooltip-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    padding: 20px;
  }
  
  .tooltip-modal.active {
    display: block;
  }
  
  .tooltip-modal-content {
    background: #111827;
    color: white;
    padding: 16px 20px;
    padding-top: 26px;
    border-radius: 8px;
    width: calc(100% - 40px);
    max-width: 320px;
    margin: 0 auto;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (max-width: 900px) {
  .calculator-layout {
    flex-direction: column;
    gap: 30px;
  }
  
  .input-column, .results-column {
    flex: 1;
  }
  
  /* ENDRET */
  #beregningInfo {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .align-spacer {
    display: none;
  }
}

@media (max-width: 700px) {
  .kalkulator-container {
    padding: 0 10px 10px 10px !important;
  }
  h1, h2, .section-title {
    margin-top: 12px;
    margin-bottom: 12px;
  }
  .row {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }
  
  .ferietrekk-row {
    align-items: flex-start;
  }
  
  input {
    height: 36px;
    margin-bottom: 4px;
  }
  .checkbox-container {
    margin-bottom: 0;
    justify-content: flex-start;
  }
  #ferietrekkOversikt {
    margin-top: 20px;
    padding: 12px;
  }
  #ferietrekkOversikt h3 {
    font-size: 1rem;
  }
  .button-row {
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
  }
  table {
    margin-top: 10px;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
  }
  th, td {
    padding: 6px 8px;
    vertical-align: top;
    word-break: break-word;
  }
  th {
    width: 110px;
    background-color: transparent;
  }
  td {
    width: auto;
    background-color: transparent !important;
  }
}

/* SKJULER AKTIV KNAPP KUN PÅ MOBIL */
@media (max-width: 600px) {
  .nav-link { font-size: 0.8rem; }
  
  .banner-content {
      flex-direction: column;
      text-align: center;
      gap: 15px;
  }
  .banner-text-area { text-align: center; }
  .banner-logo { width: 140px; margin: 0 auto; }
  .fake-button { width: 100%; box-sizing: border-box; }
}

@media (max-width: 350px) {
  .nav-link { font-size: 0.75rem; padding: 8px 2px; }
}

/* --- MOBIL: KOMPAKT ANNONSE + SCROLL HINT (STATISK) --- */
@media (max-width: 600px) {
    
    /* 1. Gjør annonse kompakt*/
    .banner-content {
        padding: 12px 15px !important;
        gap: 10px !important;
    }

    .banner-logo {
        width: 100px !important; 
        margin-bottom: 0 !important;
    }

    .banner-title { font-size: 1rem !important; }
    
    .banner-text-body {
        font-size: 0.85rem !important;
        margin-bottom: 5px !important;
    }

    /* FIX: Gjør knappen normal igjen */
    .banner-cta {
        width: 100%;
        text-align: center;
    }
    .fake-button {
        width: auto !important;     /* Ikke full bredde */
        min-width: 140px;           
        padding: 8px 20px !important;
        font-size: 0.9rem !important;
        display: inline-block;
    }
    
    .disclaimer-text {
        margin-bottom: 30px !important; 
    }

    /* 2. Styling for "Se resultater"-teksten (Vises kun på mobil) */
    .mobile-scroll-hint {
        display: block !important; /* Tving visning på mobil */
        text-align: center;
        color: #0d9488; /* Samme farge som temaet ditt */
        font-weight: 600;
        font-size: 0.9rem;
        margin-top: 10px;
        margin-bottom: 20px;
    }
}

/* ==================================================== */
/* --- ZENSUM ANNONSE (Lagt inn manuelt)            --- */
/* ==================================================== */

/* FELLES STIL */
.z-boks {
    background-color: #f8fbfd;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 20px;
    margin: 30px auto;
    max-width: 580px;
    position: relative;
    box-shadow: 0 1px 4px rgba(0,0,0,0.02);
    font-family: 'Open Sans', sans-serif;
    box-sizing: border-box;
}

/* TYDELIGERE MERKING */
.z-merking {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 0.65rem;
    color: #ffffff;
    background: #333333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
}

.z-innhold {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 10px;
}

.z-logo img {
    max-height: 45px; 
    width: auto;
    display: block;
}

/* VIKTIG: Flex-innstillinger for PC */
.z-tekst {
    flex: 2 1 250px;
}

.z-tekst h3 {
    margin: 0 0 4px 0;
    color: #2c3e50;
    font-size: 1.15rem;
    font-weight: 700;
}

.z-tekst p {
    margin: 0;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* VIKTIG: Flex-innstillinger for PC */
.z-knapp {
    flex: 1 1 180px;
    text-align: center;
}

/* Styling av selve knappen (Grønn Zensum-stil) */
.z-knapp a {
    display: inline-block;
    background-color: #00c65e;
    color: white !important;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 3px 8px rgba(0, 198, 94, 0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.z-knapp a:hover {
    background-color: #00b053;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 198, 94, 0.3);
}

.z-info {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #edf2f7;
    font-size: 0.9rem;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

/* --- FIX FOR MOBIL (Fjerner tomrommet) --- */
@media (max-width: 600px) {
    .z-boks {
        padding: 15px; 
        margin: 20px auto;
    }
    
    /* Mobil-justering for merket */
    .z-merking {
        position: static;
        display: inline-block;
        margin-bottom: 5px;
        font-size: 0.6rem;
        color: #444;
        background: #e2e8f0;
        padding: 2px 6px;
    }

    .z-innhold {
        flex-direction: column;
        text-align: center;
        gap: 12px; 
        margin-top: 5px;
    }

    .z-logo img {
        max-height: 35px; 
        margin: 0 auto;
    }

    .z-tekst {
        flex: 0 0 auto; 
        width: 100%;
        text-align: center;
    }

    .z-tekst h3 { font-size: 1.1rem; }
    
    .z-knapp {
        flex: 0 0 auto;
        width: 100%;
        text-align: center;
        margin-top: 0;
    }
    
    .z-knapp a {
        width: 100%;
        box-sizing: border-box;
        padding: 12px;
        display: block; 
    }
}