/* ============================================
   EasyTool.me — Global Design System
   Clean, Modern, Light Theme
   ============================================ */

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

:root {
  --bg-body: #f8f9fb;
  --bg-white: #ffffff;
  --bg-gray: #f1f3f5;
  --bg-input: #f8f9fb;
  --bg-hover: #f0f2ff;

  --accent: #4361ee;
  --accent-hover: #3651d4;
  --accent-light: #eef0ff;
  --accent-muted: #7b8cef;

  --green: #16a34a;
  --green-bg: #f0fdf4;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --blue: #2563eb;
  --blue-bg: #eff6ff;

  --text-primary: #1a1a2e;
  --text-secondary: #5a607f;
  --text-muted: #9096b2;

  --border: #e2e5f1;
  --border-hover: #c5cae8;
  --border-focus: var(--accent);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--border);
  --shadow-card-hover: 0 4px 12px rgba(67, 97, 238, 0.1), 0 0 0 1px var(--border-hover);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;

  --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --max-width: 1100px;
  --nav-height: 56px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

img {
  max-width: 100%;
  display: block;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

/* ---- Nav ---- */
.nav {
  position: sticky;
  top: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo .logo-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-logo .logo-icon svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
}

/* ---- Main ---- */
.main {
  padding: var(--space-2xl) 0;
  min-height: calc(100vh - var(--nav-height) - 200px);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: var(--space-xl) 0 var(--space-2xl);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* ---- Section ---- */
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ---- Tool Cards Grid ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.tool-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
}

.tool-card-icon svg {
  width: 20px;
  height: 20px;
}

.tool-card-body {
  flex: 1;
  min-width: 0;
}

.tool-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.tool-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Card icon color variants */
.tool-card[data-color="blue"] .tool-card-icon {
  background: var(--blue-bg);
  color: var(--blue);
}

.tool-card[data-color="green"] .tool-card-icon {
  background: var(--green-bg);
  color: var(--green);
}

.tool-card[data-color="amber"] .tool-card-icon {
  background: var(--amber-bg);
  color: var(--amber);
}

.tool-card[data-color="red"] .tool-card-icon {
  background: var(--red-bg);
  color: var(--red);
}

/* ---- Tool Page ---- */
.tool-page {
  padding-bottom: var(--space-2xl);
}

.tool-header {
  margin-bottom: var(--space-xl);
}

.tool-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.tool-header .breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.tool-header .breadcrumb a:hover {
  color: var(--accent);
}

.tool-header .breadcrumb .sep {
  opacity: 0.4;
}

.tool-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.tool-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Workspace */
.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.tool-workspace.single-col {
  grid-template-columns: 1fr;
}

.tool-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--bg-gray);
}

.panel-header h3 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.panel-body {
  padding: var(--space-md);
}

/* ---- Form ---- */
textarea,
input[type="text"],
input[type="number"],
input[type="url"],
select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color 0.15s;
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 200px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.08);
}

textarea::placeholder,
input::placeholder {
  color: var(--text-muted);
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-sans);
  font-size: 0.825rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--bg-gray);
  color: var(--text-primary);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-white);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.15s;
}

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

/* ---- Toggle ---- */
.toggle-group {
  display: inline-flex;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.toggle-group button {
  padding: 6px 14px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.toggle-group button.active {
  background: var(--accent);
  color: #fff;
}

/* ---- Result ---- */
.result-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-box.success {
  border-color: var(--green);
  background: var(--green-bg);
}

.result-box.error {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

/* ---- Status ---- */
.status-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  margin-top: var(--space-md);
}

.status-msg.success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #bbf7d0;
}

.status-msg.error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid #fecaca;
}

.status-msg.info {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid #bfdbfe;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--text-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 9999;
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2s forwards;
}

/* ---- Ad Slots ---- */
.ad-slot {
  margin: var(--space-lg) 0;
  min-height: 90px;
  overflow: hidden;
}

.ad-slot-sidebar {
  min-height: 250px;
}

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-sm);
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ---- Strength bar ---- */
.strength-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-gray);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.strength-bar-fill.weak {
  width: 25%;
  background: var(--red);
}

.strength-bar-fill.fair {
  width: 50%;
  background: var(--amber);
}

.strength-bar-fill.good {
  width: 75%;
  background: var(--blue);
}

.strength-bar-fill.strong {
  width: 100%;
  background: var(--green);
}

.strength-label {
  font-size: 0.75rem;
  margin-top: 4px;
  font-weight: 500;
}

.strength-label.weak {
  color: var(--red);
}

.strength-label.fair {
  color: var(--amber);
}

.strength-label.good {
  color: var(--blue);
}

.strength-label.strong {
  color: var(--green);
}

/* ---- Color picker ---- */
.color-preview {
  width: 100%;
  height: 100px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: var(--space-md);
}

.color-values {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
}

.color-value-row:hover {
  border-color: var(--border-hover);
}

.color-value-row span:first-child {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  min-width: 36px;
}

.color-value-row code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
}

/* ---- QR ---- */
.qr-output {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.qr-output canvas,
.qr-output img {
  border-radius: var(--radius-md);
  background: #fff;
  padding: 12px;
  border: 1px solid var(--border);
}

/* ---- Options ---- */
.options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.option-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ---- Checkbox / Range ---- */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

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

input[type="color"] {
  width: 48px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-white);
  padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-xl);
}

.footer-brand {
  max-width: 280px;
}

.footer-brand .footer-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer-links h4 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

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

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

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

/* ---- Animations ---- */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ---- SEO content sections ---- */
.seo-content {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.seo-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.seo-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-lg);
  margin-bottom: 6px;
}

.seo-content p,
.seo-content li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.seo-content ul {
  padding-left: var(--space-lg);
  margin: 8px 0;
}

.seo-content a {
  color: var(--accent);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-white);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    gap: var(--space-sm);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .tool-workspace {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }
}