/* WriteToolbox - Global Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --header-bg: #1a1a2e;
  --accent: #8b5cf6;
  --accent-dark: #7c3aed;
  --accent-light: #ede9fe;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f8f7ff;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
header {
  background: var(--header-bg);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo .write { color: #ffffff; }
.logo .toolbox { color: var(--accent); }
nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}
nav a:hover { color: var(--accent); }

/* Main layout */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Ad slots */
.ad-slot {
  background: #f1f0ff;
  border: 2px dashed #c4b5fd;
  border-radius: 8px;
  text-align: center;
  padding: 1rem;
  color: var(--text-light);
  font-size: 0.8rem;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-slot::before { content: 'Advertisement'; }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

/* Tool page layout */
.tool-header {
  margin-bottom: 2rem;
}
.tool-header h1 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.tool-header p {
  color: var(--text-light);
  font-size: 1.05rem;
}

/* Textarea */
textarea {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s;
  background: #fff;
}
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Input */
input[type="text"], input[type="number"], input[type="url"], select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-secondary {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.btn-secondary:hover { background: #ddd6fe; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent-light); }

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1rem;
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Score circle */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, var(--border) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  position: relative;
}
.score-inner {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.score-label { font-size: 0.65rem; color: var(--text-light); text-transform: uppercase; }

/* Highlight colors */
.highlight-warning { background: #fef3c7; border-radius: 3px; padding: 0 2px; }
.highlight-danger { background: #fee2e2; border-radius: 3px; padding: 0 2px; }
.highlight-repeat { background: #dbeafe; border-radius: 3px; padding: 0 2px; }

/* Info boxes */
.info-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}
.info-box h4 { color: var(--accent-dark); margin-bottom: 0.3rem; }
.info-box p { color: var(--text); font-size: 0.9rem; }

/* Tag / Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-purple { background: var(--accent-light); color: var(--accent-dark); }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Footer */
footer {
  background: var(--header-bg);
  color: rgba(255,255,255,0.7);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.85rem;
}
footer a { color: var(--accent); text-decoration: none; }
footer .footer-links { margin-top: 0.5rem; }
footer .footer-links a { margin: 0 0.75rem; }

/* Responsive */
@media (max-width: 768px) {
  nav { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-header h1 { font-size: 1.5rem; }
  main { padding: 1.5rem 1rem; }
}

/* Two-column layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Form group */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* Progress bar */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 20px;
  transition: width 0.4s ease;
}

/* Output box */
.output-box {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  min-height: 80px;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Section title */
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}

/* Issue items */
.issue-item {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.issue-item.danger { border-left-color: var(--danger); }
.issue-item .issue-title { font-weight: 600; font-size: 0.9rem; }
.issue-item .issue-desc { font-size: 0.85rem; color: var(--text-light); margin-top: 0.2rem; }

/* Citation output */
.citation-output {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  font-family: Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Word chips */
.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.word-chip {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.word-chip:hover { background: #ddd6fe; }

/* Prompt card */
.prompt-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #2d1b69 100%);
  color: white;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Rhyme groups */
.rhyme-group {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.rhyme-group h4 {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Tool intro page */
.hero {
  text-align: center;
  padding: 3rem 1rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto 2rem; }

/* Category filter */
.category-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.cat-tab {
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s;
}
.cat-tab.active, .cat-tab:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Tool cards grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: block;
}
.tool-card:hover {
  box-shadow: 0 4px 20px rgba(139,92,246,0.15);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tool-card .tc-icon {
  font-size: 2rem;
  margin-bottom: 0.8rem;
}
.tool-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.tool-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}
.tool-card .tc-badge {
  margin-top: 0.8rem;
}

/* Search bar */
.search-wrap {
  position: relative;
  max-width: 500px;
  margin: 0 auto 2rem;
}
.search-wrap input {
  padding-left: 2.8rem;
  font-size: 1rem;
  border-radius: 30px;
  border: 2px solid var(--border);
  background: white;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }
