/* ============================================================
   Media Service AI — User / Public Dashboard
   Modern responsive design — light/dark mode aware
   ============================================================ */

.msa-pub-wrap {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  color: #1a1a2e;
}

/* ── Dark mode ────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .msa-pub-wrap { color: #e8eaf6; }
  .msa-pub-card { background: #1e2235; border-color: rgba(255,255,255,0.08); }
  .msa-pub-card-title { color: #e8eaf6; }
  .msa-pub-card-meta  { color: #8b90b3; }
  .msa-pub-btn { background: #6c63ff; }
  .msa-pub-input { background: #1e2235; border-color: rgba(255,255,255,0.1); color: #e8eaf6; }
  .msa-pub-nav { background: #151827; border-color: rgba(255,255,255,0.08); }
  .msa-pub-nav-item:hover, .msa-pub-nav-item.active { background: rgba(108,99,255,0.15); }
}

/* ── User Dashboard Layout ────────────────────────────────── */
.msa-user-dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  margin: 24px 0;
}
@media (max-width: 768px) {
  .msa-user-dashboard { grid-template-columns: 1fr; }
}

/* ── Sidebar Nav ──────────────────────────────────────────── */
.msa-pub-nav {
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 80px;
  height: fit-content;
}
.msa-pub-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #555a7a;
  transition: all 0.2s;
  text-decoration: none;
  margin-bottom: 4px;
}
.msa-pub-nav-item:hover, .msa-pub-nav-item.active {
  background: rgba(108,99,255,0.08);
  color: #6c63ff;
}

/* ── Cards ────────────────────────────────────────────────── */
.msa-pub-card {
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.msa-pub-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.msa-pub-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 6px;
  line-height: 1.3;
  text-decoration: none;
  display: block;
}
.msa-pub-card-meta {
  font-size: 12px;
  color: #8b90b3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.msa-pub-card-summary {
  font-size: 14px;
  color: #555a7a;
  line-height: 1.6;
  margin: 8px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msa-pub-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #6c63ff22, #00d2ff22);
}

/* ── News Grid ────────────────────────────────────────────── */
.msa-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 20px 0;
}
@media (max-width: 640px) {
  .msa-news-grid { grid-template-columns: 1fr; }
}

/* ── Buttons ──────────────────────────────────────────────── */
.msa-pub-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #6c63ff, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-family: inherit;
}
.msa-pub-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(108,99,255,0.4);
  color: #fff;
}
.msa-pub-btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
}
.msa-pub-btn-ghost {
  background: transparent;
  color: #6c63ff;
  border: 1px solid #6c63ff;
}
.msa-pub-btn-ghost:hover {
  background: rgba(108,99,255,0.1);
  color: #6c63ff;
}

/* ── Inputs ───────────────────────────────────────────────── */
.msa-pub-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  box-sizing: border-box;
  background: #fff;
  color: #1a1a2e;
}
.msa-pub-input:focus {
  border-color: #6c63ff;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
}

/* ── Subscribe Widget ─────────────────────────────────────── */
.msa-subscribe-widget {
  background: linear-gradient(135deg, #6c63ff, #00d2ff);
  border-radius: 16px;
  padding: 24px;
  color: #fff;
  margin: 20px 0;
}
.msa-subscribe-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.msa-subscribe-form .msa-pub-input {
  flex: 1;
  min-width: 200px;
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.msa-subscribe-form .msa-pub-input::placeholder { color: rgba(255,255,255,0.7); }
.msa-subscribe-form .msa-pub-btn { background: #fff; color: #6c63ff; }
.msa-subscribe-msg { margin-top: 10px; font-size: 13px; }

/* ── Topic Badges ─────────────────────────────────────────── */
.msa-pub-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(108,99,255,0.1);
  color: #6c63ff;
  text-decoration: none;
  margin-right: 4px;
  margin-bottom: 4px;
}

/* ── Reading time indicator ───────────────────────────────── */
.msa-read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #8b90b3;
}

/* ── Pagination ───────────────────────────────────────────── */
.msa-pub-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}
.msa-pub-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.msa-pub-page-btn.active,
.msa-pub-page-btn:hover {
  background: #6c63ff;
  color: #fff;
  border-color: #6c63ff;
}

/* ── AI Recommendation Strip ──────────────────────────────── */
.msa-rec-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.msa-rec-card {
  flex-shrink: 0;
  width: 220px;
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s;
  cursor: pointer;
}
.msa-rec-card:hover {
  border-color: #6c63ff;
  box-shadow: 0 4px 16px rgba(108,99,255,0.15);
}

/* ── Dashboard Stats ──────────────────────────────────────── */
.msa-dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.msa-dash-stat {
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.msa-dash-stat-value { font-size: 24px; font-weight: 800; color: #6c63ff; }
.msa-dash-stat-label { font-size: 12px; color: #8b90b3; margin-top: 2px; }

/* ── Public notice ────────────────────────────────────────── */
.msa-public-notice {
  padding: 16px 20px;
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: 10px;
  font-size: 14px;
  color: #6c63ff;
}

/* ── Filter Bar ───────────────────────────────────────────── */
.msa-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.msa-filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  color: #555a7a;
}
.msa-filter-btn.active, .msa-filter-btn:hover {
  background: #6c63ff;
  color: #fff;
  border-color: #6c63ff;
}
