/* =========================================
GLOBAL VARIABLES
========================================= */
:root {
  /* Colors */
  --color-background: #181022;
  --color-text: #f1f5f9;
  --color-subtitle: #94a3b8;
  --color-primary: #7c2bee;
  --color-primary-light: #9f57ff;
  --color-border-light: rgba(124, 43, 238, 0.2);
  --color-border-lighter: rgba(124, 43, 238, 0.15);
  --color-step-bg: rgba(124, 43, 238, 0.2);
  --color-step-bg-hover: rgba(124, 43, 238, 0.08);
  --color-step-text: #b084ff;
  --color-input-bg: #0f172a;
  --color-input-border: #2d2047;
  --color-input-placeholder: #64748b;
  --color-icon: #a855f7;

  /* Font sizes */
  --font-h1: 44px;
  --font-h1-mobile: 34px;
  --font-subtitle: 18px;
  --font-subtitle-mobile: 16px;
  --font-button: 17px;
  --font-label: 12px;
  --font-step-number: 15px;
  --font-step-title: 17px;
  --font-step-text: 18px;
  --font-section-title: 25px;
  --font-related-tools-title: 22px;
  --font-footer: 14px;
}

/* =========================================
GLOBAL RESET
========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  background: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
}

/* =========================================
BODY & LAYOUT (Footer sticky)
========================================= */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* full viewport height */
}

.container {
  flex: 1; /* grows to fill space above footer */
}

/* =========================================
CONTAINER
========================================= */
.container {
  width: 90%;
  max-width: 720px;
  margin: 80px auto;
  text-align: center;
}

/* =========================================
TYPOGRAPHY
========================================= */
h1 {
  font-size: var(--font-h1);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.subtitle {
  font-size: var(--font-subtitle);
  color: var(--color-subtitle);
  margin-bottom: 40px;
}

/* =========================================
GENERATOR CARD
========================================= */
.generator {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-light);
  border-radius: 14px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* =========================================
INPUT
========================================= */
.input-label {
  text-align: left;
  font-size: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--color-primary);
}

.text-output {
  display: flex;
  flex-direction: column;
  gap: 8px; /* space between label and textarea */
  margin-top: 48px; /* space from encode button */
}

.text-output h3 {
  text-align: left;
  font-size: var(--font-label);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0; /* remove default h3 spacing */
}

.generator input,
.generator textarea {
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: 10px;
  padding: 16px;
  font-size: 16px;
  color: var(--color-text);
  width: 100%;
}

.generator input::placeholder {
  color: var(--color-input-placeholder);
}

.generator textarea {
  resize: vertical;
  min-height: 90px;
}

/*For output text*/
textarea {
  background: var(--color-input-bg);
  border: 1px solid var(--color-input-border);
  border-radius: 10px;
  padding: 16px;
  font-size: 16px;
  color: var(--color-text);
  width: 100%;
  resize: vertical;
}

/* =========================================
BUTTON + SPARKLES ON HOVER
========================================= */
button {
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-primary-light)
  );
  border: none;
  color: white;
  font-size: var(--font-button);
  font-weight: 700;
  padding: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  display: inline-flex;
  align-items: center; /* vertical centering */
  justify-content: center; /* horizontal centering */
  gap: 8px; /* space between text and icon */
  overflow: hidden;
  text-align: center; /* center text if wrapping */
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(124, 43, 238, 0.4);
}

/* Lucide icon stays white */
button .button-icon svg,
button .button-icon i {
  stroke: white;
  /*fill: white;*/
  width: 20px;
  height: 20px;
  display: inline-block;
  stroke-width: 2.2; /* default is usually 2, smaller = thinner */
}
/* =========================================
COLOR PICKERS (COLORED QR TOOL)
========================================= */

.color-picker-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-input-border);
  border-radius: 10px;
  padding: 14px;
}

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

/* Color preview square */
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--color-border-light);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.05);
}

/* Hide native color input */
.hidden-color-input {
  display: none;
}

/* =========================================
QR RESULT
========================================= */
.result {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#qrcode {
  margin-top: 20px;
  min-height: 260px;
  display: flex;
  justify-content: center;
  align-items: center;
}

canvas {
  max-width: 100%;
}

/* =========================================
TOOL BUTTON GRID USED IN CASE CONVERTER
========================================= */

.tool-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.tool-buttons button {
  width: 100%;
}

/* =========================================
TEXTAREA COPY BUTTON
========================================= */

.textarea-copy-container {
  position: relative;
}

.textarea-copy-container textarea {
  padding-right: 48px; /* space for icon */
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 36px;
  height: 36px;

  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;

  font-size: 14px;
}

.copy-btn svg {
  width: 18px;
  height: 18px;
}

/* =========================================
HOW IT WORKS / SEO CONTENT
========================================= */
.tool-info {
  max-width: 720px;
  margin: 80px auto;
  padding: 10px 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-section-title);
  font-weight: 700;
  margin-bottom: 28px;
}

.info-icon {
  color: var(--color-primary);
  font-size: var(--font-section-title);
  display: block; /* ensures baseline offset is removed */
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  transform: translateY(-0.18em); /* moves icon slightly higher */
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 10px;
  transition:
    background 0.2s ease,
    border 0.2s ease;
}

.step:hover {
  background: var(--color-step-bg-hover);
}

.step-number {
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-step-bg);
  color: var(--color-step-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-step-number);
}

.step-content {
  text-align: left;
}

.step-content h3 {
  font-size: var(--font-step-title);
  font-weight: 700;
  margin-bottom: 4px;
}

.step-content p {
  font-size: var(--font-step-text);
  color: var(--color-subtitle);
}

/* =========================================
RELATED TOOLS
========================================= */
.related-tools {
  margin-top: 60px;
}

.related-tools-title {
  display: flex;
  align-items: center;
  justify-content: space-between; /* title left, link right */
  gap: 10px;
  text-align: left; /* force left alignment */
  margin-bottom: 20px;
}

.related-tools-title h2 {
  font-size: var(--font-related-tools-title);
  margin: 0; /* remove default bottom margin if needed */
}

.related-tools-title .view-all {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.related-tools-title .view-all:hover {
  text-decoration: underline;
  align-items: center; /* vertically center relative to h2 */
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.tool-link {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border-lighter);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  text-align: left;
  align-items: center;
  gap: 10px;
}

.tool-icon svg {
  width: 25px;
  height: 25px;
  color: var(--color-icon);
}

.tool-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.tool-link:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  background: rgba(124, 43, 238, 0.05);
}

.related-tool-icon svg {
  width: 25px;
  height: 25px;
  color: var(--color-icon);
  vertical-align: middle; /* aligns icon to text center on Y axis */
}

/* =========================================
Privacy Policy
========================================= */

.privacy-section a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.privacy-page .container {
  text-align: left; /* left-align content only on privacy page */
}

.privacy-page h1 {
  margin-bottom: 24px; /* a bit more space under the main title */
}

.privacy-page h2 {
  margin-top: 40px; /* space above each section header */
  margin-bottom: 16px; /* space below the header for the text */
}

/* =========================================
LANGUAGE SWITCH
========================================= */
.language-switch {
  position: relative; /* no absolute positioning */
  text-align: right; /* aligns link to the right inside container */
  margin-bottom: 16px; /* optional spacing from top */
}

.language-switch a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.language-switch a:hover {
  text-decoration: underline;
}

/* =========================================
FOOTER
========================================= */
footer {
  margin-top: 80px;
  border-top: 1px solid rgba(124, 43, 238, 0.15);
  padding: 40px 20px;
  text-align: center;
  font-size: var(--font-footer);
  color: var(--color-subtitle);
}

footer a {
  color: var(--color-primary);
  text-decoration: none;
}

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

/* ========================================= 
COOKIE CONSENT MODAL 
========================================= */
.cookie-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
}
.cookie-modal.show {
  display: flex;
}
.cookie-modal-content {
  background: #0f172a;
  border: 1px solid rgba(124, 43, 238, 0.25);
  border-radius: 14px;
  max-width: 520px;
  width: 90%;
  padding: 28px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.cookie-modal-content h3 {
  text-align: center;
  margin-bottom: 20px;
}

.cookie-modal-content p {
  text-align: left;
}

.cookie-modal a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.cookie-modal a:hover {
  text-decoration: underline;
}

.cookie-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
}
.cookie-buttons button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}
.cookie-buttons button:hover {
  transform: translateY(-1px);
}
#accept-cookies-modal {
  background: var(--color-primary);
  color: white;
}
#decline-cookies-modal {
  background: #444;
  color: white;
}

/* =========================================
MOBILE
========================================= */
@media (max-width: 640px) {
  body {
    min-height: 100vh;
  }
  h1 {
    font-size: var(--font-h1-mobile);
  }

  .subtitle {
    font-size: var(--font-subtitle-mobile);
  }

  .generator {
    padding: 24px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }
}
