/* ── Creator Platform Styles ─────────────────────────── */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --ink: #e6edf3;
  --ink2: #8b949e;
  --accent: #f0883e;
  --accent2: #d29922;
  --ok: #3fb950;
  --err: #f85149;
  --purple: #a371f7;
  --blue: #58a6ff;
  --border: #30363d;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--ink2);
  font-size: 0.9rem;
  border: none;
  background: none;
  transition: all 0.2s;
}

.nav-tab:hover { color: var(--ink); background: var(--bg3); }
.nav-tab.active { color: var(--accent); background: var(--bg3); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-connect {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-connect:hover { opacity: 0.9; }

.wallet-info {
  font-size: 0.85rem;
  color: var(--ink2);
}

/* ── Container ───────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.page { display: none; }
.page.active { display: block; }

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

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

/* ── Creator Grid ────────────────────────────────────── */
.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.creator-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  position: relative;
}

.creator-card:hover { border-color: var(--accent); }

.creator-banner {
  height: 100px;
  background: linear-gradient(135deg, var(--bg3), var(--accent));
  position: relative;
  overflow: hidden;
}

.creator-banner img { width: 100%; height: 100%; object-fit: cover; }

.creator-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--bg2);
  background: var(--bg3);
  margin-top: -32px;
  margin-left: 20px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--ink2);
  overflow: hidden;
}

.creator-avatar img { width: 100%; height: 100%; object-fit: cover; }

.creator-info {
  padding: 8px 20px 20px;
}

.creator-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.creator-bio {
  color: var(--ink2);
  font-size: 0.85rem;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.creator-stats {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--ink2);
}

.creator-stats span { color: var(--ink); font-weight: 600; }

/* ── Tier Badges ─────────────────────────────────────── */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tier-0 { background: #1f3a1f; color: var(--ok); }
.tier-1 { background: #1f2a3f; color: var(--blue); }
.tier-2 { background: #3f2a1f; color: var(--accent); }

/* ── Profile Page ────────────────────────────────────── */
.profile-header {
  position: relative;
  margin-bottom: 20px;
  overflow: visible;
}

.profile-banner {
  height: 200px;
  background: linear-gradient(135deg, var(--bg3), var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
}

.profile-banner img { width: 100%; height: 100%; object-fit: cover; }

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--bg);
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-info {
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.profile-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}

.profile-details h2 { margin-bottom: 4px; }

.profile-details .bio {
  color: var(--ink2);
  margin-bottom: 12px;
  max-width: 600px;
}

.profile-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.stat-item { text-align: center; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--ink2); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-subscribe { background: var(--ok); color: #fff; }
.btn-danger { background: var(--err); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ── Content Wall ────────────────────────────────────── */
.content-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.content-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.content-preview {
  height: 180px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.content-preview img { width: 100%; height: 100%; object-fit: cover; }

.content-lock {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.lock-icon { font-size: 2rem; margin-bottom: 8px; }

.content-meta {
  padding: 12px;
}

.content-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.content-desc {
  color: var(--ink2);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.content-price {
  color: var(--accent);
  font-weight: 700;
}

.content-type-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
}

.type-subscription { background: #1f2a3f; color: var(--blue); }
.type-ppv { background: #3f2a1f; color: var(--accent); }
.type-free { background: #1f3a1f; color: var(--ok); }

/* ── Content Footer (comment button) ─────────────────── */
.content-footer {
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-comment {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink2);
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}
.btn-comment:hover { background: var(--bg3); color: var(--ink); }

/* ── Comments Modal ──────────────────────────────────── */
.comment-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0 8px;
}

.comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }

.comment-body {
  flex: 1;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 8px 10px;
  position: relative;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.comment-name {
  font-weight: 600;
  font-size: 0.85rem;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--ink2);
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.btn-del-comment {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink2);
  font-size: 0.75rem;
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
  border-radius: 3px;
}
.btn-del-comment:hover { opacity: 1; color: var(--err); background: rgba(255,80,80,0.1); }

.comment-input-area {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.comment-input-area textarea {
  flex: 1;
  min-height: 60px;
  max-height: 120px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--ink);
  font-size: 0.9rem;
  font-family: inherit;
}

.comment-empty {
  text-align: center;
  padding: 24px;
  color: var(--ink2);
  font-size: 0.9rem;
}

/* ── Forms ───────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: var(--ink2);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Custom File Input ───────────────────────────────── */
.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.file-input-wrapper input[type="file"] { display: none; }
.file-name-label {
  font-size: 0.85rem;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* ── Dashboard Stats ─────────────────────────────────── */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.dashboard-stat .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.dashboard-stat .label {
  font-size: 0.85rem;
  color: var(--ink2);
  margin-top: 4px;
}

/* ── Modal ───────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.active { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

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

.modal-close {
  background: none;
  border: none;
  color: var(--ink2);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ── Toast ───────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease-out;
}

.toast-success { background: #1a4a1a; color: var(--ok); border: 1px solid var(--ok); }
.toast-error { background: #4a1a1a; color: var(--err); border: 1px solid var(--err); }
.toast-info { background: #1a2a4a; color: var(--blue); border: 1px solid var(--blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Tabs ────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.tab-btn {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink2);
  cursor: pointer;
  font-size: 0.9rem;
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Empty State ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink2);
}

.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { margin-bottom: 16px; }

/* ── Loading ─────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Search Bar ──────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}

.search-bar input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.9rem;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Subscription Cards ─────────────────────────────── */
.sub-card {
  padding: 20px;
}

.sub-card-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.sub-card-info { flex: 1; }

.sub-card-status {
  min-width: 140px;
  text-align: center;
}

.sub-card-actions {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .nav-tabs { width: 100%; overflow-x: auto; }
  .creator-grid { grid-template-columns: 1fr; }
  .content-wall { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .profile-info { flex-direction: column; }
}
