/* ==========================================================================
   AI Username Generator - Core Design System & Styling
   Domain: aiusernamegenerator.com
   ========================================================================== */

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

:root {
  --bg-dark: #090a0f;
  --bg-card: #111420;
  --bg-card-hover: #181c2c;
  --bg-input: #161927;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --accent: #8b5cf6;
  --accent-cyan: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 16px 40px -10px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% -10%, #1e1b4b 0%, var(--bg-dark) 65%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-cyan);
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.logo-ai {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-right: 0.3rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: var(--primary-light);
}

.mobile-nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-nav-toggle:hover {
  background: var(--bg-card);
  border-color: var(--primary);
}

.btn-favorites {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.btn-favorites:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.fav-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* AdSense Container (Hidden until approved) */
.ad-slot {
  display: none !important;
}

.ad-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Generator Main Box */
.generator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  margin-bottom: 3rem;
}

.control-group {
  margin-bottom: 1.5rem;
}

.label-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
}

.text-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.text-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-generate {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.45);
}

/* Filter Chips Grid */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover,
.chip.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.switches-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.switch-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}

.switch-item input {
  accent-color: var(--primary);
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

/* Results Section */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
}

.result-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

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

.username-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  word-break: break-all;
  letter-spacing: -0.01em;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-action {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-action:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-fav.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(236, 72, 153, 0.12);
}

/* Availability Check Links Dropdown/Modal */
.availability-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.avail-link {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.avail-link:hover {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

/* Blog Card Component */
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  text-decoration: none;
}

.blog-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.blog-thumb-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: var(--bg-input);
}

.blog-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-thumb-wrapper img {
  transform: scale(1.04);
}

.blog-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-card-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.blog-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
  margin: 0;
  transition: color 0.2s ease;
}

.blog-card:hover .blog-card-title {
  color: var(--primary);
}

/* Blog Post Single Article Page Styling */
.blog-post-card {
  max-width: 920px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 3rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  word-break: break-word;
  overflow-wrap: break-word;
}

.blog-post-card h1 {
  color: #fff;
  font-size: 2.3rem;
  line-height: 1.3;
  margin: 0.5rem 0 1rem;
}

.blog-post-card h2 {
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 2.25rem 0 1rem;
  scroll-margin-top: 100px;
}

.blog-post-card h3 {
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.blog-post-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.35rem;
}

.blog-post-card ul,
.blog-post-card ol {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.8;
  margin: 0 0 1.5rem 1.5rem;
}

.blog-post-card li {
  margin-bottom: 0.5rem;
}

.blog-post-banner {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

/* Table of Contents Box */
.toc-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0 2.5rem;
}

.toc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0 !important;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-list a {
  color: var(--text-muted);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc-list a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* Callout Box inside Articles */
.callout-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}

.callout-box p {
  margin: 0;
  color: var(--text-main);
}

/* SEO Content Section */
.seo-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.seo-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

/* Page Card for Static Pages (About, Privacy, Terms, Contact) */
.page-card {
  max-width: 850px;
  margin: 0 auto;
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  word-break: break-word;
  overflow-wrap: break-word;
}

.page-card h1 {
  color: #fff;
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.page-card h2 {
  color: #fff;
  font-size: 1.5rem;
  margin: 1.75rem 0 0.75rem;
}

.page-card p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.page-card ul,
.page-card ol {
  color: var(--text-muted);
  margin: 0 0 1.5rem 1.5rem;
  line-height: 1.7;
}

.page-card code {
  background: var(--bg-input);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-cyan);
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 1.75rem 0 1rem;
  color: #fff;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 1.25rem 0 0.75rem;
  color: var(--text-main);
}

.article-content p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
}

.article-content ul,
.article-content ol {
  color: var(--text-muted);
  margin: 0 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* FAQ Accordion */
.faq-container {
  margin-top: 2rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.sidebar-box h4 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #fff;
}

/* Toast Alert */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Modal Favorites Drawer */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: none;
  justify-content: flex-end;
}

.modal-drawer {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--bg-dark);
  border-left: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Footer */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border-color);
  padding: 1.75rem 0;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

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

.footer-simple-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
}

.footer-simple-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.footer-simple-links a:hover {
  color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .header {
    padding: 0.8rem 0;
  }

  .container {
    padding: 0 0.85rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .nav-wrapper {
    position: relative;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.25rem;
    gap: 0.55rem;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }

  .logo-icon svg {
    width: 20px;
    height: 20px;
  }

  .mobile-nav-toggle {
    display: flex;
    padding: 0.4rem 0.6rem;
    flex-shrink: 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d091a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-top: 0.5rem;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .btn-generate {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    justify-content: center;
    gap: 1rem;
  }

  .footer-simple-links {
    justify-content: center;
    gap: 1rem 1.25rem;
  }

  .page-card {
    padding: 1.5rem 1rem;
  }

  .page-card h1 {
    font-size: 1.6rem;
  }

  .page-card h2 {
    font-size: 1.25rem;
  }

  .blog-post-card {
    padding: 1.5rem 1rem;
  }

  .blog-post-card h1 {
    font-size: 1.65rem;
  }

  .blog-post-card h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .logo {
    font-size: 1.18rem;
    gap: 0.5rem;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
  }

  .logo-icon svg {
    width: 20px;
    height: 20px;
  }

  .logo-ai {
    margin-right: 0.25rem;
  }
}

@media (max-width: 360px) {
  .logo {
    font-size: 1.08rem;
    gap: 0.4rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .logo-icon svg {
    width: 19px;
    height: 19px;
  }
}