/* ==========================================================================
   Tema oscuro · acento rosa→coral
   ========================================================================== */
:root,
[data-bs-theme="dark"] {
  --accent: #ff4f8b;
  --accent-2: #ff8a5c;
  --accent-rgb: 255, 79, 139;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --bg: #0e0d12;
  --surface: #17151d;
  --surface-2: #1f1c27;
  --line: #2a2633;
  --muted: #9a94a6;

  --bs-body-bg: var(--bg);
  --bs-body-color: #ece9f1;
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-link-color: #ff79a6;
  --bs-link-hover-color: #ffa3c2;
  --bs-link-color-rgb: 255, 121, 166;
  --bs-tertiary-bg: var(--surface-2);
  --bs-card-bg: var(--surface);
  --bs-border-radius: .75rem;
  --bs-border-radius-lg: 1rem;
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body { background: var(--bg); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
::selection { background: rgba(var(--accent-rgb), .35); }

.text-accent { color: var(--accent) !important; }
.bg-accent { background: var(--grad) !important; color: #fff; }
.text-gradient { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.min-w-0 { min-width: 0; }

/* Botones */
.btn-accent {
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  background: var(--grad);
  border: 0;
  font-weight: 600;
  box-shadow: 0 6px 20px -8px rgba(var(--accent-rgb), .7);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s;
}
.btn-accent:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 10px 26px -8px rgba(var(--accent-rgb), .8); }
.btn-accent:disabled { filter: grayscale(.6); opacity: .6; }

/* Tarjetas y formularios */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.form-control, .form-select, .input-group-text { background-color: var(--surface-2); border-color: var(--line); }
.form-control:focus, .form-select:focus { background-color: var(--surface-2); border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .18); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.list-group-item { background: var(--surface); border-color: var(--line); }
.table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); }
.dropdown-menu { background: var(--surface-2); border-color: var(--line); }
.modal-content { background: var(--surface); border: 1px solid var(--line); }
.alert-secondary { background: var(--surface-2); border-color: var(--line); color: var(--bs-body-color); }

/* Navegación */
.app-nav { background: rgba(14, 13, 18, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 1.35rem; display: flex; align-items: center; gap: .5rem; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 14px rgba(var(--accent-rgb), .8); }
.nav-search { position: relative; max-width: 420px; }
.nav-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.nav-search input { padding-left: 38px; }
.app-footer { border-top: 1px solid var(--line); }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: #fff; }

/* Avatares */
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.avatar-xs { width: 22px; height: 22px; }
.avatar-sm { width: 34px; height: 34px; }
.avatar-lg { width: 76px; height: 76px; }
.avatar-xl { width: 84px; height: 84px; }

/* Hero */
.hero {
  background:
    radial-gradient(800px 300px at 90% -10%, rgba(var(--accent-rgb), .25), transparent 60%),
    radial-gradient(600px 300px at -10% 110%, rgba(255, 138, 92, .18), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
}
.hero-perks .perk { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; }
.hero-perks .perk + .perk { border-top: 1px solid var(--line); }
.hero-perks .perk > i { font-size: 1.5rem; color: var(--accent); }

/* Etiquetas */
.tag-scroller, .h-scroller { display: flex; gap: .5rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.tag-scroller::-webkit-scrollbar, .h-scroller::-webkit-scrollbar { display: none; }
.tag-chip { white-space: nowrap; padding: .45rem 1rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--bs-body-color); text-decoration: none; font-size: .9rem; transition: all .15s; }
.tag-chip:hover, .tag-chip.active { border-color: var(--accent); color: #fff; background: rgba(var(--accent-rgb), .15); }
.tag-chip-sm { padding: .2rem .7rem; font-size: .8rem; }

.h-scroller { gap: 1.25rem; }
.story { width: 92px; flex-shrink: 0; }
.story-ring { padding: 3px; background: var(--grad); }

/* Tarjeta de creadora */
.creator-card { overflow: hidden; transition: transform .2s ease, border-color .2s; }
.creator-card:hover { transform: translateY(-3px); border-color: rgba(var(--accent-rgb), .5); }
.creator-cover { height: 96px; background-size: cover; background-position: center; }
.creator-avatar { margin-top: -38px; border: 4px solid var(--surface); }

/* Grilla de fotos (home) */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.photo-tile { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: .6rem; background: var(--surface-2); display: block; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.photo-tile:hover img { transform: scale(1.04); }
.tile-count { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.tile-creator { position: absolute; inset: auto 0 0 0; padding: 24px 10px 8px; font-size: .8rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); display: flex; gap: 6px; align-items: center; }

/* Publicaciones */
.post-card { overflow: hidden; }
.post-body { white-space: normal; word-break: break-word; }
.badge-free { background: rgba(80, 200, 140, .15); color: #6fe0a6; border: 1px solid rgba(80, 200, 140, .3); }
.badge-subs { background: rgba(var(--accent-rgb), .15); color: #ff8fb4; border: 1px solid rgba(var(--accent-rgb), .3); }
.badge-ppv  { background: rgba(255, 196, 80, .15); color: #ffcf6e; border: 1px solid rgba(255, 196, 80, .3); }

.media-grid { position: relative; display: grid; gap: 2px; background: #000; }
.media-grid.grid-1 { grid-template-columns: 1fr; }
.media-grid.grid-2 { grid-template-columns: 1fr 1fr; }
.media-grid.grid-3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.media-grid.grid-3 .media-item:first-child { grid-row: span 2; }
.media-grid.grid-4 { grid-template-columns: 1fr 1fr; }
.media-item { position: relative; display: block; overflow: hidden; aspect-ratio: 1; }
.media-grid.grid-1 .media-item { aspect-ratio: auto; max-height: 720px; }
.media-grid.grid-3 .media-item:first-child { aspect-ratio: auto; }
.media-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-grid.grid-1 .media-item img { object-fit: contain; max-height: 720px; background: #000; }
.media-item .more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-size: 2rem; font-weight: 700; }
.media-grid.is-locked .media-item img { filter: blur(6px) brightness(.6); transform: scale(1.1); }
.media-grid.is-locked.grid-1 .media-item { aspect-ratio: 4 / 3; }
.lock-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; background: radial-gradient(circle, rgba(0, 0, 0, .25), rgba(0, 0, 0, .6)); padding: 1rem; }

img.protected { -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }

.like-btn { color: var(--muted); text-decoration: none; }
.like-btn:hover, .like-btn.liked { color: var(--accent); }
.like-btn.pop i { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.35); } }

/* Perfil */
.profile-cover { height: 220px; background-size: cover; background-position: center; }
.profile-top { margin-top: -52px; }
.profile-avatar { width: 120px; height: 120px; border: 5px solid var(--surface); }
.profile-bio { max-width: 720px; color: #d7d2df; }
.subscribe-box { background: linear-gradient(135deg, rgba(var(--accent-rgb), .12), rgba(255, 138, 92, .08)), var(--surface); border-color: rgba(var(--accent-rgb), .35); }
@media (max-width: 576px) { .profile-cover { height: 150px; } .profile-avatar { width: 92px; height: 92px; } }

/* Paneles */
.side-nav { gap: 2px; }
.side-link { display: flex; align-items: center; gap: .65rem; padding: .6rem .9rem; border-radius: .6rem; color: var(--bs-body-color); text-decoration: none; }
.side-link:hover { background: var(--surface-2); }
.side-link.active { background: rgba(var(--accent-rgb), .15); color: #fff; }
.side-link.active i { color: var(--accent); }
.stat-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: .35rem; }
.bar-chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; }
.bar-chart .bar { flex: 1; background: var(--grad); border-radius: 4px 4px 0 0; min-width: 4px; opacity: .85; }
.bar-chart .bar:hover { opacity: 1; }

/* Compositor y subida */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; padding: 2rem 1rem; border: 2px dashed var(--line); border-radius: 1rem; cursor: pointer; transition: all .15s; background: var(--surface-2); }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(var(--accent-rgb), .07); }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.preview-grid:empty { display: none; }
.preview { position: relative; aspect-ratio: 1; border-radius: .6rem; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: .75rem; text-align: center; padding: 6px; }
.preview .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; line-height: 1; }
.preview .size { position: absolute; bottom: 4px; left: 4px; font-size: .7rem; background: rgba(0, 0, 0, .6); padding: 1px 6px; border-radius: 999px; }

.vis-card { display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .8rem; cursor: pointer; background: var(--surface-2); transition: all .15s; }
.vis-card i { font-size: 1.25rem; color: var(--muted); }
.vis-card span { font-size: .8rem; color: var(--muted); }
.btn-check:checked + .vis-card { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.btn-check:checked + .vis-card i { color: var(--accent); }

.upload-list { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: .6rem; background: var(--surface-2); }
.upload-row img, .upload-row .ph { width: 44px; height: 44px; border-radius: .4rem; object-fit: cover; background: var(--line); flex-shrink: 0; }
.upload-row .info { flex: 1; min-width: 0; }
.upload-row .name { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-row .progress { height: 5px; margin-top: 4px; }
.upload-row .state { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.upload-row.done .state { color: #6fe0a6; }
.upload-row.error .state { color: #ff6b6b; }

/* Chat */
.chat { height: calc(100vh - 140px); min-height: 480px; display: flex; flex-direction: column; overflow: hidden; }
.chat-head { border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.chat-form { border-top: 1px solid var(--line); }
.chat-form textarea { resize: none; border-radius: 1.2rem; max-height: 140px; }
.chat-send, .chat-attach { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; padding: 0; }
.chat-price { max-width: 110px; }
.msg { display: flex; }
.msg-mine { justify-content: flex-end; }
.msg-bubble { max-width: min(78%, 460px); padding: .55rem .8rem; border-radius: 1.1rem; background: var(--surface-2); word-break: break-word; }
.msg-mine .msg-bubble { background: linear-gradient(135deg, rgba(var(--accent-rgb), .9), rgba(255, 138, 92, .9)); color: #fff; border-bottom-right-radius: .3rem; }
.msg-theirs .msg-bubble { border-bottom-left-radius: .3rem; }
.msg-bubble .media-grid { min-width: 220px; }
.msg-meta { font-size: .7rem; opacity: .7; text-align: right; margin-top: 2px; }
.chat-previews img { width: 56px; height: 56px; object-fit: cover; border-radius: .5rem; }

/* Varios */
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; border: 1px dashed var(--line); border-radius: 1rem; }
.auth-box { max-width: 480px; }
.age-gate { background: radial-gradient(400px 200px at 50% -20%, rgba(var(--accent-rgb), .25), transparent), var(--surface); }
.modal-backdrop.show { opacity: .85; }
.legal { max-width: 820px; line-height: 1.7; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal li { margin-bottom: .35rem; }
