body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f4f8;
  overflow-x: hidden;
  margin: 0;
  padding: 2rem;
  color: #333;
}

html {
  overflow-x: hidden;
}

.container {
  max-width: 900px;
  width: 100%;
  margin: auto;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.container2 {
  max-width: 900px;
  width: 100%;
  margin: auto;
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.settings {
  padding-right: 1rem;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;  
}

.form-group {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;  
}  

.form-group > div {
  flex: 1 1 100px;
  min-width: 100px;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-weight: bold;
}

input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.results {
  margin-top: 2rem;
  padding: 1rem;
  background: #e8f0fe;
  border-radius: 8px;
}

#resetButton {
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  margin-top: 1rem;
}

#resetButton:hover {
  background-color: #155fc3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.results p {
  font-size: 1.2rem;
}

#copyButton {
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  margin-top: 1rem;
  margin-right: 1rem;
}

#copyButton:hover {
  background-color: #155fc3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#downloadButton {
  background-color: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  margin-top: 1rem;
}

#downloadButton:hover {
  background-color: #155fc3;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#shareLink {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  font-size: 0.95rem;
  color: #333;
  word-break: break-word;
  margin-top: 1rem;
  display: inline-block;
  max-width: 100%;
}

.section-title {
  text-align: center;
  margin-bottom: 1rem;
}

.section-title::after {
  content: "";
  display: block;
  height: 2px;
  margin: 0.5rem auto 1rem;
  max-width: 300px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.5), transparent);
  opacity: 0.2;
}

h1 {
  color: #1e97e7;
  text-align: center;
}

h1::after {
  content: "";
  display: block;
  height: 2px;
  margin: 0.5rem auto 1.5rem;
  max-width: 500px;
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.5), transparent);
  opacity: 0.2;
}

.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #e8f0fe;
  color: #000000;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.85rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0s linear;
  transition-delay: 0s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transition-delay: 0.3s;
}

pre code {
  display: block;
  background-color: #f5f7fa;
  padding: 1rem;
  border-radius: 8px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
  color: #2d2d2d;
  overflow-x: auto;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 1;
  transition: opacity 0.3s ease;
  touch-action: none;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--popup-bg, #fff);
  color: var(--popup-text, #000);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  width: 85%;
  max-width: 400px;
  text-align: center;
  box-sizing: border-box;
}

.popup p {
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
  line-height: 1.5;
}

.popup-buttons {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
  flex: 1;
  min-width: 120px;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: #1a73e8;
  color: white;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #155fc3;
}

.btn-secondary {
  background-color: #ccc;
  color: #333;
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: #bbb;
}

.hidden {
  display: none;
}

.shortcut-hint {
  font-size: 0.7em;
  opacity: 0.6;
  margin-left: 0.2em;
}

.site-header {
    display: flex;
    align-items: center;
    padding: 0rem 1rem 1rem 1rem;
    background-color: transparent;
    box-sizing: border-box;
}

.logo-link {
    display: inline-block;
}

.site-logo {
    height: 40px;
    width: auto;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212;
    color: #e0e0e0;
  }

  .container {
    background: #1e1e1e;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  }

  .container2 {
    background: #1e1e1e;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  }

  input {
    background-color: #2c2c2c;
    color: #fff;
    border: 1px solid #555;
  }

  .results {
    background: #2c2c2c;
  }

  #resetButton {
    background-color: #2791e7;
    color: white;
  }
  
  #resetButton:hover {
    background-color: #1c54b2;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
  }

  #copyButton {
    background-color: #2791e7;
    color: white;
  }

  #copyButton:hover {
    background-color: #1c54b2;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
  }

  #shareLink {
    background-color: #2c2c2c;
    border-color: #555;
    color: #eee;
  }

  .section-title::after,
  h1::after {
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
  }

  h1 {
    color: #6cb8f7;
  }

  h2 {
      color: #54adf5;
  }

  label {
    color: #ccc;
  }

  input[type="number"]::-webkit-inner-spin-button,
  input[type="number"]::-webkit-outer-spin-button {
    background-color: #2c2c2c;
    border: none;
  }
  
  input[type="number"] {
    color-scheme: dark;
  }

  .tooltip::after {
    background-color: #222;
    color: #eeeeee;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
  }
  
  #downloadButton {
    background-color: #2791e7;
    color: white;
  }
  
  #downloadButton:hover {
    background-color: #1c54b2;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
  }
  
  pre code {
    background-color: #2c2c2c;
    color: #f1f1f1;
  }

  .popup {
    --popup-bg: #1e1e1e;
    --popup-text: #fff;
  }
  .btn-secondary {
    background-color: #555;
    color: #eee;
  }

  .btn-secondary:hover {
    background-color: #666;
  }

  .tooltip::after {
    background-color: #444;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 600px) {
  body {
    padding: 1rem;
  }

  .container, .container2 {
    padding: 1rem;
    border-radius: 8px;
  }

  .settings {
    padding-right: 1.5rem;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;  
  }
  
  .form-group {
    flex-direction: column;
    gap: 1rem;
  }

  .form-group > div {
    flex: 1 1 100%;
    min-width: 100%;
  }

  input {
    padding: 0.75rem;
    font-size: 1rem;
  }

  #resetButton, 
  #copyButton,
  #downloadButton {
    width: 100%;
    justify-content: center;
    font-size: 1.1rem;
    padding: 0.8rem;
  }

  #copyButton {
    margin-right: 0;
  }

  .results {
    padding: 1rem;
  }

  #shareLink {
    font-size: 1rem;
    padding: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .popup {
    padding: 1.5rem;
  }

  .popup-buttons {
    flex-direction: column;
  }

  .popup-buttons button {
    width: 100%;
  }

  .shortcut-hint {
    display: none;
  }

  .site-header {
    justify-content: center;
    padding: 1rem;
  }

  .site-logo {
    height: 40px;
  }
}