/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== THEME VARIABLES ===== */
:root {
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --text: #0f172a;
  --text-secondary: #64748b;
  --card: #ffffff;
  --card-border: #e2e8f0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-light: #eef2ff;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --card: #1e293b;
  --card-border: #334155;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-light: #1e1b4b;
  --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -2px rgba(0,0,0,0.2);
}

/* ===== BASE ===== */
html { scroll-behavior: smooth; }

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;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== NAVBAR ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition), border-color var(--transition);
}

.navbar .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.navbar .nav-center {
  font-size: 1.05rem;
  font-weight: 600;
}

.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color var(--transition);
}
.back-btn:hover { color: var(--accent); text-decoration: none; }

/* ===== THEME TOGGLE ===== */
#themeToggle {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}
#themeToggle:hover { border-color: var(--accent); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-secondary); color: var(--text); border: 1px solid var(--card-border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 0.8rem 2.25rem; font-size: 1rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  box-shadow: var(--shadow);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 4.5rem 2rem 3rem;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

/* ===== TOOLS GRID ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 3rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.tool-card { text-align: center; padding: 2rem 1.5rem; }

.tool-card .icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.25rem;
  background: var(--accent-light);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-card .icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-card h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.tool-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
  margin-top: 2rem;
}

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  pointer-events: auto;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--success); }
.toast-error { background: var(--error); }
.toast-warning { background: var(--warning); color: #0f172a; }
.toast-info { background: var(--info); }

/* ===== FEATURES SECTION (HOMEPAGE) ===== */
.features-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 3.5rem;
}
.features-section .section-title { text-align: center; margin-bottom: 0.4rem; }
.features-section .section-subtitle { text-align: center; margin-bottom: 2rem; }

/* ===== INFO SECTIONS (TOOL PAGES) ===== */
.tool-info {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  border-top: 1px solid var(--card-border);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.section-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* --- Info feature grid --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.15rem;
  margin-bottom: 2.5rem;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: all var(--transition);
}
.info-card:hover { box-shadow: var(--shadow); }
.info-card .info-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.info-card .info-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.info-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.info-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* --- How-to steps --- */
.how-to-steps { margin-bottom: 2.5rem; }
.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.step-num {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.step-text h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.step-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- FAQ accordion --- */
.faq-list { margin-bottom: 2.5rem; }
.faq-item {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.faq-item summary {
  padding: 0.85rem 1.15rem;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  background: var(--card);
  transition: background var(--transition);
  list-style: none;
  display: flex;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: '+';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.faq-item[open] summary::before { content: '\2212'; }
.faq-item summary:hover { background: var(--bg-secondary); }
.faq-item .faq-answer {
  padding: 0.75rem 1.15rem 1rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  border-top: 1px solid var(--card-border);
}

/* --- Privacy notice --- */
.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.privacy-notice svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 2px;
}
.privacy-notice p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}
.privacy-notice strong { font-weight: 600; }

/* --- Format tags --- */
.formats-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.format-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  font-size: 0.78rem;
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== FOOTER (ENHANCED) ===== */
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); text-decoration: none; }

/* ===== MOBILE NOTICE (SCREEN RECORDER) ===== */
.mobile-notice {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.5rem;
  max-width: 420px;
  width: 100%;
}
.mobile-notice .mobile-icon {
  width: 64px;
  height: 64px;
  background: var(--accent-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.mobile-notice .mobile-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.5;
}
.mobile-notice h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}
.mobile-notice p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}
.mobile-alternatives {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}
.mobile-alternatives .btn { width: 100%; justify-content: center; }

/* ===== DESKTOP-ONLY UTILITY ===== */
.desktop-only-link { display: inline; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 0.7rem 1rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 0.95rem; }
  .tools-grid { padding: 1.5rem 1rem; gap: 1rem; }
  .desktop-only { display: none !important; }
  .desktop-only-link { display: none !important; }
  #toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
  .toast { max-width: 100%; }
  .tool-info { padding: 2rem 1.25rem 1.5rem; }
  .info-grid { grid-template-columns: 1fr; }
  .step { gap: 0.75rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}
