/* ==========================================================================
   ImageGo Component System - Reusable SaaS UI Elements
   ========================================================================== */

/* Section Layouts */
.section {
  padding: 64px 0;
}

.section-alt {
  background-color: var(--bg-secondary);
}

/* Tool Cards Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* Premium Tool Card */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tool-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition-fast);
}

.tool-card:hover .tool-icon-wrapper {
  background: var(--brand-primary);
  color: white;
  transform: scale(1.05);
}

.tool-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-primary);
}

.tool-arrow {
  display: inline-flex;
  align-items: center;
  transition: transform var(--transition-fast);
}

.tool-card:hover .tool-arrow {
  transform: translateX(4px);
}

/* Category Cards Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.category-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient-subtle);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 20px;
}

.category-title {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.category-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  font-weight: 600;
}

.category-count {
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* Breadcrumbs */
.breadcrumbs-nav {
  padding: 16px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  font-size: 0.875rem;
}

.breadcrumbs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.breadcrumbs-item a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs-item a:hover {
  color: var(--brand-primary);
}

.breadcrumbs-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumbs-separator {
  color: var(--border-color);
}

/* FAQ Accordion */
.faq-section {
  max-width: 840px;
  margin: 0 auto;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item.open {
  border-color: var(--brand-primary);
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  background: transparent;
  border: none;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  gap: 16px;
}

.faq-question:hover {
  color: var(--brand-primary);
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.faq-answer {
  padding: 0 24px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Global Search Modal */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
}

.search-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.search-modal {
  width: 100%;
  max-width: 680px;
  background: var(--bg-dropdown);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(-20px) scale(0.98);
  transition: transform var(--transition-fast);
}

.search-modal-backdrop.open .search-modal {
  transform: translateY(0) scale(1);
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

.search-modal-header svg {
  color: var(--text-muted);
}

.search-modal-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.15rem;
  color: var(--text-primary);
  outline: none;
}

.search-modal-close {
  background: var(--bg-tertiary);
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
}

.search-modal-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: background var(--transition-fast);
}

.search-result-item:hover, .search-result-item.focused {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.search-result-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.search-modal-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 380px;
}

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--brand-primary); }

/* Monetization / AdSense Reserved Slots */
.ad-slot-container {
  width: 100%;
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-slot-sidebar {
  max-width: 300px;
  min-height: 250px;
}

/* Filter Bar for Directory */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.filter-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover, .filter-pill.active {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

/* Rich SEO Article Typography */
.article-body {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 1.75rem;
  margin: 40px 0 16px;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.35rem;
  margin: 32px 0 12px;
  color: var(--text-primary);
}

.article-body p {
  margin-bottom: 20px;
}

.article-body ul, .article-body ol {
  margin-bottom: 24px;
  padding-left: 28px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 40px;
}

.article-toc h4 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.article-toc ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-toc a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-toc a:hover {
  color: var(--brand-primary);
}
