/* TextWorld - Ultra Modern Light Theme Design */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Poppins:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  /* Advanced Light Theme Color System */
  --primary-color: #6366f1;
  --primary-light: #8b5cf6;
  --primary-dark: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --secondary-color: #06b6d4;
  --secondary-light: #67e8f9;
  --accent-color: #10b981;
  --accent-hover: #059669;
  
  /* Text Colors */
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-white: #ffffff;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f7fafc;
  --bg-tertiary: #edf2f7;
  --bg-card: #ffffff;
  --bg-overlay: rgba(255, 255, 255, 0.95);
  
  /* Border & Shadow */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.15);
  
  /* Animation */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
    /* Border Radius */  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  overflow-x: hidden;
}

/* Background Animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(240, 147, 251, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(79, 172, 254, 0.08) 0%, transparent 50%);
  z-index: -1;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

/* Header Styles */
.header {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-normal);
}

.header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  transition: transform var(--transition-normal);
}

.logo-link:hover {
  transform: scale(1.05);
}

.logo-image {
  height: 45px;
  width: auto;
  filter: drop-shadow(var(--shadow-sm));
}

.nav-button-container {
  display: flex;
  gap: var(--space-md);
}

.nav-button {
  padding: var(--space-sm) var(--space-lg);
  background: var(--primary-gradient);
  color: var(--text-white);
  text-decoration: none;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.nav-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left var(--transition-slow);
}

.nav-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.nav-button:hover::before {
  left: 100%;
}

/* Hero Section Styles */
.hero-section {
  position: relative;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  overflow: hidden;
  background: var(--primary-gradient);
  color: var(--text-white);
  border-radius: var(--radius-xl);
  margin: var(--space-xl) auto;
  box-shadow: var(--shadow-xl);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255,255,255,0.1) 0%, transparent 40%);
  opacity: 0.5;
  animation: pulseBackground 15s infinite ease-in-out;
}

@keyframes pulseBackground {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.7; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  animation: slideInDown 1s ease-out;
}

.hero-subtitle {
  font-size: 1.25rem;
  max-width: 700px;
  margin: 0 auto var(--space-lg);
  opacity: 0.9;
  animation: slideInUp 1s ease-out 0.2s;
  animation-fill-mode: backwards; /* Ensures subtitle is hidden before animation starts */
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
  animation: fadeIn 1s ease-out 0.5s;
  animation-fill-mode: backwards;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.hero-feature:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.25);
}

.hero-feature-icon {
  font-size: 1.5rem;
}

.hero-feature-text {
  font-weight: 500;
}


/* TextWorld Generator Section */
.textworld-generator-section {
  padding: var(--space-2xl) var(--space-xl);
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  margin: var(--space-xl) auto;
  box-shadow: var(--shadow-lg);
  max-width: 1200px; /* Consistent with old main-section */
}

.textworld-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.textworld-input-wrapper {
  position: sticky;
  top: calc(var(--header-height, 80px) + var(--space-md)); /* Adjust based on actual header height */
  z-index: 900;
  background: var(--bg-overlay);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  transition: transform var(--transition-normal);
}

#textworld-input {
  width: 100%;
  padding: var(--space-lg);
  font-size: 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

#textworld-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3), var(--shadow-glow);
}

.textworld-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0 var(--space-md); /* Align with input padding */
}

.textworld-controls label {
  font-weight: 500;
  color: var(--text-secondary);
}

#textworld-size-slider {
  flex-grow: 1;
  accent-color: var(--primary-color); /* Modern way to style range input track */
  cursor: pointer;
}

/* Custom styling for range input thumb (cross-browser) */
#textworld-size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}

#textworld-size-slider::-moz-range-thumb {
  width: 16px; /* Adjusted for Firefox */
  height: 16px;
  background: var(--primary-color);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}

.textworld-output-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-md);
}

.textworld-font-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.textworld-font-section:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.textworld-font-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: var(--space-xs);
  display: block;
}

.textworld-font-description {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: var(--space-xs);
}

.textworld-font-item {
  background: var(--bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-top: var(--space-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px; /* Ensure consistent height */
  overflow: hidden; /* Prevent text overflow issues */
}

.textworld-font-item:hover {
  background: var(--border-light);
}

.textworld-font-text {
  font-size: 20px; /* Default size, will be controlled by JS */
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
  margin-right: var(--space-sm);
}

.textworld-font-item:hover .textworld-font-text,
.textworld-font-item:focus .textworld-font-text {
  color: var(--primary-color); /* Highlight on hover/focus */
}

/* Copy Button Styles */
.textworld-copy-btn {
  background: var(--primary-gradient);
  color: var(--text-white);
  border: none;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  box-shadow: var(--shadow-sm);
}

.textworld-copy-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.textworld-copy-btn .copy-icon {
  font-size: 1rem;
}

.textworld-copy-btn .copy-text {
  display: inline;
}

.textworld-font-item.copied .textworld-copy-btn {
  background: var(--accent-color);
}

.textworld-font-item.copied .textworld-copy-btn .copy-text {
  display: none;
}

.textworld-font-item.copied .textworld-copy-btn::after {
  content: 'Copied! ✔';
}


/* Popup Notification Styles */
.popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--bg-overlay);
  backdrop-filter: blur(10px);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  text-align: center;
  opacity: 0;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  max-width: 90%;
  width: 400px;
}

.popup-content h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem; /* Adjusted for better fit */
  color: var(--primary-color);
  margin-bottom: var(--space-sm);
  word-break: break-all; /* Prevent overflow with long copied text */
}

.popup-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
}

.popup-content .ad-space { /* Placeholder for ad styling if needed */
  min-height: 50px; /* Example height */
  background: repeating-linear-gradient(
    45deg,
    var(--bg-tertiary),
    var(--bg-tertiary) 10px,
    var(--border-light) 10px,
    var(--border-light) 20px
  );
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
}
.popup-content .ad-space::before {
  content: "Ad Placeholder"; /* Visual cue */
}


/* Additional Symbol Categories (Copied from old inline style, needs class conversion) */
.additional-symbol-categories {
  padding: var(--space-xl) var(--space-xl);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  margin: var(--space-xl) auto;
  box-shadow: var(--shadow-md);
  max-width: 1200px;
}

.additional-symbol-categories .text-center { /* Assuming this class exists or is added */
  text-align: center;
}

.additional-symbol-categories .section-title { /* Assuming this class exists or is added */
  font-size: 2rem; /* Example size */
  color: var(--primary-dark);
  margin-bottom: var(--space-lg);
  font-family: 'Poppins', sans-serif;
}

.symbol-categories-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.symbol-category {
  background: var(--bg-card);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  min-width: 180px; /* Ensure items are not too squished */
  text-align: center;
}

.symbol-category:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.symbol-category a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  flex-direction: column; /* Stack icon and text */
  align-items: center;
  gap: var(--space-xs);
}

.symbol-category a span:first-child { /* The emoji/icon part */
  font-size: 1.5rem; /* Make icon larger */
  margin-right: 0; /* Remove old margin */
  margin-bottom: var(--space-xs); /* Add space below icon */
}

.symbol-category a span:last-child { /* The text part */
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* About Box Styles (Copied from old inline style, needs class conversion) */
.about-box {
  padding: var(--space-xl) var(--space-xl);
  background: var(--bg-secondary); /* Slightly different background for distinction */
  border-radius: var(--radius-lg);
  margin: var(--space-xl) auto;
  box-shadow: var(--shadow-inner, 0 2px 4px rgba(0,0,0,0.06) inset); /* Subtle inner shadow */
  max-width: 1200px;
}

.about-box .container.text-center { /* Ensure specificity or simplify class usage */
  margin-bottom: var(--space-lg);
}
.about-box .container.text-center:last-child {
  margin-bottom: 0;
}

.about-section-title,
.about-sub-section-title,
.about-faq-title {
  font-family: 'Poppins', sans-serif;
  color: var(--primary-dark);
  margin-bottom: var(--space-sm);
}

.about-section-title { font-size: 2rem; }
.about-sub-section-title { font-size: 1.5rem; margin-top: var(--space-lg); }
.about-faq-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-top: var(--space-md); }

.about-section-description,
.about-sub-section-description,
.about-faq-answer {
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.about-faq-answer {
  margin-bottom: var(--space-md);
}

.about-usage-steps,
.about-benefits-list {
  list-style-position: inside;
  padding-left: 0; /* Reset default padding */
  margin: var(--space-md) auto;
  max-width: 700px;
  text-align: left;
}

.about-usage-steps li,
.about-benefits-list li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.about-usage-steps li::marker,
.about-benefits-list li::marker {
  color: var(--primary-color);
  font-weight: 600;
}
.about-benefits-list { list-style-type: '✔ '; } /* Custom bullet */


/* Footer Styles */
.footer {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: var(--space-xl) var(--space-xl);
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: var(--space-2xl);
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.footer-text {
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  gap: var(--space-lg);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

.footer-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Animations */
@keyframes slideInDown {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2.5rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-features {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }
  
  .textworld-input-wrapper {
    position: static; /* Disable sticky on mobile for better layout */
  }
  .textworld-output-container {
    grid-template-columns: 1fr; /* Stack font items on smaller screens */
  }

  .nav-button-container {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .footer .container {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .textworld-controls {
    flex-direction: column;
    align-items: stretch;
  }
  #textworld-input {
    padding: var(--space-md);
    font-size: 1rem;
  }
  .popup {
    width: calc(100% - var(--space-lg)); /* Full width with some margin */
    padding: var(--space-lg);
  }
  .popup-content h2 {
    font-size: 1.2rem;
  }
}

/* Utility Classes (Optional, but can be helpful) */
.text-center {
  text-align: center;
}

/* Ensure header height variable is available for sticky calculations */
.header {
  /* ... other header styles ... */
  --header-height: 80px; /* Default, adjust if dynamic */
}
