/* ========================================
   AI Freedom Stack — Design System
   Dark grays + deep blues, cutting edge + trustworthy
   ======================================== */

:root {
  /* Core palette */
  --bg-primary: #0f1117;
  --bg-secondary: #161923;
  --bg-card: #1a1e2e;
  --bg-card-hover: #1f2438;
  --bg-elevated: #232839;
  
  /* Blues */
  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --accent-subtle: rgba(59, 130, 246, 0.08);
  
  /* Text */
  --text-primary: #e8eaed;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --text-accent: #93c5fd;
  
  /* Borders */
  --border-default: #2a2f3e;
  --border-hover: #3b82f6;
  
  /* Status */
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Layout */
  --max-width: 1200px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-primary);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* ---- Header / Nav ---- */
.site-header {
  border-bottom: 1px solid var(--border-default);
  padding: var(--space-lg) 0;
  position: sticky;
  top: 0;
  background: rgba(15, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-logo .logo-icon {
  color: var(--accent-primary);
  font-size: 1.5rem;
}

.site-nav {
  display: flex;
  gap: var(--space-xl);
  list-style: none;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--text-primary);
}

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

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  position: relative;
  z-index: 1;
}

.hero .cta-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-primary:hover {
  background: #2563eb;
  color: white;
  box-shadow: 0 0 20px var(--accent-glow);
}

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

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

/* ---- Section Headers ---- */
.section {
  padding: var(--space-3xl) 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

.section-header .view-all {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--accent-glow);
}

.tool-card .tool-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.tool-card .tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius);
  background: var(--accent-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.tool-card .tool-name {
  font-size: 1.15rem;
  font-weight: 600;
}

.tool-card .tool-category {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-card .tool-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.tool-card .tool-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tool-card .tool-price {
  font-weight: 600;
  color: var(--green);
  font-size: 0.9rem;
}

.tool-card .tool-rating {
  color: var(--amber);
  font-size: 0.9rem;
}

.tool-card .tool-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.tool-card .tag {
  background: var(--accent-subtle);
  color: var(--text-accent);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---- Featured / Hero Card ---- */
.featured-card {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-xl);
}

.featured-card .featured-image {
  border-radius: var(--border-radius);
  overflow: hidden;
  background: var(--bg-secondary);
}

.featured-card .featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card .featured-content h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.featured-card .featured-badge {
  display: inline-block;
  background: var(--accent-primary);
  color: white;
  padding: 0.2rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

/* ---- Latest Posts ---- */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.post-item {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  transition: all 0.2s;
}

.post-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.post-item .post-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.post-item .post-title {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.post-item .post-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ---- Newsletter CTA ---- */
.newsletter-cta {
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-lg);
  padding: var(--space-2xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.newsletter-cta h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  position: relative;
}

.newsletter-cta p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  position: relative;
}

.newsletter-cta .email-form {
  display: flex;
  gap: var(--space-sm);
  max-width: 450px;
  margin: 0 auto;
  position: relative;
}

.newsletter-cta input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-default);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.newsletter-cta input[type="email"]:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border-default);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-3xl);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-content .copyright {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- Tool Single Page ---- */
.tool-single {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.tool-single h1 {
  font-size: 2.25rem;
  margin-bottom: var(--space-sm);
}

.tool-single .verdict {
  font-size: 1.1rem;
  color: var(--text-secondary);
  padding: var(--space-lg);
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--border-radius);
  margin: var(--space-xl) 0;
}

.tool-single h2 {
  font-size: 1.4rem;
  margin: var(--space-2xl) 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-default);
}

.tool-single table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
}

.tool-single th, .tool-single td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.tool-single th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tool-single .pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin: var(--space-lg) 0;
}

.tool-single .pros h3 { color: var(--green); }
.tool-single .cons h3 { color: var(--red); }

.tool-single .faq-item {
  margin: var(--space-lg) 0;
}

.tool-single .faq-item strong {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.tool-single .faq-item p {
  color: var(--text-secondary);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .featured-card { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .footer-content { flex-direction: column; gap: var(--space-md); }
  .tool-single .pros-cons { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero .cta-group { flex-direction: column; }
  .newsletter-cta .email-form { flex-direction: column; }
}

/* ---- Featured Carousel ---- */
.featured-carousel {
  position: relative;
  min-height: 280px;
}

.featured-carousel .featured-card {
  transition: opacity 0.5s ease;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

.featured-carousel .featured-card:first-child {
  position: relative;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-default);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  padding: 0;
}

.carousel-dot.active {
  background: var(--accent-primary);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: scale(1.2);
}

.carousel-dot:hover {
  background: var(--accent-secondary);
}

/* ---- Mega Dropdown ---- */
.nav-item {
  position: relative;
}

.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  min-width: 500px;
  display: none;
  z-index: 200;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-top: var(--space-sm);
}

.nav-item:hover .mega-dropdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

.mega-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--border-default);
}

.mega-category {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--border-radius);
  transition: background 0.2s;
}

.mega-category:hover {
  background: var(--bg-card-hover);
}

.mega-category .mega-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border-radius: var(--border-radius);
  flex-shrink: 0;
}

.mega-category .mega-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
}

.mega-category .mega-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---- Sidebar Filters ---- */
.tools-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

.tools-sidebar {
  position: sticky;
  top: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
}

.sidebar-section {
  margin-bottom: var(--space-xl);
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-section h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}

.filter-btn:hover {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--accent-subtle);
  color: var(--accent-secondary);
  font-weight: 600;
}

.filter-btn .filter-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.filter-btn .filter-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
}

/* Price filter pills */
.price-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.price-pill {
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.price-pill:hover,
.price-pill.active {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  background: var(--accent-subtle);
}

@media (max-width: 768px) {
  .tools-layout { grid-template-columns: 1fr; }
  .tools-sidebar { 
    position: static;
    display: none;
  }
  .tools-sidebar.mobile-open { display: block; }
  .mega-dropdown { display: none !important; }
  .mobile-filter-toggle { display: block; }
}

.mobile-filter-toggle {
  display: none;
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: var(--space-lg);
  font-family: inherit;
}
