/*
Theme Name: Promptora
Theme URI: https://promptora.example
Author: Promptora
Description: AI prompt discovery and creator community theme — Prompt custom post type, Creator League leaderboard, follow/favorite system. Requires the "Promptora Core" plugin.
Version: 1.0.0
Requires PHP: 7.4
Text Domain: promptora
*/

:root {
  --background: #ffffff;
  --foreground: #16161a;
  --muted: #f6f6f4;
  --muted-foreground: #6f6f76;
  --card: #ffffff;
  --border: #e7e7e3;
  --accent: #ff5a36;
  --accent-foreground: #ffffff;
  --accent-soft: #fff1ec;
  --danger: #e5484d;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -0.015em; margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- */
/* Shell layout: sidebar + main                                       */
/* ---------------------------------------------------------------- */
.pt-shell { display: flex; min-height: 100vh; }
.pt-sidebar {
  width: 236px; flex-shrink: 0; height: 100vh; position: sticky; top: 0;
  border-right: 1px solid var(--border); background: var(--card);
  display: flex; flex-direction: column; overflow-y: auto;
}
.pt-brand { display: flex; align-items: center; gap: 8px; padding: 20px 16px 14px; }
.pt-brand .mark {
  width: 28px; height: 28px; border-radius: 9px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700;
}
.pt-brand .name { font-size: 15px; font-weight: 600; }

.pt-nav { flex: 1; padding: 0 12px 16px; }
.pt-nav-group { margin-bottom: 2px; }
.pt-nav-group .pt-nav-title {
  margin: 20px 10px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(111,111,118,0.7);
}
.pt-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-md);
  font-size: 13.5px; color: rgba(22,22,26,0.8); position: relative;
}
.pt-nav-link:hover { background: var(--muted); color: var(--foreground); }
.pt-nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.pt-nav-link.is-active::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px;
  border-radius: 999px; background: var(--accent); transform: translateY(-50%);
}
.pt-cta {
  display: block; margin-top: 20px; padding: 12px; border-radius: var(--radius-md);
  border: 1px solid rgba(255,90,54,0.25); background: var(--accent-soft);
}
.pt-cta .title { font-size: 13px; font-weight: 500; color: var(--accent); }
.pt-cta .sub { font-size: 12px; color: var(--muted-foreground); margin-top: 2px; }
.pt-info-link { display: block; padding: 7px 10px; border-radius: var(--radius-md); font-size: 13px; color: var(--muted-foreground); }
.pt-info-link:hover { background: var(--muted); color: var(--foreground); }

.pt-sidebar-foot { border-top: 1px solid var(--border); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }

.pt-main { flex: 1; min-width: 0; }
.pt-topbar {
  position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,0.95); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; align-items: center; gap: 12px;
}
.pt-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; background: var(--muted);
}
.pt-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 14px; }

.pt-menu-btn { display: none; }

.pt-content { padding: 28px 36px 64px; }

@media (max-width: 880px) {
  .pt-sidebar { position: fixed; left: -260px; z-index: 40; transition: left .2s ease; box-shadow: 0 0 0 100vmax rgba(0,0,0,0); }
  .pt-sidebar.is-open { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,0.15); }
  .pt-menu-btn { display: flex; align-items: center; justify-content: center; background: none; border: none; padding: 6px; }
  .pt-content { padding: 20px 16px 84px; }
}

/* ---------------------------------------------------------------- */
/* Mobile bottom nav                                                    */
/* ---------------------------------------------------------------- */
.pt-mobile-nav {
  display: none;
}
@media (max-width: 880px) {
  .pt-mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: rgba(255,255,255,0.97); border-top: 1px solid var(--border);
  }
  .pt-mobile-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 10px 0; font-size: 11px; color: var(--muted-foreground);
  }
  .pt-mobile-nav a.is-active { color: var(--accent); }
}

/* ---------------------------------------------------------------- */
/* Filter chips                                                         */
/* ---------------------------------------------------------------- */
.pt-chip-row { display: flex; gap: 6px; flex-wrap: wrap; overflow-x: auto; }
.pt-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--foreground);
  background: transparent;
}
.pt-chip:hover { background: var(--muted); }
.pt-chip.is-active { background: var(--foreground); color: #fff; border-color: var(--foreground); }

/* ---------------------------------------------------------------- */
/* Masonry feed + cards                                                 */
/* ---------------------------------------------------------------- */
.pt-masonry { column-gap: 18px; column-count: 2; }
.pt-masonry > * { break-inside: avoid; margin-bottom: 18px; }
@media (min-width: 640px) { .pt-masonry { column-count: 2; } }
@media (min-width: 768px) { .pt-masonry { column-count: 3; } }
@media (min-width: 1024px) { .pt-masonry { column-count: 4; } }
@media (min-width: 1280px) { .pt-masonry { column-count: 5; } }

.pt-card {
  display: block; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card);
  overflow: hidden; transition: box-shadow .2s ease, transform .2s ease;
}
.pt-card:hover { box-shadow: 0 8px 24px -12px rgba(22,22,26,0.18); }
.pt-card .frame { position: relative; width: 100%; background-size: cover; background-position: center; }
.pt-card .frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pt-card .frame .tag {
  position: absolute; top: 10px; left: 10px; background: rgba(22,22,26,0.72); color: #fff;
  font-size: 10.5px; padding: 4px 9px; border-radius: 999px;
}
.pt-card .frame .fav-btn {
  position: absolute; top: 9px; right: 9px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: none; display: flex; align-items: center; justify-content: center;
}
.pt-card .frame .overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0) 55%);
  opacity: 0; transition: opacity .2s ease; display: flex; align-items: flex-end; justify-content: space-between;
  padding: 10px; gap: 8px;
}
.pt-card:hover .overlay { opacity: 1; }
.pt-card .overlay .who { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 12px; font-weight: 500; min-width: 0; }
.pt-card .overlay .copy-btn {
  background: rgba(255,255,255,0.92); border: none; border-radius: 999px; padding: 5px 10px; font-size: 11.5px; font-weight: 600;
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}
.pt-card .meta { padding: 12px; }
.pt-card .meta .title { font-size: 13.5px; font-weight: 500; margin: 0 0 6px; line-height: 1.35; }
.pt-card .meta .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-foreground); }

.pt-avatar {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex-shrink: 0;
}

/* ---------------------------------------------------------------- */
/* Buttons / badges                                                     */
/* ---------------------------------------------------------------- */
.pt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-md); font-size: 13.5px; font-weight: 500; padding: 9px 16px; border: 1px solid transparent;
}
.pt-btn-primary { background: var(--foreground); color: #fff; }
.pt-btn-accent { background: var(--accent); color: #fff; }
.pt-btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.pt-btn-outline:hover { background: var(--muted); }
.pt-btn-sm { padding: 6px 12px; font-size: 12.5px; }
.pt-btn[disabled] { opacity: .6; pointer-events: none; }

.pt-badge {
  display: inline-flex; align-items: center; border-radius: var(--radius-sm); padding: 3px 9px; font-size: 11.5px; font-weight: 500;
  background: var(--muted); color: var(--muted-foreground);
}
.pt-badge-accent { background: var(--accent-soft); color: var(--accent); }
.pt-badge-dark { background: rgba(22,22,26,0.9); color: #fff; }

/* ---------------------------------------------------------------- */
/* Prompt detail page                                                   */
/* ---------------------------------------------------------------- */
.pt-detail { display: grid; gap: 40px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 1024px) { .pt-detail { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.pt-detail .image-col { border-radius: var(--radius-lg); overflow: hidden; }
.pt-prompt-box { border: 1px solid var(--border); background: rgba(246,246,244,0.6); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
.pt-prompt-box .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pt-prompt-box .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-foreground); }
.pt-prompt-box p { font-size: 13.5px; line-height: 1.6; margin: 0; }

/* ---------------------------------------------------------------- */
/* Creator League                                                       */
/* ---------------------------------------------------------------- */
.pt-podium { display: grid; gap: 14px; }
@media (min-width: 640px) { .pt-podium { grid-template-columns: repeat(3, 1fr); } }
.pt-podium-card { border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); padding: 20px; }
.pt-podium-card.is-leader {
  border-color: rgba(255,90,54,0.3); background: linear-gradient(to bottom, var(--accent-soft), var(--card));
  box-shadow: 0 16px 32px -20px rgba(255,90,54,0.45);
}
.pt-podium-card .rank-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.pt-podium-card .rank-num { font-size: 22px; font-weight: 600; color: rgba(22,22,26,0.7); }
.pt-podium-card.is-leader .rank-num { font-size: 28px; color: var(--accent); }
.pt-podium-card .rank-label { border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; font-size: 11px; color: var(--muted-foreground); }
.pt-podium-card.is-leader .rank-label { background: var(--accent); color: #fff; border: none; }
.pt-podium-card .who { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pt-podium-card .stats-row { display: flex; justify-content: space-between; align-items: flex-end; }
.pt-podium-card .stats-row .num { font-size: 20px; font-weight: 600; }
.pt-podium-card.is-leader .stats-row .num { font-size: 24px; }
.pt-podium-card .stats-row .lbl { font-size: 11px; color: var(--muted-foreground); }

.pt-league-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-league-table th { text-align: left; font-size: 12px; color: var(--muted-foreground); font-weight: 500; padding: 0 10px 10px; border-bottom: 1px solid var(--border); }
.pt-league-table th.num, .pt-league-table td.num { text-align: right; }
.pt-league-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); }
.pt-league-table tr:hover { background: var(--muted); }
.pt-league-table tr:nth-child(even) { background: rgba(246,246,244,0.5); }
.pt-rank-pill { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--muted); align-items: center; justify-content: center; font-size: 12.5px; font-weight: 500; }
.pt-prize-pill { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 500; }

/* ---------------------------------------------------------------- */
/* Creator header                                                       */
/* ---------------------------------------------------------------- */
.pt-creator-header .cover { height: 112px; border-radius: var(--radius-lg); background: linear-gradient(to bottom right, var(--accent-soft), var(--muted)); }
.pt-creator-header .row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: -36px; padding: 0 4px; flex-wrap: wrap; }
.pt-creator-header .who { display: flex; align-items: flex-end; gap: 16px; }
.pt-creator-header .stats { display: flex; gap: 32px; flex-wrap: wrap; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 16px 0; margin-top: 20px; }
.pt-creator-header .stat .num { font-size: 17px; font-weight: 600; }
.pt-creator-header .stat .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- */
/* Forms                                                                */
/* ---------------------------------------------------------------- */
.pt-field { margin-bottom: 18px; }
.pt-field label { display: block; font-size: 12.5px; color: var(--muted-foreground); margin-bottom: 6px; }
.pt-field input, .pt-field textarea, .pt-field select {
  width: 100%; font-family: inherit; font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 12px; background: #fff; color: var(--foreground); outline: none;
}
.pt-field textarea { min-height: 100px; resize: vertical; }
.pt-field input:focus, .pt-field textarea:focus, .pt-field select:focus { border-color: var(--accent); }
.pt-form-row { display: flex; gap: 14px; }
.pt-form-row .pt-field { flex: 1; }

.pt-empty { text-align: center; padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); color: var(--muted-foreground); }
