/* ToolPilot - Global Styles */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
  --radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* Header */
.header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-logo svg { width: 28px; height: 28px; }

.header-nav { display: flex; gap: 24px; align-items: center; }
.header-nav a { color: var(--text-light); font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.header-nav a:hover { color: var(--primary); }

/* Main Content */
.main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 32px 24px; width: 100%; }

/* Tool Page Layout */
.tool-header { margin-bottom: 32px; }
.tool-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.tool-header p { color: var(--text-light); font-size: 1.1rem; }

.tool-container {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

/* Form Elements */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }

input[type="text"], input[type="number"], input[type="url"],
textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-white);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea { resize: vertical; min-height: 120px; }

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

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

/* Output Area */
.output-area {
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  min-height: 60px;
  word-break: break-all;
}

.output-area pre {
  white-space: pre-wrap;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Cards Grid (Home Page) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.tool-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
}

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

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.tool-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.tool-card p { color: var(--text-light); font-size: 0.9rem; flex: 1; }
.tool-card .card-link { margin-top: 16px; font-weight: 600; font-size: 0.9rem; }

/* Footer */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-light); font-size: 0.9rem; }
.footer-copy { color: var(--text-light); font-size: 0.85rem; }

/* Ad Placeholder - hidden until AdSense is active */
.ad-slot {
  display: none;
  /* When AdSense is ready, change display to 'block' and remove the placeholder span */
}

/* Info Section */
.info-section {
  margin-top: 40px;
  padding: 32px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.info-section h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 16px; }
.info-section h3 { font-size: 1.1rem; font-weight: 600; margin: 20px 0 8px; }
.info-section p { color: var(--text-light); margin-bottom: 12px; line-height: 1.7; }

/* Responsive */
@media (max-width: 768px) {
  .header { padding: 0 16px; }
  .header-nav { gap: 16px; }
  .main { padding: 20px 16px; }
  .tool-container { padding: 20px; }
  .tool-header h1 { font-size: 1.5rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; justify-content: center; }
}

/* Range slider */
input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

/* Checkbox & Radio */
.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.option-row input[type="checkbox"],
.option-row input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Color swatches */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.color-swatch {
  height: 80px;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;
}

.color-swatch:hover { transform: scale(1.05); }

.color-swatch span {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: monospace;
}

/* Copy feedback */
.copied-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1000;
  animation: fadeInUp 0.3s ease, fadeOut 0.3s ease 1.5s forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--primary); }

/* Hero Section */
.hero {
  text-align: center;
  padding: 48px 0 32px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Category filter */
.category-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  justify-content: center;
}

.category-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

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

/* Drag & Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.drop-zone p { color: var(--text-light); }
.drop-zone .icon { font-size: 2rem; margin-bottom: 8px; }

/* Blog Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.blog-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #7c3aed);
}

.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary-light);
}

.blog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.blog-category {
  display: inline-block;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-date {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
}

.blog-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  color: var(--text);
}

.blog-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.blog-link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: inline-block;
}

.blog-card:hover .blog-link {
  color: var(--primary-dark);
  gap: 4px;
}

/* Article Page Styles */
.article-header {
  margin-bottom: 32px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-date,
.article-category {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.article-category {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.article-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.3;
}

.article-subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
}

/* Article content */
.article-content {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 24px;
  line-height: 1.8;
}

.article-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text);
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  color: var(--text);
}

.article-content p {
  margin-bottom: 16px;
  color: var(--text);
}

.article-content ol,
.article-content ul {
  margin-bottom: 16px;
  margin-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  color: var(--text);
}

.article-content strong {
  font-weight: 700;
  color: var(--text);
}

.article-content em {
  font-style: italic;
  color: var(--text-light);
}

.article-content a {
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.2s;
}

.article-content a:hover {
  color: var(--primary-dark);
}

.highlight-box {
  background: rgba(79, 70, 229, 0.05);
  border-left: 4px solid var(--primary);
  padding: 20px;
  border-radius: 8px;
  margin: 24px 0;
}

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

/* Tool CTA */
.tool-cta {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(124, 58, 237, 0.1));
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin: 32px 0;
}

.tool-cta h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: var(--text);
}

.tool-cta p {
  color: var(--text-light);
  margin-bottom: 20px;
  font-size: 1rem;
}

.tool-cta .btn {
  font-size: 1.05rem;
  padding: 12px 32px;
}

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

  .article-content {
    padding: 24px;
  }

  .article-title {
    font-size: 1.8rem;
  }

  .article-content h2 {
    font-size: 1.4rem;
  }

  .article-content h3 {
    font-size: 1.1rem;
  }

  .blog-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-cta {
    padding: 24px;
  }
}
