/* =========================================================
   Swish URL Generator Stylesheet
   Author: Kristoffer Arvidsson
   Version: 2.1
   ========================================================= */

/* =========================================================
   Developer Information
   ---------------------------------------------------------
   Developed by Kristoffer Arvidsson, 2025
   This stylesheet defines the modern UI for the Swish URL
   Generator tool. It features responsive design, smooth
   gradients, and minimalistic input interactions.
   ========================================================= */


/* =========================================================
   Font Setup
   --------------------------------------------------------- */
.fredoka-<uniquifier> {
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: <weight>;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}


/* =========================================================
   Root Variables
   --------------------------------------------------------- */
:root {
  --primary: #2ecc71;
  --primary-dark: #d9a552;
  --accent: #daa553;
  --card: #fff;
  --text: #222;
  --radius: 8px;
}


/* =========================================================
   Base Layout
   --------------------------------------------------------- */
body {
  font-family: "Fredoka", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(45deg, #d53369 0%, #daae51 100%);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* lägg innehållet upptill istället */
  min-height: 100vh;
  color: var(--text);
}


/* =========================================================
   Container
   --------------------------------------------------------- */
.container {
  background: var(--card);
  border-radius: 25px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 500px;
  padding: 2rem;
  box-sizing: border-box;
  margin: auto 0;
}


/* =========================================================
   Responsive Layout
   --------------------------------------------------------- */
/* Desktop: centrerad */
@media (min-width: 601px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    background-attachment: fixed;
  }
  .container {
    margin: 0;
  }
}

/* Mobil: starta från toppen */
@media (max-width: 600px) {
  body {
    display: block;
    padding: 20px 20px;
    min-height: 90dvh;
    background-attachment: fixed;
  }
  .container {
    margin: 0 auto;
  }
}


/* =========================================================
   Headings
   --------------------------------------------------------- */
h1 {
  line-height: 130%;
  text-align: center;
  font-weight: 500;
  font-size: clamp(40px, 2vw, 50px);
  margin-bottom: 1rem;
  margin-top: 1rem;
  color: #acacac;
}

.gradient-title {
  text-align: center;
  font-weight: 900;
  font-size: clamp(70px, 7vw, 75px);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

sup {
  rotate: -90deg;
  display: inline-block;
  margin-left: -10px;
  padding-top: 5px;
  font-size: 1.6rem;
}


/* =========================================================
   Intro Text
   --------------------------------------------------------- */
.intro {
  text-align: center;
  color: #555;
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}


/* =========================================================
   Form Layout
   --------------------------------------------------------- */
.form-group {
  position: relative;
  margin-bottom: 1.4rem;
}

input[type="tel"],
input[type="text"],
input[type="number"] {
  font-family: 'Fredoka';
  width: 100%;
  padding: 14px;
  font-size: 18px;
  border: 1px solid #ccc;
  border-radius: 100px;
  background: #fafafa;
  outline: none;
  transition: border 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
  height: 60px;
  line-height: 60px;
  text-align: center;
}

input:focus {
    border-color: #daa553;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(213, 60, 103, 0.15);
}

.form-group label {
  position: absolute;
  top: 20px;
  left: 50%;
  color: #888;
  font-size: 16px;
  transition: all 0.2s ease;
  pointer-events: none;
  transform: translateX(-50%);
}

input:focus + label,
input:not(:placeholder-shown) + label {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  padding: 0 6px;
  font-size: 12px;
  color: #888;
  text-align: center;
  width: max-content;
}


/* =========================================================
   Form Row
   --------------------------------------------------------- */
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 1.4rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}


/* =========================================================
   Checkboxes
   --------------------------------------------------------- */
.checkboxes {
    display: flex;
    flex-direction: row;
    gap: 30px;
    font-size: 14px;
    margin-top: 6px;
    color: #555;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .checkboxes label {
    font-size: 16px;
    color: #000;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  fieldset {
    border: 1px solid #cccccc;
    background-color: #fafafa;
    border-radius: 100px;
    padding: 15px 15px 0 15px;
    margin-bottom: 25px;
  }

  legend {
    font-size: 16px;
    color: #888;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  input[type="checkbox"] {
    accent-color: var(--accent);
    transform: scale(1.8);
  }

  /* Info-ikon */
  .info-icon {
    position: relative;
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #bbb;
    color: white;
    font-size: 12px;
    font-weight: bold;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
  }

  .info-icon:hover {
    background-color: var(--accent, #007bff);
  }

  /* Tooltip */
  .info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #b1b1b1;
    color: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    font-weight: 500;
}

  .info-icon:hover::after,
  .info-icon:focus::after,
  .info-icon:active::after {
    opacity: 1;
  }

/* =========================================================
   Buttons
   --------------------------------------------------------- */
button {
  font-family: 'Fredoka';
  width: 100%;
  padding: 14px;
  font-size: 16px;
  border: none;
  border-radius: 100px;
  background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  text-transform: uppercase;
}

button:hover {
    box-shadow: 0 4px 10px rgb(220 170 92);
    transform: translateY(-1px);
}

#generate-button {
  height: 75px;
  font-size: 26px;
}

#button-container {
  display: none;
  margin-top: 25px;
  gap: 10px;
  justify-content: space-between;
}

#copy-button,
#test-button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

#copy-button {
  background: var(--primary);
  color: white;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

#copy-button:hover {
  background: --accent-dark;
  transform: translateY(-1px);
}

#test-button {
  background: var(--accent);
  color: white;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

#test-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.fa-classic,
.fa-regular,
.fa-solid,
.far,
.fas {
  margin-right: 5px;
}


/* =========================================================
   Counters & Feedback
   --------------------------------------------------------- */
#char-count,
#number-count {
  display: block;
  text-align: center;
  font-size: 12px;
  margin-top: 2px;
}

#minimum-amount {
  text-align: center;
  display: block;
}

#swish-url {
    text-align: center;
    display: none;
    margin-top: 20px;
    padding: 25px;
    border: 1px solid #cdeed8;
    border-radius: 8px;
    font-size: 14px;
    word-break: break-all;
    color: #14532d;
    background-image: linear-gradient(135deg, #d53369 0%, #daae51 100%);
}

#swish-url strong {
  margin-bottom: 5px;
  display: inline-block;
}

#qrcode {
    margin: 25px;
    display: flex;
    justify-content: center;
}	

#qrcode img {
    padding: 15px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}


/* =========================================================
   Modal Styles
   --------------------------------------------------------- */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  border-radius: 15px;
  padding: 35px;
  max-width: 500px;
  margin: 20px;
  text-align: center;
  font-family: "Fredoka", sans-serif;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
}

.modal-content a {
  color: var(--primary);
  text-decoration: none;
}

.modal-content a:hover {
  color: var(--primary-dark);
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  color: #555;
  cursor: pointer;
}

.close-modal-qr {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 24px;
  color: #555;
  cursor: pointer;
}

.developer-links {
  margin-top: 30px;
  font-size: 1rem;
  text-align: center;
}

.developer-links a {
  color: #858585;
  text-decoration: none;
}

.developer-links a:hover {
  color: var(--primary-dark);
}

#snackbar, #test-snackbar {
  visibility: hidden;
  min-width: 250px;
  max-height: 20px;
  background-color: var(--primary);
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 14px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  top: 50px;
  transform: translateX(-50%);
  font-size: 16px;
}

#snackbar.show, #test-snackbar.show {
  visibility: visible;
  animation: fadein 1s, fadeout 1s 5s forwards;
}

@keyframes fadein {
  from { bottom: 0; opacity: 0; }
  to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
  from { bottom: 30px; opacity: 1; }
  to { bottom: 0; opacity: 0; }
}


/* =========================================================
   Developer Credit (visible footer)
   ========================================================= */
.developer {
  margin-top: 50px;
  text-align: center;
  font-size: 12px;
  color: #555;
}

.fa-solid {
    background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.fa-bolt {
    background: #fff;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.developer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.developer-link:hover {
  color: var(--primary-dark);
}

#counter {
  text-align: center;
  margin-top: 20px;
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #888;
}

#linkCount {
  font-weight: bold;
  font-size: 2rem;
  background: linear-gradient(135deg, #d53369 0%, #daae51 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
