/* Cursed Text Generator - Custom Styles */

/* Main Layout */
.cursed-generator {
  padding-top: 80px;
  padding-bottom: 3rem;
  min-height: 100vh;
}

.cursed-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.cursed-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  color: var(--foreground);
}

.cursed-description {
  font-size: 1rem;
  color: var(--muted-foreground);
  max-width: 48rem;
  margin: 0 auto;
  line-height: 1.6;
}

/* Generator Section */
.generator-section {
  max-width: 900px;
  margin: 0 auto;
}

/* Input Area */
.input-area {
  margin-bottom: 1rem;
}

#text-input {
  width: 100%;
  min-height: 80px;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  background: var(--card);
  color: var(--foreground);
  resize: vertical;
  transition: all 0.2s;
}

#text-input:focus {
  outline: none;
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] #text-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  gap: 1rem;
}

.char-count {
  font-size: 14px;
  color: var(--muted-foreground);
}

#char-count {
  font-weight: 600;
  color: var(--foreground);
}

/* Chaos Control */
.chaos-control {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.chaos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chaos-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chaos-icon {
  font-size: 24px;
}

#chaos-value {
  color: var(--foreground);
  font-weight: 700;
  min-width: 3ch;
  display: inline-block;
  text-align: right;
}

.chaos-presets {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.preset-btn:hover {
  background: var(--secondary);
  border-color: var(--foreground);
  transform: scale(1.02);
}

.preset-btn.active {
  background: var(--foreground);
  color: white;
  border-color: var(--foreground);
}

.chaos-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  cursor: pointer;
  margin-bottom: 0.75rem;
}

.chaos-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--muted-foreground) 0%, var(--foreground) 100%);
}

.chaos-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--foreground);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  border: 3px solid var(--background);
  margin-top: -7px;
}

.chaos-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--muted-foreground) 0%, var(--foreground) 100%);
}

.chaos-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--foreground);
  cursor: pointer;
  border: 3px solid var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.chaos-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.chaos-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
}

.chaos-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted-foreground);
  font-weight: 500;
}

/* Output Area */
.output-area {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.output-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
}

.copy-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--foreground);
  color: white;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-main-btn:hover {
  transform: scale(1.02);
}

.copy-main-btn:active {
  transform: scale(0.98);
}

.copy-main-btn.copied {
  background: #10b981;
}

.output-text {
  font-size: 24px;
  line-height: 2.5;
  word-wrap: break-word;
  word-break: break-word;
  color: var(--foreground);
  min-height: 80px;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 12px;
  border: 1px solid var(--border);
  user-select: text;
  overflow-wrap: break-word;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

.output-text.empty {
  color: var(--muted-foreground);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: italic;
}

/* Styles Section */
.styles-section {
  margin-top: 0;
}

.styles-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.styles-icon {
  font-size: 20px;
}

.styles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.style-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.style-card:hover {
  border-color: var(--foreground);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .style-card:hover {
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.style-card:active {
  transform: translateY(0);
}

.style-header {
  display: none;
}

.style-info {
  flex: 1;
}

.style-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.style-description {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.style-intensity {
  font-size: 11px;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  background: var(--secondary);
  color: var(--foreground);
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.style-preview {
  font-size: 18px;
  line-height: 2.5;
  word-wrap: break-word;
  word-break: break-word;
  color: #ffffff;
  overflow-wrap: break-word;
  font-family: 'Arial Unicode MS', Arial, 'Noto Sans', 'DejaVu Sans', sans-serif;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0;
  padding: 1rem;
  padding-right: 5rem;
  background: #1a1a1a;
  border-radius: 12px;
  border: none;
  text-align: left;
}

.style-card .copy-btn {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  padding: 0.6rem 1.25rem;
  background: #4b5563;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  opacity: 1;
  transition: all 0.2s;
  z-index: 10;
}

.style-card:hover .copy-btn {
  background: #6b7280;
}

.style-card .copy-btn:hover {
  background: var(--foreground);
  color: var(--background);
  transform: translateY(-50%) scale(1.05);
}

.style-card .copy-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.style-card .copy-btn.copied {
  background: #10b981;
  color: white;
}

/* Empty state */
.styles-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted-foreground);
}

.styles-empty-icon {
  font-size: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.styles-empty-text {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.styles-empty-subtext {
  font-size: 14px;
  opacity: 0.7;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--foreground);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(1rem);
  transition: all 0.3s;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Content Sections */
.content-section {
  padding: 5rem 0;
}

.content-section:nth-child(even) {
  background: var(--secondary);
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 600;
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-intro {
  text-align: center;
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 48rem;
  margin: 0 auto 3rem;
  line-height: 1.6;
}

.section-content {
  max-width: 48rem;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--foreground);
}

.section-content p {
  margin-bottom: 1.5rem;
}

.section-content strong {
  font-weight: 600;
  color: var(--foreground);
}

.section-content code {
  background: var(--secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

/* Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.step-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.2s;
}

.step-card:hover {
  transform: translateY(-4px);
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--foreground);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 1.5rem;
}

.step-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.step-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

/* Use Cases Grid */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.use-case {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  transition: transform 0.2s;
}

.use-case:hover {
  transform: translateY(-4px);
}

.use-case-icon {
  font-size: 48px;
  margin-bottom: 1.5rem;
}

.use-case h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
}

.use-case p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted-foreground);
}

/* FAQ Grid */
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.faq-item {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
}

.faq-item h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--foreground);
  line-height: 1.4;
}

.faq-item p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted-foreground);
}

/* Responsive */
@media (max-width: 768px) {
  .cursed-generator {
    padding-top: 6rem;
    padding-bottom: 3rem;
  }

  .cursed-title {
    font-size: 1.75rem;
  }

  .cursed-description {
    font-size: 1rem;
  }

  .generator-section {
    padding: 0 1rem;
  }

  .chaos-control {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .chaos-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .chaos-presets {
    width: 100%;
    justify-content: flex-start;
  }

  .preset-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 13px;
  }

  .output-area {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .output-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .copy-main-btn {
    width: 100%;
    justify-content: center;
  }

  .output-text {
    font-size: 20px;
    padding: 1rem;
  }

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

  .style-preview {
    font-size: 18px;
    line-height: 2.2;
    min-height: 70px;
  }

  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    text-align: center;
  }

  .content-section {
    padding: 3rem 0;
  }

  .steps-grid,
  .use-cases-grid,
  .faq-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .step-card,
  .use-case,
  .faq-item {
    padding: 1.5rem;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .cursed-generator {
    padding-top: 5rem;
  }

  .cursed-title {
    font-size: 1.5rem;
  }

  .chaos-control {
    padding: 1rem;
  }

  .preset-btn {
    font-size: 12px;
    padding: 0.4rem 0.5rem;
  }

  .output-area {
    padding: 1rem;
  }

  .output-text {
    font-size: 18px;
    line-height: 2.2;
    padding: 0.75rem;
  }

  .style-card {
    padding: 1.25rem;
  }

  .style-preview {
    font-size: 16px;
    line-height: 2;
    min-height: 60px;
    padding: 0.75rem;
  }

  .style-card .copy-btn {
    opacity: 1;
    transform: scale(1);
    font-size: 11px;
    padding: 0.4rem 0.8rem;
  }

  .section-title {
    font-size: 1.5rem;
  }
}

/* Dark mode fixes for cursed text generator */
[data-theme="dark"] .preset-btn.active {
  background: var(--foreground);
  color: var(--background);
}

[data-theme="dark"] .copy-main-btn {
  background: var(--foreground);
  color: var(--background);
}

[data-theme="dark"] .toast {
  background: var(--foreground);
  color: var(--background);
}

[data-theme="dark"] .step-number {
  background: var(--foreground);
  color: var(--background);
}


[data-theme="dark"] .style-card .copy-btn:hover {
  background: var(--foreground);
  color: var(--background);
}
