﻿/* ==========================================================================
   TOOLS.FRANKBASE.COM - UNIFIED DESIGN SYSTEM & STYLESHEET
   Version: 1.0.0 (FrankBase 2.0 Ecosystem Parity)
   ========================================================================== */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

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

  --cyan: #0284c7;
  --cyan-light: #e0f2fe;
  --emerald: #059669;
  --emerald-light: #ecfdf5;
  --amber: #d97706;
  --amber-light: #fffbeb;
  --rose: #e11d48;
  --rose-light: #fff1f2;

  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-strong: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --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);

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

  --container-max: 1200px;
  --header-height: 72px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-surface: #131d31;
  --bg-surface-elevated: #1a2742;
  --bg-glass: rgba(15, 23, 42, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-glow: rgba(99, 102, 241, 0.25);

  --cyan: #38bdf8;
  --cyan-light: rgba(56, 189, 248, 0.15);
  --emerald: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.15);
  --rose: #f43f5e;
  --rose-light: rgba(244, 63, 94, 0.15);

  --border: #1e293b;
  --border-subtle: #172033;
  --border-strong: #334155;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

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

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

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

code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-glow);
}

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

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn, .icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
}
.theme-toggle-btn:hover, .icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.hero {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-light);
  border: 1px solid var(--accent-glow);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.search-container {
  max-width: 600px;
  margin: 0 auto 30px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  font-size: 1.05rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
  pointer-events: none;
}

.category-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.chip {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.chip:hover, .chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-xl);
}

.tool-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
  border: 1px solid var(--accent-glow);
}

.tool-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

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

.tool-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.badge-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.badge-client {
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-ai {
  background: var(--cyan-light);
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.studio-layout {
  padding: 32px 0 60px;
}

.studio-header {
  margin-bottom: 28px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.studio-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

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

.studio-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

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

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: var(--accent);
}

.dropzone-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.dropzone-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.setting-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.input-text {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}
.input-text:focus {
  border-color: var(--accent);
}

.code-viewer {
  width: 100%;
  height: 440px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #0d1117;
  color: #c9d1d9;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  resize: vertical;
}

.stats-bar {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 16px;
  flex-wrap: wrap;
}

.article-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.article-header {
  margin-bottom: 36px;
  text-align: center;
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.article-content h2 {
  font-size: 1.6rem;
  margin: 40px 0 16px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}
.article-content h3 {
  font-size: 1.3rem;
  margin: 28px 0 12px;
  color: var(--text-primary);
}
.article-content p {
  margin-bottom: 20px;
}
.article-content ul, .article-content ol {
  margin-bottom: 20px;
  padding-left: 28px;
}
.article-content li {
  margin-bottom: 8px;
}
.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  background: var(--accent-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 24px 0;
  font-style: italic;
}

.cta-box {
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin: 48px 0;
  box-shadow: var(--shadow-lg);
}

.footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
}

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

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

.footer-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

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

.footer-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.footer-link:hover {
  color: var(--accent);
}

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