:root {
  --bg-color: #f5f5f5;
  --text-color: #111;
  --container-bg: #ffffff;
  --accent-color: #10a37f;
  --input-bg: #ffffff;
  --input-border: #e0e0e0;
  --popup-text-light: #111;
  --gold-color: #ffd700;
}

[data-theme='dark'] {
  --bg-color: #101010;
  --text-color: #e2e2e2;
  --container-bg: #1c1c1c;
  --accent-color: #10a37f;
  --input-bg: #2b2b2b;
  --input-border: #444;
  --popup-text-light: #e2e2e2;
  --gold-color: #ffd700;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  height: 100%;
}

body, button, .symbol-box, #result {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  width: 100%;
  max-width: 700px;
  background-color: var(--container-bg);
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  margin: 2rem;
}

h1 {
  text-align: center;
  font-weight: 600;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  -webkit-user-select: text;
  user-select: text;
}

/* Input wrapper - clean single container */
.input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 1rem;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

/* Soft blue focus effect that disappears after generation */
.input-wrapper:focus-within:not(.generated) {
  border-color: rgba(16, 163, 127, 0.3);
  box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.1);
}

.input-wrapper input {
  flex: 1;
  font-size: 1rem;
  padding: 0.9rem 0.75rem 0.9rem 1rem;
  border: none;
  background-color: transparent;
  color: var(--text-color);
  outline: none;
  user-select: text;
  min-width: 0;
}

.input-left {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 1rem 0 0;
  min-width: 0;
  gap: 0.5rem;
}

/* Divider between char counter and generator button */
.divider {
  height: 24px;
  width: 1px;
  background-color: var(--input-border);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

#charCount {
  font-size: 0.85rem;
  color: #888;
  user-select: none;
  pointer-events: auto;
  cursor: pointer;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  min-width: 2.5rem;
  text-align: right;
  transition: color 0.2s ease;
}

#charCount:hover {
  color: var(--accent-color);
}

#charCount:active {
  transform: scale(0.95);
}

.action-button {
  background: transparent;
  color: var(--text-color);
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  transition: all 0.2s ease;
  user-select: none;
  height: 100%;
  flex-shrink: 0;
  transform: translateX(-0.1rem);
}

/* Special style for 0/7 button - smaller and without color */
.action-button.mode-switch-btn {
  font-size: 1rem;
  font-weight: 500;
  color: #888;
  transform: translateX(-0.1rem);
  padding: 0.5rem 0.6rem;
}

.action-button.mode-switch-btn:hover {
  color: var(--accent-color);
  transform: translateX(-0.1rem) scale(1.05);
}

.action-button.mode-switch-btn:active {
  transform: translateX(-0.1rem) scale(0.98);
}

.action-button:hover {
  color: var(--accent-color);
  transform: translateX(-0.1rem) scale(1.1);
}

.action-button:active {
  transform: translateX(-0.1rem) scale(0.95);
}

#result {
  margin-top: 1.5rem;
  font-size: 1.6rem;
  color: var(--accent-color);
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease, height 0.3s ease;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 0;
  overflow: hidden;
  flex-wrap: wrap;
  gap: 0.25rem;
}

#result.visible {
  opacity: 1;
  height: auto;
  min-height: 2.5rem;
}

#result .base-name, #result .symbol {
  user-select: none;
  display: inline-block;
  text-decoration: none;
}

/* Remove any possible underlines or borders */
#result span {
  text-decoration: none;
  border: none;
  outline: none;
}

/* Animation effects for symbols */
.symbol {
  display: inline-block;
  will-change: transform, opacity, color;
}

/* SINGLE CLICK Animation - Smooth Rotate */
.symbol.click-animation {
  animation: smoothRotate 0.4s ease-out;
}

@keyframes smoothRotate {
  0% { 
    transform: rotate(0deg) scale(1); 
  }
  50% { 
    transform: rotate(8deg) scale(1.1); 
    color: var(--accent-color);
  }
  100% { 
    transform: rotate(0deg) scale(1); 
    color: var(--accent-color);
  }
}

/* SCROLL DOWN Animation - Smooth slide from top */
.symbol.scroll-down-animation {
  animation: smoothSlideDown 0.25s ease-out;
}

@keyframes smoothSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* SCROLL UP Animation - Smooth slide from bottom */
.symbol.scroll-up-animation {
  animation: smoothSlideUp 0.25s ease-out;
}

@keyframes smoothSlideUp {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DOUBLE CLICK Animation - Gold pulse for premium symbols */
.symbol.double-click-animation {
  animation: goldPulse 0.4s ease-out;
}

@keyframes goldPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); color: var(--gold-color); }
  70% { transform: scale(1.05); color: var(--accent-color); }
  100% { transform: scale(1); color: var(--accent-color); }
}

/* RAPID CLICK Animation - Quick pulse */
.symbol.rapid-click-animation {
  animation: quickPulse 0.2s ease-out;
}

@keyframes quickPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); color: var(--accent-color); }
  100% { transform: scale(1); color: var(--accent-color); }
}

.note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  user-select: none;
}

.symbol-box {
  margin-top: 1.5rem;
  padding: 0.5rem 1rem;
  border: 1px dashed var(--text-color);
  border-radius: 0.5rem;
  text-align: center;
  font-size: 1rem;
  cursor: pointer;
}

.theme-toggle {
  margin-top: 2rem;
  text-align: center;
}

.theme-icon {
  font-size: 1.3rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.theme-icon:hover {
  transform: rotate(20deg);
}

.credit {
  margin-top: 1rem;
  font-size: 1rem;
  text-align: center;
  font-weight: 600;
  color: #ff5e5e;
  animation: colorChange 2s infinite alternate;
  display: flex;
  justify-content: center;
  align-items: center;
}

.credit-label {
  font-size: 1rem;
  color: #bbb;
  margin-right: 0.5rem;
}

.credit-name {
  font-size: 1rem;
  font-weight: 600;
  animation: colorChange 2s infinite alternate;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.2s ease;
}

.credit-name.clicked {
  color: var(--accent-color);
  transform: scale(1.05);
}

@keyframes colorChange {
  0% { color: #10a37f; }
  50% { color: #f5a623; }
  100% { color: #e94e77; }
}

.copied-message {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--accent-color);
  text-align: center;
  display: none;
}

/* Mobile Styles */
@media (max-width: 600px) {
  .container {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .input-wrapper input {
    padding: 0.8rem 0.5rem 0.8rem 0.75rem;
    font-size: 0.95rem;
  }
  
  .input-left {
    padding: 0 0.4rem 0 0;
    gap: 0.15rem;
  }
  
  .divider {
    height: 20px;
    margin: 0 0.3rem;
  }
  
  #charCount {
    font-size: 0.8rem;
    min-width: 2rem;
  }
  
  .action-button {
    padding: 0.5rem 0.6rem;
    font-size: 1.3rem;
    transform: translateX(-0.05rem);
  }
  
  .action-button.mode-switch-btn {
    font-size: 0.9rem;
    padding: 0.5rem 0.5rem;
  }
  
  .action-button:hover {
    transform: translateX(-0.05rem) scale(1.1);
    cursor: pointer;
  }
  
  .action-button:active {
    transform: translateX(-0.05rem) scale(0.95);
  }
  
  /* Keep original font size on mobile - 1.6rem */
  #result {
    font-size: 1.6rem;
  }
}

input::placeholder {
  color: #888;
}

/* Popup Styles */
.popup-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

@keyframes holeVanish {
  0% { 
    opacity: 1;
    clip-path: circle(100% at var(--mouse-x) var(--mouse-y));
  }
  100% { 
    opacity: 0;
    clip-path: circle(0% at var(--mouse-x) var(--mouse-y));
  }
}

.popup-content {
  background-color: transparent;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 400px;
  width: 90%;
  position: relative;
  text-align: center;
  color: white;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

:root:not([data-theme='dark']) .popup-content h3 {
  color: #ff4d4d !important;
  text-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 
               0 0 20px rgba(255, 77, 77, 0.3);
}

:root:not([data-theme='dark']) .popup-content p {
  color: #f0f0f0 !important;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

:root:not([data-theme='dark']) .popup-footer label {
  color: #f0f0f0 !important;
}

.popup-close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--accent-color);
  padding: 0.5rem;
  transition: all 0.3s ease;
  transform-origin: center;
}

.popup-close-btn:hover {
  transform: scale(1.2) rotate(90deg);
}

.popup-footer {
  display: flex;
  flex-direction: column;
  margin-top: 2rem;
}

.popup-footer label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  cursor: pointer;
  color: white;
}

#dontShowAgain {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent-color);
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

#loadingText {
  color: white;
  margin-top: 0.5rem;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.limit-warning {
  color: #ff4d4d !important;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

h1 {
  user-select: none;
  pointer-events: none;
}
