/* ===== PromptKart — Light Theme (matches reference design) ===== */
:root {
    --bg: #f7f8fa;
    --white: #ffffff;
    --text: #101114;
    --text-muted: #6b7280;
    --border: #eef0f3;
    --border-strong: #e2e4e9;
    --black: #0a0a0a;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16,17,20,0.04), 0 1px 8px rgba(16,17,20,0.04);
    --pro-bg: #7c3aed;
    --pro-text: #ffffff;
    --free-bg: #ffffff;
    --free-text: #101114;

    /* Backward-compatible aliases (older markup still references these) */
    --dark: #ffffff;
    --gray-800: #eef0f3;
    --gray-600: #6b7280;
    --gray-400: #6b7280;
    --gray-200: #374151;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    z-index: 100;
}
.navbar .logo {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}
.navbar .logo span { color: var(--text); font-weight: 800; }
.nav-links {
    display: flex;
    gap: 26px;
    align-items: center;
}
.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    transition: color .15s;
}
.nav-links a:hover { color: var(--black); }

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--black);
    background: var(--black);
    color: var(--white);
    transition: all .15s;
}
.btn:hover { opacity: 0.85; }
.btn-outline {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover { border-color: var(--black); }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-block { width: 100%; text-align: center; }

/* ---- Hero ---- */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
    padding: 50px 0 20px;
}
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; } }
.hero h1 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.15;
    margin-bottom: 14px;
}
.hero p { color: var(--text-muted); font-size: 15px; margin-bottom: 22px; max-width: 480px; }
.hero-stats {
    display: flex;
    gap: 34px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.hero-stats .stat-num { font-size: 20px; font-weight: 800; }
.hero-stats .stat-label { font-size: 12px; color: var(--text-muted); }
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: -20px;
}
.hero-visual img {
    height: 260px;
    width: auto;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    margin-left: -30px;
    border: 3px solid var(--white);
}
.hero-visual img:first-child { margin-left: 0; }

/* ---- Search / filter bar ---- */
.search-bar {
    display: flex;
    gap: 10px;
    padding: 24px 0 18px;
    flex-wrap: wrap;
}
.search-bar input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 14px 18px;
    border-radius: 30px;
    border: 1px solid var(--border-strong);
    background: var(--white);
    color: var(--text);
    font-size: 14px;
    box-shadow: var(--shadow);
}
.chip-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 26px;
}
.chip {
    padding: 9px 18px;
    border-radius: 30px;
    background: var(--white);
    border: 1px solid var(--border-strong);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: #374151;
    cursor: pointer;
}
.chip.active { background: var(--black); color: var(--white); border-color: var(--black); }
.chip:hover:not(.active) { border-color: var(--black); }

/* ---- Gallery grid ---- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 10px 0 60px;
}
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: transform .15s, box-shadow .15s;
    box-shadow: var(--shadow);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(16,17,20,0.10); }
.card .media-wrap {
    position: relative;
    aspect-ratio: 4/5;
    overflow: hidden;
    background: #000;
}
.card .media-wrap img, .card .media-wrap video { width: 100%; height: 100%; object-fit: cover; }
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--free-bg);
    color: var(--free-text);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.badge.paid { background: var(--pro-bg); color: var(--pro-text); }
.badge.video { top: 10px; right: 44px; left: auto; background: rgba(0,0,0,0.6); color: #fff; }
.heart-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}
.lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,10,10,0.55);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--white);
    font-size: 13px;
    z-index: 1;
}
.lock-overlay .lock-icon { font-size: 26px; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.card-body .cat-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--text-muted);
    background: #f3f4f6;
    padding: 2px 9px;
    border-radius: 10px;
    margin-bottom: 8px;
}
.card-body .meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.card-body .meta span { display: flex; align-items: center; gap: 4px; }

/* ---- Section headers ---- */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 30px 0 16px;
}
.section-head h2 { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.section-head p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.section-head a { font-size: 13px; font-weight: 600; color: var(--text); }

/* ---- Prompt detail page ---- */
.detail-wrap {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    padding: 40px 0 60px;
}
@media (max-width: 800px) { .detail-wrap { grid-template-columns: 1fr; } }
.detail-media {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow);
}
.prompt-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-top: 16px;
    position: relative;
    box-shadow: var(--shadow);
}
.prompt-box p { font-size: 14px; color: #374151; white-space: pre-wrap; }
.prompt-box.blurred p { filter: blur(6px); user-select: none; }
.copy-btn {
    position: absolute;
    top: 14px;
    right: 14px;
}

/* ---- Forms (login/register/admin) ---- */
.form-card {
    max-width: 400px;
    margin: 60px auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}
.form-card h2 { margin-bottom: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--text-muted); font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: var(--white);
    color: var(--text);
    font-size: 14px;
}
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ---- Admin layout ---- */
.admin-wrap { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
    width: 232px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
}
.admin-sidebar .logo { padding: 0 8px 20px; font-weight: 800; font-size: 17px; display:flex; align-items:center; gap:8px; }
.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    border-radius: 10px;
    margin-bottom: 2px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: #f3f4f6; color: var(--text); }
.admin-main { flex: 1; padding: 26px 30px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.stat-card .icon-circle {
    width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; margin-bottom: 12px;
}
.stat-card .num { font-size: 24px; font-weight: 800; }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { padding: 13px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; background: #fafafb; }
tr:last-child td { border-bottom: none; }

.thumb-sm { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; }

footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    background: var(--white);
}
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 40px 0 24px;
    margin-top: 30px;
}
.site-footer .footer-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 20px; }
.site-footer .footer-links { display: flex; gap: 20px; font-size: 13px; color: var(--text-muted); }
.site-footer .footer-social { display: flex; gap: 14px; }
.site-footer .footer-social span { width: 32px; height: 32px; border-radius: 50%; background: #f3f4f6; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.site-footer .footer-bottom { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

.icon-circle.blue { background: #dbeafe; color: #2563eb; }
.icon-circle.green { background: #dcfce7; color: #16a34a; }
.icon-circle.orange { background: #ffedd5; color: #ea580c; }
.icon-circle.purple { background: #ede9fe; color: #7c3aed; }
.icon-circle.pink { background: #fce7f3; color: #db2777; }

.trend-up { color: #16a34a; font-weight: 600; }
.trend-down { color: #dc2626; font-weight: 600; }
