/*
Theme Name: FlowStack AI
Theme URI: https://n8n-automation.io
Author: Mostafa — FlowStack AI
Description: Dark theme with rich vibrant Orange + Green - FlowStack AI brand
Version: 4.4
Text Domain: flowstack-ai
*/

/* ─── CSS Variables ─── */
:root {
  --bg-primary: #0A0A0F;
  --bg-secondary: #111118;
  --bg-card: rgba(17,17,24,0.8);
  --accent-orange: #FF8500;
  --accent-green: #34A853;
  --text-primary: #FFFFFF;
  --text-muted: #D1D5DB;
  --text-dim: #9CA3AF;
  --border-subtle: rgba(255,255,255,0.1);
  --border-orange: rgba(255,133,0,0.3);
}

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

html {
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; }

/* ─── Grid dot background ─── */
.grid-bg {
  background-image: radial-gradient(circle at 1px 1px, rgba(255,133,0,0.25) 1px, transparent 0);
  background-size: 40px 40px;
}

/* ─── Text accent (solid orange) ─── */
.text-accent {
  color: var(--accent-orange);
  font-weight: 800;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111118; }
::-webkit-scrollbar-thumb { background: var(--accent-orange); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #FFA033; }

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,133,0,0.15);
  border: 1px solid rgba(255,133,0,0.4);
  color: #FFA033;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #FF8500, #E67300);
  color: #fff;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,133,0,0.5);
  cursor: pointer;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #FFA033, #FF8500);
  box-shadow: 0 0 35px rgba(255,133,0,0.55);
  transform: translateY(-2px);
  color: #fff;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent-green);
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 2px solid var(--accent-green);
}
.btn-outline:hover {
  background: var(--accent-green);
  border-color: #059669;
  transform: translateY(-2px);
  color: #fff;
}

/* ─── Card hover ─── */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,133,0,0.4);
}

/* ────────────────────────────────────────────
   NAVBAR
──────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.3s ease;
  padding: 0 24px;
}
.site-nav.scrolled {
  background: rgba(17,17,24,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.nav-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.nav-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.site-nav .nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.site-nav .nav-links a:hover { color: var(--accent-orange); }
.nav-cta { display: flex; }
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
}
.mobile-menu {
  display: none;
  background: rgba(17,17,24,0.98);
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 12px 0;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.95rem;
}
.mobile-menu a:hover { color: var(--accent-orange); }
.mobile-menu .btn-primary {
  display: block;
  text-align: center;
  margin-top: 16px;
  width: 100%;
}

/* ────────────────────────────────────────────
   PAGE HEADER (Blog listing)
──────────────────────────────────────────── */
.page-header {
  padding: 120px 24px 60px;
  text-align: center;
  position: relative;
}
.page-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 16px 0;
}
.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}
.page-header p strong {
  color: #fff;
  font-weight: 800;
}

/* ────────────────────────────────────────────
   BLOG LISTING (index.php)
──────────────────────────────────────────── */
.blog-section {
  padding: 0 24px 80px;
  max-width: 1280px;
  margin: 0 auto;
}
.blog-toolbar {
  margin: 0 auto 24px;
  max-width: 640px;
}
.search-form-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.search-row {
  display: flex;
  gap: 10px;
}
.search-input {
  flex: 1;
  min-width: 0;
  background: rgba(17,17,24,0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  outline: none;
  border-color: rgba(255,133,0,0.55);
  box-shadow: 0 0 0 3px rgba(255,133,0,0.14);
}
.search-submit {
  border: 1px solid rgba(255,133,0,0.45);
  background: linear-gradient(135deg, #FF8500, #E67300);
  color: #fff;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.search-submit:hover { filter: brightness(1.07); }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.article-card {
  background: rgba(17,17,24,0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,133,0,0.4);
}
.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.category-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}
.read-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}
.article-card h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.article-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 20px;
}
.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-date { font-size: 0.75rem; color: var(--text-dim); }
.read-more { font-size: 0.875rem; font-weight: 600; }

/* No posts */
.no-posts {
  text-align: center;
  padding: 60px;
  color: var(--text-dim);
}

/* WordPress pagination */
.navigation.pagination {
  display: block;
}
.pagination .nav-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.navigation.pagination .nav-links,
.pagination .nav-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.navigation.pagination .page-numbers,
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(17,17,24,0.75);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.pagination .page-numbers:hover {
  color: #fff;
  border-color: rgba(255,133,0,0.55);
}
.pagination .page-numbers.current {
  background: linear-gradient(135deg, #FF8500, #E67300);
  border-color: rgba(255,133,0,0.9);
  color: #fff;
}

/* Theme-controlled pagination */
.fs-pagination {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 48px;
}
.fs-pagination-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.fs-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(17,17,24,0.75);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.fs-page-link:hover {
  color: #fff;
  border-color: rgba(255,133,0,0.55);
}
.fs-page-link.current {
  background: linear-gradient(135deg, #FF8500, #E67300);
  border-color: rgba(255,133,0,0.9);
  color: #fff;
}

/* ────────────────────────────────────────────
   SINGLE ARTICLE (single.php)
──────────────────────────────────────────── */
.single-wrap {
  max-width: 768px;
  margin: 0 auto;
  padding: 100px 24px 80px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.breadcrumb a { color: var(--text-dim); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--accent-orange); }
.article-header { margin-bottom: 40px; }
.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 900;
  line-height: 1.3;
  margin: 16px 0;
}
.article-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-dim);
}
.youtube-embed {
  margin: 32px 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/9;
}
.youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Article content typography */
.article-content { color: var(--text-muted); line-height: 1.9; font-size: 1.05rem; }
.article-content h2 { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); margin: 2rem 0 0.75rem; }
.article-content h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 0.5rem; }
.article-content p { margin-bottom: 1rem; }
.article-content p.lead { font-size: 1.1rem; color: var(--text-muted); border-right: 3px solid var(--accent-orange); padding-right: 1rem; margin-bottom: 1.5rem; }
.article-content ul, .article-content ol { margin-bottom: 1rem; padding-right: 1.5rem; }
.article-content li { margin-bottom: 0.4rem; }
.article-content li strong, .article-content strong { color: var(--text-primary); }
.article-content a { color: var(--accent-orange); text-decoration: underline; }
.article-content a:hover { color: #E85A2A; }
.article-content pre { background: rgba(17,17,24,0.9); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 1rem 1.25rem; overflow-x: auto; margin: 1rem 0 1.5rem; }
.article-content code { font-family: 'Courier New', monospace; font-size: 0.85rem; color: var(--accent-orange); background: rgba(255,133,0,0.15); padding: 2px 6px; border-radius: 4px; }
.article-content pre code { background: none; color: var(--text-primary); padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9rem; }
.article-content th { background: rgba(255,133,0,0.15); color: var(--text-primary); font-weight: 700; padding: 0.6rem 0.8rem; border: 1px solid var(--border-subtle); text-align: right; }
.article-content td { padding: 0.5rem 0.8rem; border: 1px solid var(--border-subtle); color: var(--text-muted); }

/* Article CTA */
.article-cta {
  margin-top: 56px;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,107,53,0.08), rgba(16,185,129,0.06));
  border: 1px solid var(--border-subtle);
}
.article-cta p { color: var(--text-primary); font-weight: 700; margin-bottom: 8px; }
.article-cta p.sub { color: var(--text-muted); font-size: 0.875rem; font-weight: 400; margin-bottom: 16px; }

/* Related articles */
.related-section { margin-top: 56px; }
.related-section h2 { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-bottom: 20px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.related-card {
  background: rgba(17,17,24,0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.3s ease;
}
.related-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
.related-card h3 { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin: 8px 0 4px; line-height: 1.4; }
.related-card .meta { font-size: 0.75rem; color: var(--text-dim); }

/* ────────────────────────────────────────────
   FOOTER
──────────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 64px 24px 32px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.7;
  margin: 16px 0 20px;
  max-width: 300px;
}
.footer-socials { display: flex; gap: 12px; }
.social-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,133,0,0.1);
  border: 1px solid rgba(255,133,0,0.3);
  color: var(--text-muted);
  transition: all 0.2s;
  font-size: 0.85rem;
}
.social-btn:hover { color: var(--accent-orange); background: rgba(255,133,0,0.2); transform: scale(1.1); }
.footer-col h4 { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { color: var(--text-muted); font-size: 0.875rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent-orange); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-bottom p { font-size: 0.75rem; color: var(--text-dim); }

/* ────────────────────────────────────────────
   404 PAGE
──────────────────────────────────────────── */
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.not-found-num {
  font-size: 6rem;
  font-weight: 900;
  color: var(--accent-orange);
  line-height: 1;
  margin-bottom: 16px;
}
.not-found h1 { font-size: 1.5rem; color: var(--text-primary); margin-bottom: 12px; }
.not-found p { color: var(--text-muted); margin-bottom: 32px; }
.not-found-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ────────────────────────────────────────────
   ANIMATIONS
──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.fade-in-up-2 { animation: fadeInUp 0.6s ease 0.1s both; }
.fade-in-up-3 { animation: fadeInUp 0.6s ease 0.2s both; }

/* ────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-nav .nav-links, .site-nav .nav-cta { display: none; }
  .nav-mobile-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-toolbar {
    max-width: 100%;
    margin-bottom: 18px;
  }
  .search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: stretch;
  }
  .search-input { padding: 11px 12px; font-size: 0.9rem; }
  .search-submit { padding: 0 14px; }
  .navigation.pagination,
  .pagination {
    display: block !important;
    margin-top: 22px;
    width: 100%;
    text-align: center;
  }
  .navigation.pagination .nav-links,
  .pagination .nav-links {
    display: inline-flex !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .navigation.pagination .nav-links .page-numbers,
  .pagination .nav-links .page-numbers,
  .navigation.pagination .page-numbers,
  .pagination .page-numbers {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.8rem;
  }
  .fs-pagination {
    display: block !important;
    width: 100%;
    text-align: center;
    margin-top: 22px;
  }
  .fs-pagination-links {
    display: inline-flex !important;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 8px;
    justify-content: center;
  }
  .fs-page-link {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .related-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (min-width: 769px) {
  .mobile-menu { display: none !important; }
}
