/* ========================================
   Create Post Modal & Post Cards
   Dark theme — Creator Hub V
   ======================================== */

/* ---- Overlay ---- */
.cp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: cp-fadeIn 0.2s ease;
}

.cp-overlay.cp-fade-out {
  animation: cp-fadeOut 0.28s ease forwards;
}

@keyframes cp-fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ---- Modal Container ---- */
.cp-modal {
  background: var(--surface-bg, #1a1a1a);
  border: 1px solid var(--surface-border, #2a2a2a);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cp-slideUp 0.3s ease;
  position: relative;
}

@keyframes cp-slideUp {
  from { transform: translateY(28px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ---- Header ---- */
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--surface-border, #2a2a2a);
  flex-shrink: 0;
}

.cp-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin: 0;
}

/* Step dots */
.cp-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cp-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-border, #444);
  transition: background 0.25s, width 0.25s, border-radius 0.25s;
}

.cp-step-dot.active {
  background: #4f7cff;
  width: 22px;
  border-radius: 4px;
}

.cp-step-dot.done {
  background: #4f7cff;
  opacity: 0.35;
}

/* Close button */
.cp-close {
  background: transparent;
  border: none;
  color: var(--text-secondary, #b0b0b0);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.cp-close:hover {
  background: var(--hover-bg, #2a2a2a);
  color: var(--text-primary, #fff);
}

/* ---- Scrollable Body ---- */
.cp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---- Step containers ---- */
.cp-step {
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

/* ========================================
   Step 1 — Dropzone
   ======================================== */
.cp-dropzone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px;
  border: 2px dashed var(--surface-border, #3a3a3a);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 300px;
}

.cp-dropzone:hover,
.cp-dropzone.drag-over {
  border-color: #4f7cff;
  background: rgba(79, 124, 255, 0.05);
}

.cp-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary, #b0b0b0);
  padding: 30px;
  text-align: center;
  pointer-events: none;
}

.cp-dropzone-inner button {
  pointer-events: auto;
}

.cp-dropzone-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.cp-dropzone-sub { font-size: 13px; }

.cp-dropzone-hint {
  font-size: 11px;
  opacity: 0.55;
  margin-top: 2px;
}

/* ========================================
   Step 1 — Carousel
   ======================================== */
.cp-carousel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 14px 0;
  gap: 10px;
  flex: 1;
}

.cp-carousel-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.cp-media-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  border-radius: 10px;
  overflow: hidden;
  min-height: 260px;
  max-height: 400px;
}

.cp-media-preview {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.cp-remove-media {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  line-height: 1;
}

.cp-remove-media:hover { background: rgba(220, 53, 69, 0.85); }

.cp-media-badge {
  position: absolute;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  pointer-events: none;
}

.cp-media-badge--video { left: 8px; }
.cp-media-badge--count { right: 8px; }

.cp-arrow {
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.cp-arrow:hover { background: rgba(79, 124, 255, 0.55); }

.cp-dots {
  display: flex;
  gap: 6px;
  padding: 4px 0 8px;
}

.cp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-border, #444);
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}

.cp-dot.active {
  background: #4f7cff;
  transform: scale(1.35);
}

/* ========================================
   Footer & Buttons
   ======================================== */
.cp-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--surface-border, #2a2a2a);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.cp-footer--split { justify-content: space-between; }

.cp-btn-primary,
.cp-btn-ghost,
.cp-btn-outline,
.cp-btn-cta {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  white-space: nowrap;
}

.cp-btn-primary {
  background: #4f7cff;
  color: #fff;
}

.cp-btn-primary:hover:not(:disabled) { opacity: 0.85; }
.cp-btn-primary:disabled { opacity: 0.38; cursor: not-allowed; }

.cp-btn-cta {
  background: linear-gradient(135deg, #4f7cff, #101594);
  color: #fff;
  padding: 9px 26px;
  font-size: 15px;
}

.cp-btn-cta:hover:not(:disabled) { opacity: 0.88; }
.cp-btn-cta:disabled { opacity: 0.4; cursor: not-allowed; }

.cp-btn-ghost {
  background: transparent;
  color: var(--text-secondary, #b0b0b0);
}

.cp-btn-ghost:hover {
  color: var(--text-primary, #fff);
  background: var(--hover-bg, #2a2a2a);
}

.cp-btn-outline {
  background: transparent;
  border: 1px solid var(--surface-border, #3a3a3a);
  color: var(--text-primary, #fff);
}

.cp-btn-outline:hover {
  border-color: #4f7cff;
  color: #4f7cff;
}

/* ========================================
   Step 2 — Form
   ======================================== */
.cp-form {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

.cp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary, #b0b0b0);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cp-required { color: #ff5555; }

.cp-input-wrap { position: relative; }

.cp-input,
.cp-textarea,
.cp-select {
  width: 100%;
  background: #111;
  border: 1px solid var(--surface-border, #2a2a2a);
  border-radius: 8px;
  color: var(--text-primary, #fff);
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.cp-input:focus,
.cp-textarea:focus,
.cp-select:focus {
  border-color: #4f7cff;
}

.cp-input { padding-right: 58px; }

.cp-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.cp-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.cp-select option { background: #1a1a1a; }

.cp-char-count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-secondary, #888);
  pointer-events: none;
}

.cp-hashtags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.cp-hashtag-pill {
  background: rgba(79, 124, 255, 0.14);
  color: #4f7cff;
  border: 1px solid rgba(79, 124, 255, 0.28);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}

.cp-hashtag-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}

.cp-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin: 4px 0 0;
}

/* ========================================
   Step 3 — Access Cards
   ======================================== */
.cp-access-cards {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.cp-access-card {
  border: 1px solid var(--surface-border, #2a2a2a);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
  display: block;
}

.cp-access-card:hover { border-color: #4f7cff; }

.cp-access-card.selected {
  border-color: #4f7cff;
  background: rgba(79, 124, 255, 0.07);
}

.cp-access-card.cp-access-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.cp-access-card input[type="radio"] { display: none; }

.cp-access-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}

.cp-access-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }

.cp-access-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cp-access-title {
  font-size: 14px;
  color: var(--text-primary, #fff);
}

.cp-access-desc {
  font-size: 12px;
  color: var(--text-secondary, #b0b0b0);
}

/* Paid price section */
.cp-price-section {
  padding: 10px 15px 14px;
  border-top: 1px solid var(--surface-border, #2a2a2a);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-price-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #111;
  border: 1px solid var(--surface-border, #2a2a2a);
  border-radius: 8px;
  padding: 8px 12px;
  width: 150px;
}

.cp-price-symbol {
  color: var(--text-secondary, #b0b0b0);
  font-size: 15px;
  font-weight: 600;
}

.cp-price-input {
  background: transparent;
  border: none;
  color: var(--text-primary, #fff);
  font-size: 18px;
  font-weight: 600;
  width: 100%;
  outline: none;
  padding: 0;
}

/* Remove browser number spinners */
.cp-price-input::-webkit-inner-spin-button,
.cp-price-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.cp-price-input { -moz-appearance: textfield; }

.cp-fee-calc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary, #b0b0b0);
}

.cp-earnings { color: #4caf50; }

/* Tier section */
.cp-tier-section {
  padding: 10px 15px 14px;
  border-top: 1px solid var(--surface-border, #2a2a2a);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-tier-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #ffc107;
  line-height: 1.5;
}

.cp-tier-warning svg { flex-shrink: 0; margin-top: 1px; }
.cp-tier-warning strong { color: #ffd54f; }

/* ========================================
   Toast
   ======================================== */
.cp-toast {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  animation: cp-fadeIn 0.2s ease;
  z-index: 10;
  pointer-events: none;
}

/* ========================================
   Spinner
   ======================================== */
.cp-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cp-spin 0.6s linear infinite;
}

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

/* ========================================
   Post Cards — Profile & Explore
   ======================================== */
.post-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  cursor: pointer;
  background: #111;
  transition: transform 0.2s;
}

.post-card:hover { transform: translateY(-3px); }

.post-card-thumb {
  width: 100%;
  height: 100%;
}

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

.post-card-thumb-empty {
  width: 100%;
  height: 100%;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-size: 36px;
}

.post-card-thumb.blurred img,
.post-card-thumb.blurred video {
  filter: blur(14px);
  transform: scale(1.05);
}

.post-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px 12px;
  pointer-events: none;
}

.post-card:hover .post-card-overlay { opacity: 1; }

.post-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.post-card-badge--lock  { background: rgba(0,0,0,0.6); color: #ffc107; }
.post-card-badge--price { background: rgba(0,0,0,0.6); color: #4caf50; }
.post-card-badge--tier  { background: rgba(0,0,0,0.6); color: #4f7cff; }
.post-card-badge--review { background: rgba(0,0,0,0.7); color: #ffb400; z-index: 2; }

.post-card-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 12px;
  color: #fff;
  pointer-events: none;
}

.posts-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary, #888);
  font-size: 15px;
}

/* ========================================
   Post Viewer Modal
   ======================================== */
.pv-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
  animation: cp-fadeIn 0.2s ease;
}

.pv-modal {
  background: var(--surface-bg, #1a1a1a);
  border: 1px solid var(--surface-border, #2a2a2a);
  border-radius: 14px;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cp-slideUp 0.3s ease;
}

.pv-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 18px;
  border-bottom: 1px solid var(--surface-border, #2a2a2a);
  flex-shrink: 0;
}

.pv-close {
  background: transparent;
  border: none;
  color: var(--text-secondary, #b0b0b0);
  font-size: 26px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.pv-close:hover { background: #2a2a2a; color: #fff; }

.pv-body {
  overflow-y: auto;
  flex: 1;
}

.pv-media {
  background: #000;
  flex-shrink: 0;
}

.pv-media-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 420px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}

.pv-media-stage.pv-blurred img,
.pv-media-stage.pv-blurred video {
  filter: blur(18px);
  transform: scale(1.08);
}

.pv-media-stage img,
.pv-media-stage video {
  max-width: 100%;
  display: block;
}

.pv-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 1;
  transition: background 0.2s;
}

.pv-arrow-left  { left: 10px; }
.pv-arrow-right { right: 10px; }
.pv-arrow:hover { background: rgba(79, 124, 255, 0.6); }

.pv-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: #000;
}

.pv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.pv-dot.active { background: #4f7cff; }

.pv-info {
  padding: 20px 24px 24px;
}

.pv-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin: 0 0 6px;
  line-height: 1.3;
}

.pv-author {
  font-size: 13px;
  color: var(--text-secondary, #888);
  margin-bottom: 14px;
}

.pv-desc-wrap { margin-bottom: 10px; }

.pv-desc {
  font-size: 14px;
  color: #ccc;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.pv-desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pv-show-more {
  background: none;
  border: none;
  color: #4f7cff;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0 0;
  display: block;
}

.pv-show-more:hover { text-decoration: underline; }

.pv-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* Lock wall */
.pv-lock-wall {
  margin: 0 24px 16px;
  background: rgba(79, 124, 255, 0.07);
  border: 1px solid rgba(79, 124, 255, 0.18);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
}

.pv-lock-icon { font-size: 34px; margin-bottom: 8px; }

.pv-lock-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #fff);
  margin-bottom: 6px;
}

.pv-lock-desc {
  font-size: 13px;
  color: var(--text-secondary, #888);
  margin-bottom: 16px;
}

.pv-lock-btn {
  background: #4f7cff;
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.pv-lock-btn:hover { opacity: 0.85; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 600px) {
  .cp-modal { border-radius: 10px; max-height: 95vh; }
  .cp-carousel { padding: 10px 10px 0; }
  .cp-access-cards { padding: 14px 14px; }
  .cp-form { padding: 14px; }
  .cp-footer { padding: 12px 14px; }
  .pv-info { padding: 16px; }
  .pv-modal { border-radius: 10px; }
}

/* Warnings in "create post" */
.cp-explicit-warning, .cp-monetization-off {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid rgba(255, 180, 0, 0.4);
  background: rgba(255, 180, 0, 0.08);
  color: #ffd27a;
}
.cp-monetization-off {
  margin: 0 0 12px;
  border-color: rgba(255, 90, 90, 0.5);
  background: rgba(255, 90, 90, 0.1);
  color: #ffb0b0;
}
