/* Parallax Plugin Store — Terminal-inspired dark theme */

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border: #30363d;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-green-hover: #2ea043;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
    --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --radius: 8px;
    --transition: 0.2s ease;
}

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

html { font-size: 16px; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Scanline overlay ─────────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(88,166,255,0.08) 0%, transparent 60%);
}

.hero h1 {
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.hero h1 .accent { color: var(--accent-blue); }

.hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ── Search bar ───────────────────────────────────────────────── */
.search-container {
    max-width: 640px;
    margin: 32px auto 0;
    position: relative;
}

.search-prompt {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    color: var(--accent-blue);
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.8;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

/* ── Category pills ───────────────────────────────────────────── */
.categories {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 24px auto;
    max-width: 800px;
    flex-wrap: wrap;
    padding: 0 20px;
}

.cat-pill {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
}

.cat-pill:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.cat-pill.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-primary);
}

/* ── Stats bar ────────────────────────────────────────────────── */
.stats-bar {
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-bottom: 24px;
}

.stats-bar span { color: var(--text-secondary); }

/* ── Plugin grid ──────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* ── Plugin card ──────────────────────────────────────────────── */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color var(--transition), transform var(--transition);
    animation: fadeIn 0.3s ease forwards;
    opacity: 0;
}

.card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.card-meta {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.card-version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-stats {
    display: flex;
    gap: 12px;
}

.stat {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-value { color: var(--text-secondary); }

.card-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ── Install button ───────────────────────────────────────────── */
.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: var(--accent-green);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
}

.btn-install:hover {
    background: var(--accent-green-hover);
}

.btn-install::before {
    content: '⬇';
    font-size: 0.9rem;
}

/* ── Plugin detail modal ──────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 560px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal h2 {
    font-family: var(--font-mono);
    margin-bottom: 8px;
    font-size: 1.4rem;
}

.modal .detail-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.modal .detail-desc {
    color: var(--text-secondary);
    margin: 16px 0;
    line-height: 1.7;
}

.modal .detail-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-size: 0.85rem;
    margin: 16px 0;
}

.modal .detail-label {
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.modal .detail-value {
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.modal .detail-actions {
    margin-top: 24px;
    text-align: center;
}

/* ── Empty state ──────────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty p { font-size: 0.9rem; }

/* ── Loading ──────────────────────────────────────────────────── */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    border-top: 1px solid var(--border);
}

footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

footer a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.6rem; }
    .grid { grid-template-columns: 1fr; }
    .modal { padding: 20px; }
}
