@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

:root {
  --bg-primary: #f8f9fa;
  --bg-secondary: #e9ecef;
  --bg-container: white;
  --text-primary: #343a40;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;
  --result-bg: #f8f9fa;
  --tag-bg: #e9ecef;
  --tag-text: #6c757d;
  --button-gradient: linear-gradient(90deg, #ff6b6b, #e83e8c);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --header-gradient: linear-gradient(90deg, #ff6b6b, #e83e8c, #6f42c1);
  --shadow-button: 0 4px 15px rgba(232, 62, 140, 0.3);
}

/* Change from [data-theme="dark"] to .dark-mode */
.dark-mode {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-container: #2d2d2d;
  --text-primary: #f8f9fa;
  --text-secondary: #ced4da;
  --text-tertiary: #adb5bd;
  --result-bg: #1e1e1e;
  --tag-bg: #383838;
  --tag-text: #ced4da;
  --button-gradient: linear-gradient(90deg, #ff6b6b, #e83e8c);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --header-gradient: linear-gradient(90deg, #ff6b6b, #e83e8c, #6f42c1);
  --shadow-button: 0 4px 15px rgba(232, 62, 140, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html, body {
  height: 100%;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

body {
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
}

.app-container {
  width: 90%;
  max-width: 550px;
  background-color: var(--bg-container);
  border-radius: 20px;
  box-shadow: 0 10px 30px var(--shadow-color);
  padding: 15px;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-height: 90vh;
}

.app-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: var(--header-gradient);
  border-radius: 20px 20px 0 0;
}

.content-wrapper {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5px;
  max-height: 80vh;
}

h1 {
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  font-weight: 700;
  font-size: 1.5rem;
  position: relative;
  display: inline-block;
}

h1 span {
  background: var(--button-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.description {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.button-container {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.button {
  background: var(--button-gradient);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-button);
  position: relative;
  overflow: hidden;
  width: 80%;
  max-width: 280px;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.button:hover, .button:active {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(232, 62, 140, 0.4);
}

.pulse-animation {
  animation: pulse 0.5s infinite;
}

.button:hover::before {
  left: 100%;
}

.button:active {
  transform: translateY(1px);
}

.result-container {
  background-color: var(--result-bg);
  border-radius: 15px;
  padding: 15px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.8rem;
}

.result-text {
  opacity: 1;
  transition: opacity 0.3s ease;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: center;
  width: 100%;
}

.credits {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.7rem;
}

.tag {
  display: inline-block;
  background-color: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 8px;
  border-radius: 50px;
  font-size: 0.75rem;
  margin: 3px;
  transition: all 0.3s ease;
}

.tag.active {
  background-color: #e83e8c;
  color: white;
}

.tag:hover, .tag:active {
  background-color: #e83e8c;
  color: white;
  cursor: pointer;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(232, 62, 140, 0.5);
}

.tags-container {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.heart-icon {
  color: #e83e8c;
  margin: 0 3px;
}

/* Erweiterte Feuerwerk-Effekte */
.pyro {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.pyro > .before, .pyro > .after {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0 0 #fff;
  animation: 1s bang ease-out infinite backwards, 1s gravity ease-in infinite backwards, 5s position linear infinite backwards;
  animation-duration: 1.25s, 1.25s, 6.25s;
}

.pyro > .after {
  animation-delay: 0.5s, 0.5s, 2s;
  animation-duration: 1.25s, 1.25s, 6.25s;
}

.pyro2 > .before, .pyro2 > .after {
  animation-delay: 0.25s, 0.25s, 1s;
  animation-duration: 1.5s, 1.5s, 5s;
}

.pyro3 > .before, .pyro3 > .after {
  animation-delay: 0.75s, 0.75s, 3s;
  animation-duration: 1.75s, 1.75s, 7s;
}

.pyro4 > .before, .pyro4 > .after {
  animation-delay: 0.1s, 0.1s, 0.5s;
  animation-duration: 1.3s, 1.3s, 5.5s;
}

.pyro5 > .before, .pyro5 > .after {
  animation-delay: 0.4s, 0.4s, 1.8s;
  animation-duration: 1.6s, 1.6s, 6.8s;
}

/* Verschiedene Feuerwerk-Farben */
.pyro.red > .before, .pyro.red > .after {
  box-shadow: 0 0 #ff0000;
}

.pyro.green > .before, .pyro.green > .after {
  box-shadow: 0 0 #00ff00;
}

.pyro.blue > .before, .pyro.blue > .after {
  box-shadow: 0 0 #00ffff;
}

.pyro.purple > .before, .pyro.purple > .after {
  box-shadow: 0 0 #ff00ff;
}

.pyro.gold > .before, .pyro.gold > .after {
  box-shadow: 0 0 #ffd700;
}

@keyframes bang {
  to {
    box-shadow:
      -70px -115.67px #00ff73, 41px -82.67px #ff6f00, 65px -196.67px #ff9100,
      -89px -179.67px #5900ff, 76px -238.67px #ffd500, -89px -96.67px #00ffa2,
      7px -164.67px #ff00bf, -127px -146.67px #ff006a, -30px -203.67px #ff9500,
      65px -4.67px #00eeff, 55px -28.67px #00ff8c, -113px -212.67px #00ff26,
      -25px -191.67px #00d0ff, 5px -108.67px #ff7b00, 30px 7.33px #ff007b,
      -77px 4.33px #ff006f, -4px -207.67px #b700ff, -8px -3.67px #ff0066,
      -15px -131.67px #5eff00, 62px -249.67px #00ff62, 120px -150px #ff0000,
      -120px -150px #0000ff, 200px -100px #00ff00, -200px -100px #ffff00,
      150px -220px #ff00ff, -150px -220px #00ffff, 180px -50px #aa00ff,
      -180px -50px #ff00aa, 100px -300px #aaff00, -100px -300px #00aaff,
      120px -100px #ff5500, -120px -100px #00ff55, 160px -180px #ff0088,
      -160px -180px #0088ff, 140px -240px #22ff00, -140px -240px #00ff22;
  }
}

@keyframes gravity {
  to {
    transform: translateY(200px);
    opacity: 0;
  }
}

@keyframes position {
  0%, 19.9% {
    margin-top: 5%;
    margin-left: 40%;
  }
  20%, 39.9% {
    margin-top: 15%;
    margin-left: 30%;
  }
  40%, 59.9% {
    margin-top: 10%;
    margin-left: 70%;
  }
  60%, 79.9% {
    margin-top: 20%;
    margin-left: 20%;
  }
  80%, 99.9% {
    margin-top: 15%;
    margin-left: 80%;
  }
}

/* Dark Mode Toggle */
.theme-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tag-bg);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.theme-switch:hover {
  transform: scale(1.1);
}

.theme-switch svg {
  width: 22px;
  height: 22px;
  fill: var(--text-secondary);
  transition: all 0.3s ease;
}

/* Verbesserte Touch-Unterstützung */
@media (hover: none) {
  .button:hover {
    transform: none;
  }

  .button:active {
    transform: scale(0.98);
  }
}

/* Responsives Design für kleine Bildschirme */
@media (max-height: 550px) {
  .app-container {
    padding: 10px;
  }

  h1 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
  }

  .description {
    font-size: 0.75rem;
    margin-bottom: 0.7rem;
  }

  .button {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .result-text {
    font-size: 0.9rem;
  }

  .result-container {
    min-height: 60px;
    padding: 10px;
  }

  .tag {
    padding: 2px 6px;
    font-size: 0.7rem;
  }
}
