/**
 * MarketingMentor — Стили ключевых компонентов
 * Инспирировано Ciroapp & Toolfinder: строгий минимализм, чистота и читаемость.
 */

:root {
  --mm-font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  --mm-color-bg: #ffffff;
  --mm-color-surface: #f8fafc;
  --mm-color-surface-hover: #f1f5f9;
  --mm-color-border: #e2e8f0;
  --mm-color-border-dark: #cbd5e1;
  --mm-color-text-main: #0f172a;
  --mm-color-text-muted: #64748b;
  --mm-color-primary: #0284c7;
  --mm-color-primary-dark: #0369a1;
  --mm-color-success: #10b981;
  --mm-color-warning: #f59e0b;
  --mm-color-badge-bg: #eff6ff;
  --mm-color-badge-text: #1d4ed8;
  --mm-radius-sm: 6px;
  --mm-radius-md: 10px;
  --mm-radius-lg: 14px;
  --mm-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.02);
  --mm-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   1. Карточки инструментов (Tool Cards) — Grid & UX
   ========================================================================== */

.mm-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.mm-tool-card {
  position: relative;
  background: var(--mm-color-bg);
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--mm-shadow-card);
}

.mm-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mm-shadow-hover);
  border-color: var(--mm-color-border-dark);
}

.mm-tool-card.is-promoted {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

.mm-tool-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.mm-tool-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--mm-radius-sm);
  object-fit: cover;
  border: 1px solid var(--mm-color-border);
  background: #ffffff;
  flex-shrink: 0;
}

.mm-tool-title-wrap {
  flex-grow: 1;
}

.mm-tool-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--mm-color-text-main);
}

.mm-tool-name a {
  color: inherit;
  text-decoration: none;
}

.mm-tool-rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.mm-tool-badge-promoted {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #dbeafe;
  color: #1e40af;
  padding: 3px 8px;
  border-radius: 9999px;
}

.mm-tool-oneliner {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--mm-color-text-muted);
  margin-bottom: 16px;
  flex-grow: 1;
}

.mm-tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.mm-tool-tag {
  font-size: 0.78rem;
  color: var(--mm-color-text-muted);
  background: var(--mm-color-surface);
  border: 1px solid var(--mm-color-border);
  padding: 2px 8px;
  border-radius: 4px;
}

.mm-tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--mm-color-border);
  margin-top: auto;
}

.mm-tool-price {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--mm-color-text-main);
}

.mm-tool-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--mm-color-text-main);
  color: #ffffff !important;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--mm-radius-sm);
  text-decoration: none;
  transition: background 0.15s ease;
}

.mm-tool-cta:hover {
  background: var(--mm-color-primary-dark);
}

/* ==========================================================================
   2. Живой поиск и фильтры (Toolfinder-style Bar)
   ========================================================================== */

.mm-search-filter-bar {
  background: var(--mm-color-surface);
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-lg);
  padding: 16px 20px;
  margin: 24px 0 32px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mm-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mm-search-icon {
  position: absolute;
  left: 16px;
  color: var(--mm-color-text-muted);
  pointer-events: none;
}

.mm-search-input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 1rem;
  background: #ffffff;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-md);
  color: var(--mm-color-text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mm-search-input:focus {
  border-color: var(--mm-color-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.mm-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mm-pill-button {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid var(--mm-color-border);
  color: var(--mm-color-text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.mm-pill-button:hover,
.mm-pill-button.is-active {
  background: var(--mm-color-text-main);
  border-color: var(--mm-color-text-main);
  color: #ffffff;
}

/* ==========================================================================
   3. Оглавление (TOC) & Reading Time
   ========================================================================== */

.mm-reading-time {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--mm-color-text-muted);
}

.mm-toc-block {
  background: var(--mm-color-surface);
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-md);
  padding: 20px 24px;
  margin: 28px 0;
}

.mm-toc-header {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: var(--mm-color-text-main);
}

.mm-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mm-toc-item {
  margin-bottom: 8px;
  line-height: 1.4;
}

.mm-toc-item.mm-toc-level-3 {
  padding-left: 18px;
  font-size: 0.92rem;
}

.mm-toc-item a {
  color: var(--mm-color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.mm-toc-item a:hover,
.mm-toc-item.is-active a {
  color: var(--mm-color-primary);
  font-weight: 600;
}

/* ==========================================================================
   4. Блоки врезок (Callouts)
   ========================================================================== */

.mm-callout {
  border-radius: var(--mm-radius-md);
  padding: 20px 24px;
  margin: 32px 0;
  border-left: 4px solid;
}

.mm-callout-mentor {
  background: #f0fdf4;
  border-left-color: #22c55e;
}

.mm-callout-warning {
  background: #fffbeb;
  border-left-color: #f59e0b;
}

.mm-callout-tool {
  background: #f8fafc;
  border-left-color: var(--mm-color-primary);
}

.mm-callout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--mm-color-text-main);
}

.mm-callout-tool-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid var(--mm-color-border);
  border-radius: var(--mm-radius-sm);
  padding: 12px 16px;
  margin-top: 14px;
}

.mm-callout-tool-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

.mm-callout-tool-info {
  flex-grow: 1;
}

.mm-callout-tool-info h4 {
  margin: 0 0 2px 0;
  font-size: 0.95rem;
}

.mm-callout-tool-info p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--mm-color-text-muted);
}

/* ==========================================================================
   5. Нативный рекламный слот
   ========================================================================== */

.mm-ad-slot {
  background: #f8fafc;
  border: 1px dashed var(--mm-color-border-dark);
  border-radius: var(--mm-radius-md);
  padding: 20px;
  margin: 36px 0;
  text-align: center;
}

.mm-ad-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--mm-color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.mm-ad-banner-link {
  text-decoration: none;
  display: block;
}

.mm-ad-headline {
  display: block;
  font-weight: 700;
  color: var(--mm-color-text-main);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.mm-ad-cta {
  font-size: 0.88rem;
  color: var(--mm-color-primary);
  font-weight: 600;
}
