/* ================================
   🌑 Baslayout & Body
   ================================ */

body {
  margin: 0;
  background: #000;
  font-family: 'Segoe UI', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}



/* Specifikt för login/index */
body.main-page {
  margin: 0;
  padding: env(safe-area-inset-top, 3.5rem) 20px 20px 20px;
  box-sizing: border-box;
  padding: 20px;
  font-family: 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;

  align-items: center;
  min-height: 100vh;
  height: auto;
  background: linear-gradient(to bottom,
      #001c3d 0%,
      #16397a 40%,
      #3f4f88 65%,
      #645b63 80%,
      #b18e56 100%);
  color: #ffd700;
  text-align: center;
  overflow-x: hidden;
}


body.error {
  box-shadow: inset 0 0 0 4px red;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%; /* ← Nu centrerat korrekt */
}

.logo {
  max-width: 160px;
  height: auto;
  width: 100%;
}

@media (max-width: 768px) {
  .logo {
    max-width: 120px;
  }

}

/* ================================
   📦 Wrapper & SVG
   ================================ */
.wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

svg {
  flex: 1;
  width: 100vw;
  display: block;
  overflow: visible;
}


/* ================================
   🧰 Verktygsrad / Toolbar
   ================================ */
.toolbar {
  background: #000;
  color: #fff;
  padding: 2px 12px;
  font-size: 14px;
  display: flex;
  gap: 6px;
  align-items: center;
  z-index: 5;
}

.toolbar select {
  margin-left: 8px;
  background: #222;
  color: white;
  border: 1px solid #555;
  padding: 4px 8px;
  border-radius: 4px;
}

.toolbar label,
.toolbar select {
  line-height: 1;
}

/* ================================
   📁 Filuppladdning
   ================================ */
.custom-file-upload {
  display: inline-block;
  padding: 6px 12px;
  cursor: pointer;
  background-color: #222;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 14px;
}

#fileInput {
  display: none;
}

#fileNameDisplay {
  margin-left: 10px;
  color: #ccc;
  font-style: italic;
  font-size: 13px;
  padding-right: 2rem;
}

/* ================================
   🧱 Treemap Labels
   ================================ */
.label {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  fill: white;
}

.value-label {
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  fill: white;
  font-size: 16px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

/* ================================
   💬 Tooltip
   ================================ */
.tooltip {
  position: absolute;
  background: #333;
  color: #fff;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.2s;
}

/* ================================
   🎨 Legend
   ================================ */
.legend {
  position: relative;
  height: 60px;
  margin: 0.1in;
  display: flex;
  gap: 6px;
  align-items: flex-end;
  font-size: 11px;
  color: #ccc;
}

.legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.legend-color {
  width: 48px;
  height: 12px;
  margin-bottom: 2px;
  border: 1px solid #222;
}



/* ================================
   🕳 Tomvy (innan data)
   ================================ */
#empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #888;
  font-size: 32px;
  text-align: center;
  z-index: 2;
}

/* ================================
   🖋 Fotnot / Credit
   ================================ */
.credit {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: #ccc;
  /* ljusare färg för bättre kontrast */
  font-size: 14px;

  font-weight: bold;
  /* 👈 lägg till detta */
  opacity: 0.9;
  /* 👈 gör den lite mer synlig */
  z-index: 10;
  text-align: center;
  text-shadow: 0 0 2px #000;
}


.credit a {
  color: #eee;
  text-decoration: none;
}

.credit a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ================================
   💰 Totalruta
   ================================ */
.total-box {
  position: absolute;
  bottom: 14px;
  right: 18px;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 12px;
  font-size: 32px;
  font-weight: bold;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
  z-index: 10;
}

/* ================================
   🖋 Transaction summary
   ================================ */
#summary-box {
  position: absolute;
  bottom: 12px;
  right: 18px;
  color: #ffd700;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 12px;
  font-size: 32px;
  font-weight: bold;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(255, 215, 0, 0.3);
  z-index: 10;
}


footer {
  margin-top: 60px;
  margin-bottom: 5px;
  font-size: 13px;
  color: #ccc;
}

footer a {
  color: #ccc;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}


/* ================================
   🖋 Feedback button
   ================================ */
   
.feedback-button {
  background-color: #ffa500;
  color: white;
  font-size: 0.8rem;
  padding: 3px 6px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.feedback-button:hover {
  background-color: #e59400;
}

/* Modal bakgrund */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  border-radius: 6px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh; /* 💡 Lägg till detta */
  overflow-y: auto;  /* 💡 Scrolla om för lång */
  padding: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

.modal-body {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-body label {
  font-weight: bold;
}

.modal-body input,
.modal-body textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 0.9rem;
  box-sizing: border-box; /* 💡 Lägg till detta */
}

.modal-body textarea {
  min-height: 100px;
  max-height: 200px; 
  resize: vertical;
}

.modal-footer {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.submit-button {
  background-color: #f7c200;
  color: black;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.submit-button:hover {
  background-color: #e6b200;
}

.cancel-button {
  background-color: #ddd;
  color: #333;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.cancel-button:hover {
  background-color: #ccc;
}

.help-text {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.5rem;
}