/**
 * Prompt Templates Library — Poiiky Studio
 * Dark glass theme, responsive grid, category filters
 */

/* ── z-index fix for dep-content overlay ── */
.app > .dep-content { position: relative; z-index: 1; }

/* ── Header ── */
.pt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 32px 0 20px;
    flex-wrap: wrap;
}
.pt-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pt-header-left .i {
    color: #d4ff4a;
    flex-shrink: 0;
}
.pt-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}
.pt-subtitle {
    font-size: .82rem;
    color: rgba(255,255,255,.5);
    margin: 2px 0 0;
}
.pt-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Search ── */
.pt-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 240px;
    transition: border-color .2s, background .2s;
}
.pt-search:focus-within {
    border-color: #d4ff4a44;
    background: rgba(255,255,255,.08);
}
.pt-search svg {
    color: rgba(255,255,255,.35);
    flex-shrink: 0;
}
.pt-search input {
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font: inherit;
    font-size: .88rem;
    width: 100%;
}
.pt-search input::placeholder {
    color: rgba(255,255,255,.3);
}

/* ── Filters ── */
.pt-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
}
.pt-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Category pills */
.pt-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.1);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.65);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.pt-pill:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.pt-pill.on {
    background: #d4ff4a;
    color: #0a0a0a;
    border-color: #d4ff4a;
    font-weight: 600;
}

/* Type filter buttons */
.pt-type-btn {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.55);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}
.pt-type-btn:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}
.pt-type-btn.on {
    background: rgba(212,255,74,.12);
    color: #d4ff4a;
    border-color: rgba(212,255,74,.3);
}

/* ── Grid ── */
.pt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-bottom: 32px;
}
@media (max-width: 1100px) {
    .pt-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .pt-grid { grid-template-columns: 1fr; }
    .pt-header { flex-direction: column; align-items: flex-start; }
    .pt-search { min-width: 100%; }
}

/* ── Card ── */
.pt-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    cursor: default;
}
.pt-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212,255,74,.2);
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
}

/* Thumbnail */
.pt-card__thumb {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: rgba(255,255,255,.03);
    position: relative;
}
.pt-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.pt-card:hover .pt-card__thumb img {
    transform: scale(1.05);
}

/* Card body (text below thumbnail) */
.pt-card__body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Category badge */
.pt-card__category {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    width: fit-content;
}
/* Category colors */
.pt-card__category[data-cat="advertising"] { background: rgba(255,149,0,.15); color: #ff9500; }
.pt-card__category[data-cat="tiktok"]      { background: rgba(255,0,80,.15);  color: #ff0050; }
.pt-card__category[data-cat="short_film"]  { background: rgba(100,149,237,.15); color: #6495ed; }
.pt-card__category[data-cat="product"]     { background: rgba(50,205,50,.15);  color: #32cd32; }
.pt-card__category[data-cat="nature"]      { background: rgba(0,206,209,.15);  color: #00ced1; }
.pt-card__category[data-cat="portrait"]    { background: rgba(186,85,211,.15); color: #ba55d3; }
.pt-card__category[data-cat="abstract"]    { background: rgba(255,215,0,.15);  color: #ffd700; }
.pt-card__category[data-cat="music"]       { background: rgba(255,105,180,.15); color: #ff69b4; }
.pt-card__category[data-cat="sfx"]         { background: rgba(0,191,255,.15);  color: #00bfff; }
.pt-card__category[data-cat="cinematic"]   { background: rgba(147,112,219,.15); color: #9370db; }
.pt-card__category[data-cat="animation"]   { background: rgba(255,165,0,.15);   color: #ffa500; }
.pt-card__category[data-cat="facebook"]    { background: rgba(66,103,178,.15);  color: #4267b2; }
.pt-card__category[data-cat="ban_hang"]    { background: rgba(255,99,71,.15);   color: #ff6347; }
.pt-card__category[data-cat="thiet_ke"]    { background: rgba(0,206,209,.15);   color: #00ced1; }

/* Featured star */
.pt-card__featured {
    color: #ffd700;
    font-size: .7rem;
    margin-left: 6px;
}

/* Title */
.pt-card__title {
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

/* Prompt text */
.pt-card__prompt {
    font-size: .78rem;
    color: rgba(255,255,255,.45);
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta row */
.pt-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .75rem;
    color: rgba(255,255,255,.4);
}
.pt-card__meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pt-card__meta-item svg {
    width: 14px;
    height: 14px;
}
/* Model badge in meta */
.pt-card__model {
    padding: 2px 8px;
    background: rgba(255,255,255,.06);
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 500;
    color: rgba(255,255,255,.5);
    text-transform: lowercase;
}

/* Type badge */
.pt-card__type {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
}
.pt-card__type[data-type="video"] { background: rgba(99,102,241,.15); color: #818cf8; }
.pt-card__type[data-type="image"] { background: rgba(52,211,153,.15); color: #34d399; }
.pt-card__type[data-type="audio"] { background: rgba(251,146,60,.15); color: #fb923c; }

/* Actions */
.pt-card__actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.pt-card__btn {
    flex: 1;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.pt-card__btn--use {
    background: #d4ff4a;
    color: #0a0a0a;
}
.pt-card__btn--use:hover {
    background: #e0ff78;
    transform: scale(1.02);
}
.pt-card__btn--copy {
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.1);
}
.pt-card__btn--copy:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

/* ── Loading skeleton ── */
.pt-skel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.pt-skel {
    height: 380px;
    border-radius: 14px;
    background: linear-gradient(110deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 70%);
    background-size: 200% 100%;
    animation: ptShimmer 1.5s infinite;
}
@keyframes ptShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (max-width: 1100px) { .pt-skel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .pt-skel-grid { grid-template-columns: 1fr; } }

/* ── Empty state ── */
.pt-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,.3);
}
.pt-empty svg {
    margin-bottom: 16px;
    opacity: .4;
}
.pt-empty p {
    font-size: .9rem;
}

/* ── Pagination ── */
.pt-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 20px 0 40px;
}
.pt-page-btn {
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.6);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pt-page-btn:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.pt-page-btn.on {
    background: #d4ff4a;
    color: #0a0a0a;
    border-color: #d4ff4a;
    font-weight: 700;
}
.pt-page-btn:disabled {
    opacity: .3;
    cursor: default;
}

/* ── Toast ── */
.pt-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(20,20,20,.95);
    border: 1px solid rgba(212,255,74,.3);
    color: #d4ff4a;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: .84rem;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: transform .3s, opacity .3s;
    z-index: 9999;
    backdrop-filter: blur(12px);
}
.pt-toast.on {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
