/* ========== APP SHELL ========== */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.app-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.app-nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.app-nav-link:hover {
  color: var(--fg);
  background: var(--bg-elevated);
}

.app-nav-link.active {
  color: var(--fg);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ========== DASHBOARD HEADER ========== */
.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.dash-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.dash-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ========== STATS ROW ========== */
.stats-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 120px;
}

.stat-pill-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
}

.stat-pill-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 500;
}

/* ========== SECTION TITLE ========== */
.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--fg);
}

/* ========== STORES GRID ========== */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.store-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.store-card:hover {
  border-color: rgba(147, 51, 234, 0.3);
}

.store-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.store-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.store-info {
  flex: 1;
  min-width: 0;
}

.store-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-url {
  font-size: 0.8rem;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: none;
  transition: color 0.15s, background 0.15s;
}

.icon-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  transform: none;
  box-shadow: none;
}

.store-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.meta-chip {
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-muted);
}

.meta-chip-warn {
  border-color: rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}

.store-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ========== BUTTONS SMALL ========== */
.btn-sm {
  padding: 0.5rem 0.9rem !important;
  font-size: 0.82rem !important;
  border-radius: 8px !important;
}

.btn-xs {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.78rem !important;
  border-radius: 6px !important;
}

.btn-icon {
  margin-right: 0.2rem;
}

.btn-danger {
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.2) !important;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1) !important;
  border-color: rgba(248, 113, 113, 0.4) !important;
}

/* ========== STATUS MESSAGES ========== */
.store-status,
.connect-status {
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}

.status-loading {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

.status-success {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #34d399;
}

.status-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #f87171;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  line-height: 1;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.empty-state p {
  color: var(--fg-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ========== CONNECT PAGE ========== */
.connect-container {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
}

.connect-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
}

.connect-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.connect-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.connect-hint {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.connect-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
  width: 100%;
}

.form-input:focus {
  border-color: var(--accent-light);
}

.form-input::placeholder {
  color: var(--fg-muted);
  opacity: 0.6;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.connect-submit {
  align-self: flex-start;
}

/* ========== CONNECT EXAMPLES ========== */
.connect-examples {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
}

.connect-examples h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--fg-muted);
  font-weight: 600;
}

.examples-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.example-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.1s;
  text-align: left;
  width: 100%;
  box-shadow: none;
  color: var(--fg);
}

.example-btn:hover {
  border-color: rgba(147, 51, 234, 0.3);
  transform: translateX(4px);
  box-shadow: none;
}

.example-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.example-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  flex: 1;
  color: var(--fg);
}

.example-domain {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* ========== POSTS GRID ========== */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: none;
}

.filter-tab:hover, .filter-tab.active {
  background: var(--bg-card);
  border-color: var(--accent-light);
  color: var(--fg);
  transform: none;
  box-shadow: none;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.post-card:hover {
  border-color: rgba(147, 51, 234, 0.3);
  transform: translateY(-2px);
}

.post-img-wrap {
  height: 180px;
  overflow: hidden;
  background: var(--bg-card);
}

.post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-body {
  padding: 1.25rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.platform-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
}

.platform-facebook { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.platform-instagram { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236,72,153,0.25); }
.platform-tiktok { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.25); }

.status-badge {
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft { background: rgba(161,161,170,0.1); color: #a1a1aa; border: 1px solid rgba(161,161,170,0.2); }
.badge-approved { background: rgba(52,211,153,0.1); color: #34d399; border: 1px solid rgba(52,211,153,0.25); }
.badge-published { background: rgba(147,51,234,0.1); color: #a78bfa; border: 1px solid rgba(147,51,234,0.25); }

.post-product {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-price {
  font-size: 0.82rem;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.post-caption {
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .connect-container {
    grid-template-columns: 1fr;
  }

  .connect-examples {
    order: -1;
  }

  .examples-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .example-btn {
    flex: 1;
    min-width: 140px;
  }

  .app-nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .stores-grid {
    grid-template-columns: 1fr;
  }
}
