/* ToolYft — Main Stylesheet */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0f1117;
  --card-bg: #1a1d27;
  --card-hover: #222632;
  --text: #e8e8ed;
  --muted: #8a8fa6;
  --accent: #ff0033;
  --accent-hover: #e6002e;
  --border: #2a2e3f;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
}
body {
  font-family: 'Readex Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  top: 0;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
}
/* Lang Switcher */
.lang-switcher {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.lang-switcher a {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
  background: var(--card-bg);
  transition: background 0.2s, color 0.2s;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.lang-switcher a:hover { background: var(--card-hover); }
.lang-switcher a.active { background: var(--accent); color: #fff; }
/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
}
.logo {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.logo span { color: var(--accent); }
.logo-link { text-decoration: none; color: var(--text); }

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}
/* Category Section */
.category {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  box-shadow: var(--shadow);
  contain: content;
  content-visibility: auto;
}
.category:hover {
  background: var(--card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.category-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.category-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}
.category-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.category-tools {
  display: block;
}
.category-tools span {
  font-size: 0.75rem;
  display: inline-block;
  vertical-align: middle;
  margin: 0.25rem;
  padding: 0.3rem 0.65rem;
  background: rgba(255,0,51,0.1);
  color: var(--accent);
  border-radius: 20px;
  border: 1px solid rgba(255,0,51,0.2);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.category-arrow {
  color: var(--muted);
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: color 0.2s;
}
.category:hover .category-arrow { color: var(--accent); }
/* Coming Soon */
.category.coming-soon {
  opacity: 0.5;
}
.coming-soon-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  background: var(--border);
  color: var(--muted);
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* Affiliate Recommendations */
.affiliate-section {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.7;
}
.affiliate-section .affiliate-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.affiliate-section a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.affiliate-section a:hover {
  text-decoration: underline;
}
.affiliate-section .affiliate-disclosure {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Footer */
/* Newsletter Signup */
.newsletter-signup {
  background: linear-gradient(135deg, var(--card-bg), rgba(102, 126, 234, 0.08));
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}
.newsletter-signup .newsletter-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.newsletter-signup h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; color: var(--text); }
.newsletter-signup > p { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.newsletter-form { display: flex; gap: 0.5rem; max-width: 400px; margin: 0 auto; }
.newsletter-form input[type="email"] {
  flex: 1; padding: 0.7rem 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 0.95rem; font-family: inherit;
}
.newsletter-form input[type="email"]::placeholder { color: var(--muted); }
.newsletter-form input[type="email"]:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2); }
.newsletter-form button {
  background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none;
  padding: 0.7rem 1.25rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: transform 0.15s, opacity 0.15s; white-space: nowrap;
}
.newsletter-form button:hover { transform: translateY(-1px); opacity: 0.95; }
.newsletter-form button:active { transform: translateY(0); }
.newsletter-privacy { font-size: 0.7rem; color: var(--muted); margin-top: 0.75rem; }
@media (max-width: 480px) { .newsletter-form { flex-direction: column; } .newsletter-form button { width: 100%; } }

.page-footer, .footer {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  contain: layout style;
}

/* Performance: content-visibility for below-the-fold sections */
.category.coming-soon {
  content-visibility: auto;
  contain-intrinsic-size: 0 200px;
}
.page-footer a, .footer a { color: var(--accent); text-decoration: none; }
.page-footer a:hover, .footer a:hover { text-decoration: underline; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}
/* Responsive */
@media (max-width: 640px) {
  .container { padding: 3rem 1rem 1.5rem; }
  .logo { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .category { padding: 1.5rem; }
  .category-header h2 { font-size: 1.15rem; }
  .theme-toggle { width: 42px; height: 42px; font-size: 1.1rem; }
}
/* Theme Toggle */
.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  z-index: 100;
  box-shadow: var(--shadow);
  line-height: 1;
  padding: 0;
}
.theme-toggle:hover { background: var(--card-hover); transform: scale(1.08); }
.theme-toggle:active { transform: scale(0.95); }
/* Light Theme */
html.light,
[data-theme="light"] {
  --bg: #f5f5f7;
  --card-bg: #fff;
  --card-hover: #f0f0f2;
  --text: #1a1d27;
  --muted: #5a5e6e;
  --accent: #ff0033;
  --border: #e0e0e5;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* Dark Theme (explicit) */
[data-theme="dark"] {
  --bg: #0f1117;
  --card-bg: #1a1d27;
  --card-hover: #222632;
  --text: #e8e8ed;
  --muted: #8a8fa6;
  --accent: #ff0033;
  --accent-hover: #e6002e;
  --border: #2a2e3f;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* Auto-detect OS theme on first visit (only when no explicit choice) */
@media (prefers-color-scheme: light) {
  html:not([data-theme]):not(.light) {
    --bg: #f5f5f7;
    --card-bg: #fff;
    --card-hover: #f0f0f2;
    --text: #1a1d27;
    --muted: #5a5e6e;
    --accent: #ff0033;
    --border: #e0e0e5;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
  }
}

/* AI category special styling */
.category-ai {
  border: 2px solid #667eea;
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
}
.category-ai h2 {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.top-bar .logo { margin-bottom:0; }
.top-bar .site-logo { margin-bottom: 0; font-size: 1.5rem; font-weight: 800; text-decoration: none; color: var(--text); }
.top-bar .site-logo span { color: var(--accent); }
