:root {
  /* Core Colors */
  --primary-color: #7B61FF;
  /* Vibrant Purple */
  --primary-hover: #6248e5;
  --secondary-color: #00D2D3;
  /* Cyan Accent */

  /* Light Mode Defaults */
  --bg-body: #F7F9FC;
  --bg-card: #FFFFFF;
  --text-main: #1A1A1A;
  --text-muted: #666666;
  --border-color: #E0E0E0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --input-bg: #F0F2F5;

  /* Typography */
  --font-main: 'Outfit', sans-serif;
}

[data-theme="dark"] {
  --bg-body: #0F1216;
  --bg-card: #1E2329;
  --text-main: #FFFFFF;
  --text-muted: #A0A0A0;
  --border-color: #2D333B;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --input-bg: #2C313A;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span {
  color: var(--text-main);
}

nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary-color);
}

.btn-theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-main);
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-theme-toggle:hover {
  background-color: var(--input-bg);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 1rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}


/* Sticky Controls */
.controls-sticky-wrapper {
  position: sticky;
  top: 70px;
  /* Adjust based on header height */
  z-index: 90;
  padding: 10px 0;
  margin-bottom: 20px;
  background-color: var(--bg-body);
  /* crucial for content below to slide under */
  transition: background-color 0.3s ease;
}
.results-wrapper {
	max-width:800px;
	margin:0 auto;
}
.generator-box {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  /* Full width as requested */
  margin: 0 auto;
  border: 1px solid var(--border-color);
}

.input-group {
  display: flex;
  gap: 12px;
  margin-bottom: 1rem;
}

/* Tabs */
.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  /* More space for scrollbar */
}

/* Style the scrollbar nicely instead of hiding it */
.category-tabs::-webkit-scrollbar {
  height: 6px;
}

.category-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.category-tabs::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 20px;
}


.tab-btn {
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 50px;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: var(--bg-body);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.tab-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(123, 97, 255, 0.3);
}

/* Remove old headers inside grid as tabs replace them */
/* Category headers visible for scroll navigation */
.category-header {
  display: block;
  scroll-margin-top: 280px;
  /* Reduced to fit tighter against sticky header */
}


input[type="text"] {
  flex: 1;
  min-width: 0;
  /* key for flex shrinking */
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-size: 1.1rem;
  background-color: var(--input-bg);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
}

.btn-generate {
  padding: 0 2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.btn-generate:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-generate:active {
  transform: translateY(0);
}

.btn-icon {
  display: none;
}

/* Output Results */
.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  /* Force 1 column per row */
  gap: 16px;
}

.category-header {
  grid-column: 1 / -1;
  /* Span full width */
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 8px;
}

.result-card {
  background: var(--input-bg);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  max-width:800px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
  position: relative;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.style-preview {
  font-size: 1.2rem;
  font-weight: 500;
  word-break: break-all;
}

.copy-icon {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--text-main);
  color: var(--bg-card);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Footer */
footer {
  margin-top: 4rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
}


/* --- Rich Content Section Styles --- */
.content-article {
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-main);
  line-height: 1.6;
}

.intro-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 2rem 0;
}

.feature-box {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: transform 0.2s;
}

.feature-box:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.feature-box h3 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.feature-box p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Steps */
.steps-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 2rem 0;
}

.step {
  flex: 1;
  min-width: 200px;
  background: var(--input-bg);
  padding: 1.5rem;
  border-radius: 12px;
  position: relative;
  border: 1px solid var(--border-color);
}

.step-num {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: bold;
  margin-bottom: 10px;
}

/* Table */
.comparison-table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  min-width: 500px;
}

.comparison-table th,
.comparison-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
  background: var(--input-bg);
  font-weight: 600;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover {
  background: var(--input-bg);
}

/* FAQ */
.faq-section {
  margin-top: 1rem;
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h4 {
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.faq-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Mobile */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  /* Ensure input group stays consistent */
  .input-group {
    flex-direction: row;
    /* Force row on mobile */
  }

  input[type="text"] {
    padding: 1rem 0.8rem;
    /* Smaller padding on mobile */
    min-width: 0;
    /* Allow shrinking */
  }


  /* Compact button on mobile */
  .btn-generate {
    width: auto;
    padding: 0 1.2rem;
    min-width: 50px;
  }

  .btn-text {
    display: none;
  }

  .btn-icon {
    display: inline;
    font-size: 1.2rem;
  }

  .nav-wrapper {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0 10px;
  }

  .logo {
    font-size: 1.2rem;
    /* Smaller logo */
    white-space: nowrap;
  }

  nav {
    flex: 1;
    min-width: 0;
    /* Allow shrinking for scroll */
    margin: 0 5px;
    border-right: 1px solid var(--border-color);
    /* Separator */
    padding-right: 5px;
  }

  nav ul {
    flex-wrap: nowrap;
    /* Prevent wrapping */
    overflow-x: auto;
    /* Allow scroll if screen is very small */
    justify-content: flex-start;
    /* Align left to start near logo */
    gap: 12px;
    /* Tighter gap */
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    /* Ensure it takes full width */
    scrollbar-width: none;
  }

  nav ul::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for cleaner look on mobile nav */
  }

  nav a,
  .btn-theme-toggle {
    font-size: 0.95rem;
    /* Slightly smaller text */
    white-space: nowrap;
  }

  /* Reset grid for mobile to prevent overflow */
  .results-grid {
    grid-template-columns: 1fr;
  }
}