/* WP Update Server — Public Pages */

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

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #16a34a;
    --bg: #f0f2f5;
    --card: #fff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ── */
.public-navbar {
    background: #1e1b4b;
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    justify-content: space-between;
}

.public-navbar .brand {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    text-decoration: none;
}

.public-navbar nav { display: flex; gap: 8px; }

.public-navbar nav a {
    color: rgba(255,255,255,0.75);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.public-navbar nav a:hover,
.public-navbar nav a.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
}

/* ── Container ── */
.public-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Page Hero ── */
.page-hero {
    text-align: center;
    padding: 40px 0 32px;
}

.page-hero h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-hero p {
    color: var(--text-muted);
    font-size: 16px;
}

/* ── Plugin Card Grid ── */
.plugin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.plugin-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 24px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.plugin-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    text-decoration: none;
}

.plugin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.plugin-card-header h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.plugin-card-desc {
    color: var(--text-muted);
    font-size: 13px;
    flex: 1;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plugin-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ── Plugin Detail Page ── */
.plugin-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.plugin-detail-header h1 {
    font-size: 26px;
    font-weight: 700;
}

.plugin-author {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.plugin-detail-badges {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* ── Card ── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ── Requirements Grid ── */
.requirements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.requirement-item {
    text-align: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 6px;
}

.requirement-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.requirement-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* ── Version List ── */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.version-item {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.version-item.version-latest {
    border-color: var(--primary);
    border-width: 2px;
}

.version-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.version-changelog {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.version-changelog ul { margin-left: 20px; }
.version-changelog li { margin-bottom: 4px; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-active   { background: #dcfce7; color: #166534; }
.badge-version  { background: #e0e7ff; color: #3730a3; }
.badge-free     { background: #dcfce7; color: #166534; }
.badge-licensed { background: #fef3c7; color: #92400e; }

/* ── Download Card ── */
.download-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

/* ── Utilities ── */
.text-muted { color: var(--text-muted); }

.back-link {
    display: inline-block;
    margin-top: 24px;
    font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .plugin-grid {
        grid-template-columns: 1fr;
    }

    .plugin-detail-header {
        flex-direction: column;
    }

    .requirements-grid {
        grid-template-columns: 1fr 1fr;
    }
}
