/* ==========================================================================
   Prompt Studio Core — site-wide design system
   Palette mirrors the Hostinger AI theme presets so blocks and plugin markup
   share one look: page bg #131219 · text #eeedf0 · accent #6b46f5.
   ========================================================================== */

:root {
  --psc-bg: #131219;
  --psc-surface: #1c1b24;
  --psc-surface-2: #23222d;
  --psc-border: #2a2838;
  --psc-text: #eeedf0;
  --psc-muted: #b8c0cc;
  --psc-dim: #8f8ba0;
  --psc-accent: #6b46f5;
  --psc-accent-hover: #5a38dd;
  --psc-success: #2fbf71;
  --psc-radius: 12px;
  --psc-radius-lg: 16px;
  --psc-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --psc-ease: .18s ease;
}

/* ---------- primitives ---------- */
.psc-card { display: block; overflow: hidden; border: 1px solid var(--psc-border); border-radius: var(--psc-radius); background: var(--psc-surface); color: var(--psc-text); text-decoration: none; transition: border-color var(--psc-ease), transform var(--psc-ease); }
a.psc-card:hover, a.psc-card:focus-visible { border-color: var(--psc-accent); transform: translateY(-2px); }
.psc-card--static { padding: 24px; }
.psc-h3 { font-size: 1.125rem; font-weight: 700; margin: 0 0 12px; }
.psc-mt { margin-top: 24px; }

.psc-badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; padding: 3px 8px; border-radius: 4px; background: var(--psc-accent); color: #fff; }
.psc-badge--free { background: var(--psc-success); }

.psc-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.psc-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid var(--psc-border); border-radius: 999px; background: var(--psc-surface); color: var(--psc-muted); font-size: .875rem; text-decoration: none; transition: border-color var(--psc-ease), color var(--psc-ease); }
a.psc-chip:hover, a.psc-chip:focus-visible { border-color: var(--psc-accent); color: var(--psc-text); }
.psc-chip.is-active { background: var(--psc-accent); border-color: var(--psc-accent); color: #fff; }
.psc-chips--filter { margin-bottom: 24px; }

.psc-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: background var(--psc-ease), border-color var(--psc-ease); }
.psc-btn--primary { background: var(--psc-accent); color: #fff; }
.psc-btn--primary:hover, .psc-btn--primary:focus-visible { background: var(--psc-accent-hover); color: #fff; }
.psc-btn--ghost { border-color: var(--psc-border); color: var(--psc-text); }
.psc-btn--ghost:hover { border-color: var(--psc-accent); }

.psc-checklist, .psc-steps { margin: 0; padding-left: 0; list-style: none; }
.psc-checklist li { position: relative; padding-left: 26px; margin-bottom: 8px; color: var(--psc-muted); }
.psc-checklist li::before { content: ""; position: absolute; left: 0; top: .45em; width: 14px; height: 8px; border-left: 2px solid var(--psc-success); border-bottom: 2px solid var(--psc-success); transform: rotate(-45deg); }
.psc-steps { counter-reset: step; }
.psc-steps li { position: relative; padding-left: 36px; margin-bottom: 10px; color: var(--psc-muted); counter-increment: step; }
.psc-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--psc-accent); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.psc-steps strong { color: var(--psc-text); }

.psc-faq details { border-top: 1px solid var(--psc-border); padding: 12px 0; }
.psc-faq details:first-of-type { border-top: 0; }
.psc-faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 32px; }
.psc-faq summary::-webkit-details-marker { display: none; }
.psc-faq summary::after { content: "+"; color: var(--psc-accent); font-size: 1.25rem; }
.psc-faq details[open] summary::after { content: "–"; }
.psc-faq p { margin: 8px 0 0; color: var(--psc-muted); }

:where(a, button, summary, input, select, textarea):focus-visible { outline: 2px solid var(--psc-accent); outline-offset: 2px; }

/* ---------- Trending feed ---------- */
.psc-trending { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; }
.psc-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.psc-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.psc-card__body { padding: 14px; }
.psc-card__meta { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.psc-cat { font-size: 12px; color: var(--psc-muted); }
.psc-card__title { font-weight: 600; margin-bottom: 6px; }
.psc-card__date { font-size: 12px; color: var(--psc-dim); }

/* ---------- Explore / shop ---------- */
.wc-block-product-template .wc-block-product, .products .product { border: 1px solid var(--psc-border); border-radius: var(--psc-radius); background: var(--psc-surface); padding: 12px; transition: border-color var(--psc-ease); }
.wc-block-product-template .wc-block-product:hover, .products .product:hover { border-color: var(--psc-accent); }
.wc-block-product-template img, .products .product img { border-radius: 8px; }
.psc-explore-filters { padding: 0 0 16px; }

/* ---------- Product page ---------- */
.psc-product-extras { margin: 40px 0; }
.psc-product-extras__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 24px; }
.psc-sticky-buy { display: none; }
@media (max-width: 782px) {
  .psc-sticky-buy { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(19, 18, 25, .96); border-top: 1px solid var(--psc-border); backdrop-filter: blur(8px); }
  .psc-sticky-buy__info { display: flex; flex-direction: column; min-width: 0; }
  .psc-sticky-buy__title { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .psc-sticky-buy__price { color: var(--psc-muted); font-size: .85rem; }
  body.single-product { padding-bottom: 84px; }
}

/* ---------- Marketplace pages (Creators / Requests / Affiliates snippets) ---------- */
.ps-creator-card, .ps-request-card, .ps-step { background: var(--psc-surface); border: 1px solid var(--psc-border); border-radius: var(--psc-radius); color: var(--psc-text); }
.ps-creator-card *, .ps-request-card * { color: inherit; }

/* ---------- Layout helpers ---------- */
.psc-section { padding: 48px 0; }
.psc-eyebrow { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--psc-accent); font-weight: 600; }
.psc-trust { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: center; color: var(--psc-muted); font-size: .9rem; }
.psc-trust li { list-style: none; display: flex; align-items: center; gap: 8px; }
.psc-trust li::before { content: "•"; color: var(--psc-accent); }

/* Global tap-target + mobile hygiene */
@media (max-width: 782px) {
  .wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; }
  .wp-block-button__link, .wc-block-components-button, .single_add_to_cart_button { min-height: 44px; }
  html, body { overflow-x: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .psc-card, .psc-chip, .psc-btn { transition: none; }
  a.psc-card:hover { transform: none; }
}

/* ---------- Footer ---------- */
.psc-footer-links { list-style: none; padding-left: 0; margin: 0; }
.psc-footer-links li { margin-bottom: 8px; }
.psc-footer-links a { text-decoration: none; opacity: .85; }
.psc-footer-links a:hover { opacity: 1; text-decoration: underline; }

/* ---------- Login gate panels (WPCode "Gate Prompt Details" snippet, inline-styled light) ---------- */
.ps-locked-panel { background: var(--psc-surface) !important; border-color: var(--psc-border) !important; color: var(--psc-text) !important; border-radius: var(--psc-radius) !important; }
.ps-locked-panel p { color: var(--psc-muted); }
.ps-locked-panel p:first-child { color: var(--psc-text); }
.ps-locked-panel a { background: var(--psc-accent) !important; color: #fff !important; border-radius: 999px !important; min-height: 44px; display: inline-flex !important; align-items: center; }

/* ==========================================================================
   Creator marketplace
   ========================================================================== */

/* Creator login */
.psc-login-card { max-width: 440px; margin: 0 auto; padding: 32px; border: 1px solid var(--psc-border); border-radius: var(--psc-radius-lg); background: var(--psc-surface); }
.psc-login-card label { display: block; margin-bottom: 6px; font-weight: 600; }
.psc-login-card input[type=text], .psc-login-card input[type=password] { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--psc-border); border-radius: 8px; background: var(--psc-bg); color: var(--psc-text); }
.psc-login-card p { margin: 0 0 16px; }
.psc-login-card .login-submit input { width: 100%; min-height: 46px; border: 0; border-radius: 999px; background: var(--psc-accent); color: #fff; font-weight: 600; cursor: pointer; }
.psc-login-card .login-submit input:hover { background: var(--psc-accent-hover); }
.psc-login-social { margin-top: 12px; }
.psc-login-links { display: flex; gap: 10px; justify-content: center; font-size: .9rem; color: var(--psc-muted); margin-top: 8px !important; }
.psc-notice, .psc-error { padding: 14px 18px; border-radius: 10px; background: var(--psc-surface); border: 1px solid var(--psc-border); }
.psc-error { border-color: #b3423a; color: #ffb4ad; }

/* Dashboard additions */
.psc-dashboard__article { padding: 0 0 24px; }
.psc-dashboard__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.psc-help { color: var(--psc-muted); font-size: .95rem; margin: 0 0 20px; }
.psc-empty { padding: 40px 24px; text-align: center; border: 1px dashed var(--psc-border); border-radius: var(--psc-radius); }
.psc-table { width: 100%; }
.psc-table__actions a { font-weight: 600; }
.psc-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--psc-surface-2); color: var(--psc-muted); }
.psc-status.is-published { background: rgba(47, 191, 113, .18); color: #7fe0a9; }
.psc-status.is-pending { background: rgba(107, 70, 245, .2); color: #c4b5ff; }
.psc-guide-form__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.psc-guide-form__thumb img { border-radius: 8px; margin-bottom: 8px; }

/* Sample work editor */
.psc-samples__list { display: grid; gap: 12px; }
.psc-sample { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--psc-border); border-radius: var(--psc-radius); background: var(--psc-surface); }
.psc-sample.is-empty { display: none; }
.psc-sample__media { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.psc-sample__media img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; }
.psc-sample__fields { display: grid; gap: 8px; }
.psc-sample__remove { justify-self: start; background: none; border: 0; color: #ffb4ad; cursor: pointer; padding: 0; font-size: .85rem; }
.psc-samples__add { margin-top: 12px; }

/* Creator profile page */
.psc-creator-store-main { padding-top: 24px; padding-bottom: 48px; }
.psc-creator-store .dokan-store-sidebar, .psc-creator-store .dokan-single-store { color: var(--psc-text); }
.psc-creator-store .profile-frame, .psc-creator-store .dokan-store-sidebar .widget, .psc-creator-store .dokan-store-sidebar .dokan-store-widget { background: var(--psc-surface); border: 1px solid var(--psc-border); border-radius: var(--psc-radius-lg); color: var(--psc-text); }
.psc-creator-store .profile-frame .profile-img, .psc-creator-store .profile-info-box { background: transparent !important; }
.psc-creator-store .dokan-store-sidebar .widget-title, .psc-creator-store .dokan-store-sidebar h3 { color: var(--psc-text); }
.psc-creator-store .dokan-store-sidebar input, .psc-creator-store .dokan-store-sidebar textarea { background: var(--psc-bg); color: var(--psc-text); border-color: var(--psc-border); }
.psc-creator-store .dokan-store-tabs, .psc-creator-store .dokan-store-tabs ul li a { background: transparent; color: var(--psc-muted); border-color: var(--psc-border); }
.psc-profile-section { margin: 28px 0; }
.psc-samples-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
@media (max-width: 782px) {
  .psc-creator-store { display: block; }
  .psc-creator-store .dokan-store-sidebar, .psc-creator-store .dokan-single-store { width: 100%; float: none; }
  .psc-sample { grid-template-columns: 1fr; }
}

/* Earnings */
.psc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 20px; }
.psc-stat { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 1px solid var(--psc-border); border-radius: var(--psc-radius); background: var(--psc-surface); }
.psc-stat__label { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--psc-muted); }
.psc-stat__value { font-size: 1.6rem; font-weight: 700; color: var(--psc-text); }
.psc-stat__hint { font-size: .8rem; color: var(--psc-dim); }

/* Dashboard tables on the dark theme (Dokan's dark snippet leaves cells unstyled) */
.psc-dashboard .psc-table th, .psc-dashboard .psc-table td { color: var(--psc-text) !important; background: transparent !important; border-color: var(--psc-border) !important; }
.psc-dashboard .psc-table thead th, .psc-dashboard .psc-table tfoot th { color: var(--psc-muted) !important; font-weight: 600; }
.psc-dashboard .psc-table a { color: #c4b5ff; }
.psc-dashboard h1.entry-title, .psc-dashboard .psc-h3 { color: var(--psc-text); }
.psc-dashboard .dokan-alert-success { background: rgba(47, 191, 113, .15); border-color: rgba(47, 191, 113, .4); color: #b7f0cf; }

/* Creator profile: kill Dokan's light banner/card */
.psc-creator-store .profile-frame { background: var(--psc-surface) !important; }
.psc-creator-store .profile-frame .profile-img.profile-img-circle img, .psc-creator-store .profile-frame .profile-img img { border: 3px solid var(--psc-border); }
.psc-creator-store .dokan-store-sidebar .dokan-store-widget, .psc-creator-store .dokan-store-sidebar .widget { padding: 16px; }
.psc-creator-store .dokan-store-sidebar h3, .psc-creator-store .dokan-store-sidebar .widget-title { font-size: 1rem; }
.psc-creator-store .dokan-store-tabs { border: 1px solid var(--psc-border); border-radius: var(--psc-radius); }
.psc-creator-store .dokan-store-tabs ul li a { color: var(--psc-muted); }

/* Creator profile header card: hide Dokan's default light banner, dark the card */
.psc-creator-store .profile-info-box { background: linear-gradient(135deg, #1c1b24 0%, #221c3d 60%, #2a1f5e 100%) !important; border-radius: var(--psc-radius-lg); overflow: hidden; }
.psc-creator-store .profile-info-box img.profile-info-img[src*="default-store-banner"] { display: none; }
.psc-creator-store .profile-info-box .profile-info-summery-wrapper { background: transparent !important; }
.psc-creator-store .profile-info-box .profile-info-summery { background: rgba(19, 18, 25, .55) !important; border-radius: var(--psc-radius); }
.psc-creator-store .profile-info-box .store-name, .psc-creator-store .profile-info-box .dokan-store-info li { color: var(--psc-text) !important; }
.psc-creator-store .dokan-store-tabs { background: var(--psc-surface); }
.psc-creator-store .dokan-store-tabs ul li a { background: transparent !important; color: var(--psc-text) !important; border: 0 !important; }
.psc-creator-store .dokan-store-tabs ul.dokan-modules-button:empty { display: none; }
.psc-creator-store .seller-items ul.products li.product { background: var(--psc-surface); border: 1px solid var(--psc-border); border-radius: var(--psc-radius); padding: 12px; }
.psc-creator-store .woocommerce-ordering select { background: var(--psc-surface); color: var(--psc-text); border-color: var(--psc-border); }
#dokan-content .dokan-store-tabs, .psc-creator-store #dokan-content .dokan-store-tabs ul { background: var(--psc-surface) !important; border-color: var(--psc-border) !important; box-shadow: none !important; }
#dokan-content .dokan-store-tabs ul li a { color: var(--psc-text) !important; background: transparent !important; }

/* Prompt brief (product description, visible once signed in) */
.psc-brief { width: 100%; border-collapse: collapse; margin: 12px 0 20px; }
.psc-brief th { text-align: left; width: 140px; padding: 8px 10px; color: var(--psc-accent); font-weight: 600; vertical-align: top; border-bottom: 1px solid var(--psc-border); }
.psc-brief td { padding: 8px 10px; border-bottom: 1px solid var(--psc-border); color: var(--psc-text); }
.psc-prompt { white-space: pre-wrap; background: var(--psc-surface); border: 1px solid var(--psc-border); border-radius: var(--psc-radius); padding: 16px; font-size: .9rem; line-height: 1.5; color: var(--psc-text); }
.psc-price-free { color: var(--psc-success); font-weight: 700; }
.wc-block-grid__product-price .psc-price-free, .price .psc-price-free { font-size: inherit; }

/* Sponsored badge */
.psc-badge--sponsored { background: #dba617; color: #1d2327; position: relative; z-index: 2; }
.wc-block-components-product-image .psc-badge--sponsored, .products .product .psc-badge--sponsored { position: absolute; top: 10px; left: 10px; }
.products .product, .wc-block-product { position: relative; }
.psc-card.is-sponsored { border-color: rgba(219, 166, 23, .6); }

/* ==========================================================================
   Search
   ========================================================================== */
.psc-search-form { display: flex; align-items: center; gap: 6px; }
.psc-search-form input[type=search] { min-height: 40px; padding: 8px 14px; border: 1px solid var(--psc-border); border-radius: 999px; background: var(--psc-surface); color: var(--psc-text); font-size: .95rem; }
.psc-search-form input::placeholder { color: var(--psc-dim); }
.psc-search-form--header { margin-right: 4px; }
.psc-search-form--header input { width: 210px; transition: width var(--psc-ease); }
.psc-search-form--header input:focus { width: 280px; outline: 2px solid var(--psc-accent); }
.psc-search-form--header button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--psc-border); border-radius: 999px; background: var(--psc-surface); color: var(--psc-text); cursor: pointer; }
.psc-search-form--header button:hover { border-color: var(--psc-accent); }
.psc-search-form--large { max-width: 720px; margin: 0 auto 28px; }
.psc-search-form--large input { flex: 1; min-height: 48px; font-size: 1.05rem; }
.psc-search-title { text-align: center; font-size: 1.6rem; margin: 0 0 20px; }
.psc-search-section { margin: 32px 0; }
.psc-creator-hit { display: flex; gap: 12px; align-items: center; }
.psc-creator-hit img { border-radius: 50%; width: 56px; height: 56px; }
.psc-search-page .psc-chips--filter { justify-content: center; }
.psc-creator-search { max-width: 560px; margin: 0 auto 24px; text-align: center; }
.psc-creator-search__input { width: 100%; min-height: 46px; padding: 10px 16px; border: 1px solid var(--psc-border); border-radius: 999px; background: var(--psc-surface); color: var(--psc-text); font-size: 1rem; }
.psc-creator-search__input:focus { outline: 2px solid var(--psc-accent); }
.psc-creator-search__count { display: block; margin-top: 8px; font-size: .85rem; color: var(--psc-dim); }
.psc-creator-search__none { color: var(--psc-muted); margin-top: 12px; }

/* Header layout: search sits between nav and icons; on phones it collapses to the icon and opens the search page */
@media (max-width: 1024px) {
  .psc-search-form--header input { width: 150px; }
}
@media (max-width: 782px) {
  .psc-search-form--header input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .psc-search-form--header { margin-right: 0; }
}

/* ==========================================================================
   Mobile fixes (home tiles, trust strip, Explore filters, product grid)
   ========================================================================== */
@media (max-width: 782px) {
  .psc-trust { flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 4px; margin: 0; }
  .psc-trust li { padding: 0; }
  .hero-item.is-not-stacked-on-mobile { flex-wrap: wrap !important; }
  .hero-item.is-not-stacked-on-mobile > .wp-block-column:first-child { flex-basis: 100% !important; }
  .hero-item.is-not-stacked-on-mobile > .wp-block-column:last-child { display: none; }
  .hero-item .wp-block-group { padding: 18px 20px !important; }
  .hero-item .wp-block-button__link { padding-left: 20px !important; padding-right: 20px !important; white-space: nowrap; }
  .hostinger-ai-hero-for-online-store-1 .wp-block-cover { aspect-ratio: auto !important; width: 100% !important; max-width: 100%; min-height: 520px !important; }
  .hostinger-ai-hero-for-online-store-1 .wp-block-cover__inner-container { width: 100%; max-width: 100%; }
  .ps-gallery-filters { padding: 0 16px; }
  .ps-gallery-filters input[type=text] { max-width: 100% !important; box-sizing: border-box; }
  .woocommerce-shop main.has-global-padding > .alignwide, .tax-product_cat main.has-global-padding > .alignwide, .tax-product_tag main.has-global-padding > .alignwide, .post-type-archive-product main.has-global-padding > .alignwide { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
  .wc-block-product-template.wc-block-product-template { grid-template-columns: 1fr !important; }
  .wc-block-product-template .wc-block-product { padding: 14px; }
  .wp-block-woocommerce-catalog-sorting select { max-width: 100%; }
  .wp-block-post-title, .wp-block-query-title { font-size: 2rem !important; }
  .psc-h3 { font-size: 1.05rem; }
  .psc-section { padding: 32px 0; }
}
@media (max-width: 480px) {
  .psc-trending { grid-template-columns: 1fr; }
  .psc-samples-grid { grid-template-columns: 1fr 1fr; }
}
