/* WriteAI Hub - Global Styles */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-light: #f8fafc;
  --text-light: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #1e293b;
  --border: #334155;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-green: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--primary-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary); }

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

/* Header & Navigation */
header {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text-light); }

.nav-dropdown {
  position: relative;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-content { display: block; }

.dropdown-category { margin-bottom: 1rem; }
.dropdown-category:last-child { margin-bottom: 0; }
.dropdown-category h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
}

.dropdown-category a {
  display: block;
  padding: 0.4rem 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  padding: 5rem 0;
  text-align: center;
  background: radial-gradient(ellipse at center top, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--gradient);
  color: white;
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
}

/* Tool Grid */
.tools-section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.tool-card:hover::before { opacity: 1; }

.tool-icon {
  width: 48px;
  height: 48px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.tool-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.tool-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
}

.tool-badge.popular { background: rgba(245, 158, 11, 0.1); color: var(--accent); }
.tool-badge.hot { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* Category Filter */
.category-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Tool Page Specific */
.tool-hero {
  padding: 4rem 0;
  background: radial-gradient(ellipse at center top, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}

.tool-hero h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin-bottom: 1rem; }
.tool-hero .subtitle { color: var(--text-muted); font-size: 1.125rem; max-width: 700px; }

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.breadcrumb a { color: var(--primary-light); }
.breadcrumb span { color: var(--text-muted); }

/* Tool Interface */
.tool-interface {
  padding: 3rem 0;
}

.tool-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.input-panel, .output-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

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

.panel-header h3 { font-size: 1rem; }

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea { min-height: 150px; resize: vertical; }

.char-count { font-size: 0.75rem; color: var(--text-muted); text-align: right; margin-top: 0.25rem; }

.option-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.option-pill {
  padding: 0.5rem 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.option-pill:hover, .option-pill.active {
  background: var(--primary);
  border-color: var(--primary);
}

.generate-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

.output-content {
  min-height: 300px;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 1.5rem;
}

.output-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  text-align: center;
}

.output-placeholder span { font-size: 3rem; margin-bottom: 1rem; }

.generated-text { line-height: 1.8; white-space: pre-wrap; }

.output-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.action-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Before/After Section */
.examples-section {
  padding: 4rem 0;
  background: rgba(30, 41, 59, 0.5);
}

.example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.example-header {
  padding: 1rem 1.5rem;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.example-header.before { color: var(--text-muted); }
.example-header.after { color: var(--secondary); }

.example-content { padding: 1.5rem; line-height: 1.7; }

/* Use Cases */
.use-cases-section { padding: 4rem 0; }

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.use-case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.use-case-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.use-case-card h3 { margin-bottom: 0.5rem; }
.use-case-card p { color: var(--text-muted); font-size: 0.9rem; }

/* Related Tools */
.related-section {
  padding: 4rem 0;
  background: rgba(30, 41, 59, 0.3);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.related-icon { font-size: 1.5rem; }
.related-info h4 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.related-info p { font-size: 0.8rem; color: var(--text-muted); }

/* FAQ Section */
.faq-section { padding: 4rem 0; }

.faq-grid {
  display: grid;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

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

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--primary);
  transition: transform 0.2s;
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s;
}

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

.faq-answer p { color: var(--text-muted); line-height: 1.7; }

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
}

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

.footer-brand p { color: var(--text-muted); margin-top: 1rem; font-size: 0.9rem; }

.footer-column h4 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 0.5rem; }
.footer-column a { color: var(--text-light); font-size: 0.9rem; }
.footer-column a:hover { color: var(--primary-light); }

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

.social-links { display: flex; gap: 1rem; }
.social-links a { color: var(--text-muted); font-size: 1.25rem; }
.social-links a:hover { color: var(--primary-light); }

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 0;
}

.stat-item { text-align: center; }
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--secondary); }
.toast.success::before { content: '✓'; color: var(--secondary); }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  
  .tool-container { grid-template-columns: 1fr; }
  .example-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .stats-bar { gap: 1.5rem; flex-wrap: wrap; }
  
  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 2rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .category-filter { gap: 0.5rem; }
  .category-btn { padding: 0.4rem 1rem; font-size: 0.8rem; }
}
