/* ==========================================================================
   CONVERTSTEXT - FLASHY & MODERN DESIGN SYSTEM (ADSENSE, AFFILIATE & MOBILE READY)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* --- Root Design Tokens (Light & Dark Themes) --- */
:root {
  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #6366f1;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.2);

  --accent-cyan: #0284c7;
  --accent-cyan-light: #e0f2fe;
  --accent-emerald: #059669;
  --accent-emerald-light: #d1fae5;
  --accent-violet: #7c3aed;
  --accent-violet-light: #ede9fe;
  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-rose: #e11d48;
  --accent-rose-light: #ffe4e6;

  --badge-standard: #e0e7ff;
  --badge-standard-text: #3730a3;
  --badge-dev: #fce7f3;
  --badge-dev-text: #9d174d;
  --badge-fancy: #fef3c7;
  --badge-fancy-text: #92400e;
  --badge-cipher: #ccfbf1;
  --badge-cipher-text: #115e59;
  --badge-cleaner: #f3e8ff;
  --badge-cleaner-text: #6b21a8;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --container-max: 1240px;
}

/* Color Palette - Dark Mode */
[data-theme="dark"] {
  --bg-primary: #080c14;
  --bg-secondary: #0d1322;
  --bg-tertiary: #162035;
  --bg-card: #111a2e;
  --bg-card-hover: #172440;
  --bg-input: #090e1a;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #080c14;

  --border-subtle: #1e2d4a;
  --border-medium: #334b73;
  --border-focus: #818cf8;

  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: #1e1b4b;
  --primary-glow: rgba(99, 102, 241, 0.4);

  --accent-cyan: #38bdf8;
  --accent-cyan-light: #082f49;
  --accent-emerald: #34d399;
  --accent-emerald-light: #064e3b;
  --accent-violet: #a78bfa;
  --accent-violet-light: #2e1065;
  --accent-amber: #fbbf24;
  --accent-amber-light: #451a03;
  --accent-rose: #fb7185;
  --accent-rose-light: #4c0519;

  --badge-standard: #1e1b4b;
  --badge-standard-text: #a5b4fc;
  --badge-dev: #4a044e;
  --badge-dev-text: #f472b6;
  --badge-fancy: #451a03;
  --badge-fancy-text: #fcd34d;
  --badge-cipher: #042f2e;
  --badge-cipher-text: #5eead4;
  --badge-cleaner: #3b0764;
  --badge-cleaner-text: #d8b4fe;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 32px rgba(99, 102, 241, 0.35);
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(236, 72, 153, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(56, 189, 248, 0.06) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

textarea, input, select {
  font-family: inherit;
  color: inherit;
  font-size: 16px;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (max-width: 480px) {
  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

/* ==========================================================================
   NAVIGATION BAR & RESPONSIVE MOBILE DRAWER
   ========================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(var(--bg-card), 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #4f46e5, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-accent {
  background: linear-gradient(135deg, var(--primary), #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition-fast);
  z-index: 100;
}

.nav-item:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.dropdown-link:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.dropdown-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  min-height: 38px;
}

.search-trigger-btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-card);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: rotate(15deg);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}

.nav-hamburger span {
  display: block;
  height: 2px;
  width: 18px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100vh - 64px);
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 3rem;
    display: none;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-item { width: 100%; border-bottom: 1px solid var(--border-subtle); }
  .nav-link { padding: 0.85rem 0.5rem; font-size: 1rem; font-weight: 600; width: 100%; justify-content: space-between; }
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    width: 100%;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    padding: 0.35rem;
  }
  .dropdown-link { padding: 0.65rem 0.75rem; font-size: 0.9rem; }
  .search-kbd { display: none; }
}

/* ==========================================================================
   HERO HEADER SECTION
   ========================================================================== */
.hero-section {
  padding: 2.25rem 0 1.25rem;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.825rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(79, 70, 229, 0.25);
  box-shadow: 0 2px 10px var(--primary-glow);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.hero-desc {
  font-size: clamp(0.925rem, 2vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   CONTEXTUAL AFFILIATE BOOSTER RIBBON
   ========================================================================== */
.affiliate-booster-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(5, 150, 105, 0.08));
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.booster-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.booster-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.booster-text {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.booster-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff !important;
  box-shadow: 0 2px 8px var(--primary-glow);
  transition: all var(--transition-fast);
}

.booster-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .affiliate-booster-ribbon {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .booster-content {
    justify-content: center;
  }
  .booster-btn {
    justify-content: center;
  }
}

/* ==========================================================================
   EXIT-INTENT MONETIZATION MODAL
   ========================================================================== */
.exit-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 10000;
}

.exit-modal-backdrop.open { display: flex; }

.exit-modal-box {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  text-align: center;
  position: relative;
  animation: modal-slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.exit-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

/* ==========================================================================
   GOOGLE ADSENSE COMPLIANT AD CONTAINERS
   ========================================================================== */
.ad-slot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1.75rem auto;
  text-align: center;
  max-width: 100%;
}

.ad-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.ad-box-leaderboard {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ad-box-rectangle {
  width: 100%;
  max-width: 300px;
  min-height: 250px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   STUDIO CONVERTER WORKSPACE
   ========================================================================== */
.converter-studio {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2rem;
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.3s ease;
}

.converter-studio:focus-within {
  box-shadow: var(--shadow-xl), 0 0 0 1px var(--primary);
}

/* Top Action Toolbar */
.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.toolbar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
  min-height: 36px;
}

.tool-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tool-btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.tool-btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.tool-btn-danger { color: var(--accent-rose); }
.tool-btn-danger:hover { background: var(--accent-rose-light); border-color: var(--accent-rose); }

.btn-recording {
  background: var(--accent-rose) !important;
  color: #fff !important;
  border-color: var(--accent-rose) !important;
  animation: pulse-recording 1.5s infinite;
}

.btn-active-speech {
  background: var(--accent-cyan) !important;
  color: #fff !important;
  border-color: var(--accent-cyan) !important;
}

@keyframes pulse-recording {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Editor Textarea Area */
.editor-wrapper {
  position: relative;
  background: var(--bg-input);
}

.editor-textarea {
  width: 100%;
  min-height: 200px;
  padding: 1.15rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
}

@media (max-width: 480px) {
  .editor-textarea {
    padding: 0.85rem;
    min-height: 180px;
  }
}

.editor-textarea::placeholder {
  color: var(--text-muted);
}

.editor-drop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(79, 70, 229, 0.15);
  border: 2px dashed var(--primary);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  z-index: 10;
  pointer-events: none;
}

.editor-wrapper.dragover .editor-drop-overlay { display: flex; }

.drop-message {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  background: var(--bg-card);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Live Stats Ribbon */
.stats-ribbon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .stats-ribbon {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem 0.75rem;
  }
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.readability-pill {
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  white-space: nowrap;
}

.badge-easy { background: var(--accent-emerald-light); color: var(--accent-emerald); }
.badge-standard { background: var(--primary-light); color: var(--primary); }
.badge-hard { background: var(--accent-amber-light); color: var(--accent-amber); }
.badge-academic { background: var(--accent-rose-light); color: var(--accent-rose); }

/* Conversion Actions Area */
.conversion-actions-area {
  padding: 1.25rem;
}

@media (max-width: 480px) {
  .conversion-actions-area {
    padding: 0.85rem;
  }
}

.category-filter-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.category-filter-nav::-webkit-scrollbar { height: 4px; }
.category-filter-nav::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 4px; }

.category-pill-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.category-pill-btn:hover, .category-pill-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.converter-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.65rem;
}

@media (max-width: 600px) {
  .converter-buttons-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

@media (max-width: 360px) {
  .converter-buttons-grid {
    grid-template-columns: 1fr;
  }
}

.convert-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  text-align: left;
}

.convert-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  box-shadow: 0 4px 16px var(--primary-glow);
  transform: translateY(-2px);
}

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

.btn-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.15rem;
}

.convert-btn-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.convert-btn-category {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.convert-btn-sample {
  font-family: var(--font-mono);
  font-size: 0.725rem;
  color: var(--primary);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.studio-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 600px) {
  .studio-bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .studio-bottom-bar .toolbar-group { justify-content: stretch; }
  .studio-bottom-bar .toolbar-group .tool-btn { flex: 1; }
}

.action-status-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   READABILITY & TEXT ANALYZER WIDGETS
   ========================================================================== */
.readability-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 480px) {
  .readability-cards-grid { grid-template-columns: 1fr; }
}

.readability-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.readability-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.readability-score-large {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 0.4rem 0;
}

.readability-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.readability-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Social Media Limit Counters */
.social-limits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .social-limits-grid { grid-template-columns: 1fr; }
}

.social-limit-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
}

.social-limit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.825rem;
  font-weight: 600;
}

.social-progress-bar {
  width: 100%;
  height: 7px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.social-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.2s ease, background-color 0.2s ease;
}

.social-progress-fill.limit-warning { background: var(--accent-amber); }
.social-progress-fill.limit-exceeded { background: var(--accent-rose); }

/* ==========================================================================
   MARKDOWN SPLIT PREVIEW STYLES
   ========================================================================== */
.markdown-preview-pane {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  min-height: 220px;
  max-height: 500px;
  overflow-y: auto;
  word-break: break-word;
}

.markdown-preview-pane h1, 
.markdown-preview-pane h2, 
.markdown-preview-pane h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.markdown-preview-pane p { margin-bottom: 0.75rem; }

.markdown-preview-pane code {
  background: var(--bg-tertiary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.markdown-preview-pane pre {
  background: var(--bg-tertiary);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin-bottom: 1rem;
}

/* ==========================================================================
   PASSWORD GENERATOR STRENGTH METER
   ========================================================================== */
.password-display-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 2px solid var(--primary);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-all;
  margin-bottom: 1.25rem;
}

.strength-bar-wrapper {
  display: flex;
  gap: 4px;
  height: 6px;
  margin-top: 0.4rem;
}

.strength-segment {
  flex: 1;
  background: var(--border-subtle);
  border-radius: 3px;
}

.strength-segment.active-weak { background: var(--accent-rose); }
.strength-segment.active-medium { background: var(--accent-amber); }
.strength-segment.active-strong { background: var(--accent-emerald); }

/* ==========================================================================
   TOOLS EXPLORER CARDS GRID
   ========================================================================== */
.section-header {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

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

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

.tool-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.tool-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.tool-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-grow: 1;
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

.tool-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--primary);
}

/* Tool Specialized Controls Panel */
.tool-controls-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 480px) {
  .tool-controls-panel {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.control-input, .control-select {
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
}

.control-input:focus, .control-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.dual-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (max-width: 860px) {
  .dual-editor-grid { grid-template-columns: 1fr; }
}

.dual-editor-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dual-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 0.85rem;
}

/* ==========================================================================
   INTERACTIVE FAQ ACCORDION STYLES
   ========================================================================== */
.faq-accordion-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.faq-accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-accordion-item:hover {
  border-color: var(--border-medium);
}

.faq-accordion-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.faq-accordion-icon {
  font-size: 1.1rem;
  color: var(--primary);
  transition: transform 0.25s ease;
}

.faq-accordion-item.active .faq-accordion-icon {
  transform: rotate(180deg);
}

.faq-accordion-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
  padding: 0 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-accordion-item.active .faq-accordion-answer {
  max-height: 500px;
  padding: 0 1.25rem 1rem;
}

/* ==========================================================================
   GDPR & CCPA COOKIE CONSENT BANNER
   ========================================================================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 1.25rem 1.5rem;
  z-index: 9999;
  display: none;
  animation: modal-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-consent-banner.show { display: block; }

.cookie-consent-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.cookie-consent-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.cookie-consent-buttons {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   CONTENT GUIDE SECTION & SEO
   ========================================================================== */
.content-guide-section {
  margin: 2.5rem 0;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.content-guide-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.content-guide-section h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.content-guide-section p, .content-guide-section ul {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.85rem;
}

.content-guide-section ul { padding-left: 1.25rem; }
.content-guide-section li { margin-bottom: 0.25rem; }

/* Global Search Modal Overlay */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
  z-index: 999;
}

@media (max-width: 480px) {
  .search-modal-backdrop { padding-top: 1rem; }
}

.search-modal-backdrop.open { display: flex; }

.search-modal-box {
  width: 92%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: modal-slide-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.search-modal-icon { font-size: 1.15rem; color: var(--text-muted); }
.search-modal-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--text-primary);
  outline: none;
}

.search-modal-kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.search-modal-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.4rem;
  flex-grow: 1;
}

.search-category-title {
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem 0.2rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-result-item:hover, .search-result-item.selected {
  background: var(--primary-light);
  color: var(--primary);
}

.search-result-badge {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.search-result-info { flex-grow: 1; }
.search-result-name { font-weight: 600; font-size: 0.9rem; }
.search-result-desc { font-size: 0.775rem; color: var(--text-muted); }
.search-result-arrow { color: var(--text-muted); font-size: 1rem; }

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-modal-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .search-modal-footer { display: none; }
}

.search-modal-footer kbd {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

@media (max-width: 480px) {
  .toast-container { align-items: center; }
  .toast { width: 100%; justify-content: center; }
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
}

.toast-success { background: #064e3b; color: #a7f3d0; border: 1px solid #059669; }
.toast-info { background: #1e1b4b; color: #c7d2fe; border: 1px solid #4f46e5; }
.toast-warning { background: #451a03; color: #fde68a; border: 1px solid #d97706; }
.toast-error { background: #4c0519; color: #fecdd3; border: 1px solid #e11d48; }

.animate-toast-in { animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-toast-out { animation: toast-out 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(16px) scale(0.95); }
}

/* Footer Section */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-brand-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 320px;
  margin-bottom: 1rem;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
  font-size: 0.725rem;
  font-weight: 700;
}

.footer-col-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link {
  font-size: 0.825rem;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
