/* L8AB TOOLS - Main Styles */
:root {
  --primary: #667eea;
  --primary-dark: #764ba2;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --dark: #0f172a;
  --dark-card: #1e293b;
  --border: rgba(99, 102, 241, 0.2);
  --navbar-bg: rgba(15, 23, 42, 0.95);
}

:root.light-mode {
  --dark: #f8fafc;
  --dark-card: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: rgba(99, 102, 241, 0.3);
  --navbar-bg: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Navbar */
.navbar {
  background: var(--navbar-bg);
  border-bottom: 2px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-menu a {
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--primary);
}

/* Hero */
.hero {
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 560px;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.feature-badge {
  padding: 0.4rem 0.9rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.stat-item {
  text-align: left;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-hero {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.hero-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.floating-shapes {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: 10%;
  right: 10%;
  animation: float 15s ease-in-out infinite;
}

.shape-2 {
  width: 200px;
  height: 200px;
  background: var(--primary-dark);
  bottom: 20%;
  left: 5%;
  animation: float 12s ease-in-out infinite reverse;
}

.shape-3 {
  width: 150px;
  height: 150px;
  background: var(--primary);
  top: 50%;
  left: 30%;
  animation: float 18s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(20px, -20px);
  }
}

/* Tools section */
.tools {
  padding: 4rem 0;
}

.tools-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.tools-controls {
  margin-top: 1.5rem;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 400px;
  padding: 0.75rem 1rem;
  background: var(--dark-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.search-box svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--dark-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-color: var(--primary);
}

.tools-category {
  margin-bottom: 2rem;
}

.category-title {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
  color: var(--text);
  font-weight: 700;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: var(--dark-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s;
}

.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

.tool-icon {
  font-size: 2rem;
  line-height: 1;
}

.tool-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.tool-btn {
  margin-top: auto;
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  opacity: 0.9;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--dark-card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  max-width: 90vw;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 0.25rem;
}

.close-btn:hover {
  color: var(--text);
}

/* Features */
.features {
  padding: 4rem 0;
  background: rgba(99, 102, 241, 0.05);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  background: var(--dark-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.feature-card:hover {
  border-color: var(--primary);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* FAQ */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  background: var(--dark-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-question {
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--text);
}

.faq-toggle {
  font-size: 1.25rem;
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* Footer */
.footer {
  background: var(--dark-card);
  border-top: 2px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.footer-section ul {
  list-style: none;
}

.footer-section a {
  color: var(--text-muted);
}

.footer-section a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.social-icon,
.social-icon-large {
  font-size: 1.5rem;
}

/* Theme toggle */
.theme-toggle {
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
}

/* Fade-in for cards */
.fade-in {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Spin for loading */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}