/* ── Public Case Studies Page ──────────────────────────────────────────────── */

.appoven-public-cs {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.appoven-public-cs-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.appoven-public-cs-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
}

.appoven-public-cs-subtitle {
    color: #6b7280;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.appoven-public-cs-count {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.appoven-public-cs-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #6b7280;
}

/* ── Card Grid ────────────────────────────────────────────────────────────── */

.appoven-public-cs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.appoven-public-cs-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.appoven-public-cs-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Card image */
.appoven-public-cs-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.appoven-public-cs-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.appoven-public-cs-image.appoven-public-cs-no-img {
    background: linear-gradient(135deg, #1e293b, #334155);
}

.appoven-public-cs-image.appoven-public-cs-no-img::after {
    content: 'No preview available';
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Card body */
.appoven-public-cs-card-body {
    padding: 1.25rem;
}

.appoven-public-cs-card-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.appoven-public-cs-tag-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    background: #ede9fe;
    color: #5b21b6;
}

.appoven-public-cs-tag-tier {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
}

.appoven-public-cs-hook {
    color: #374151;
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    min-height: 2.8rem;
}

.appoven-public-cs-metrics-summary {
    margin-bottom: 1rem;
}

.appoven-public-cs-delta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.appoven-public-cs-delta-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #059669;
}

.appoven-public-cs-delta-label {
    font-size: 0.8rem;
    color: #6b7280;
}

.appoven-public-cs-expand {
    width: 100%;
    text-align: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 0.625rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.appoven-public-cs-expand:hover {
    background: #f97316;
    color: white;
    border-color: #f97316;
}

/* ── Overlay / Detail View ────────────────────────────────────────────────── */

.appoven-public-cs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.appoven-public-cs-overlay-inner {
    background: #fff;
    border-radius: 1rem;
    max-width: 900px;
    width: 100%;
    position: relative;
    margin: 2rem auto;
}

.appoven-public-cs-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f3f4f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    z-index: 10;
    transition: all 0.2s;
}

.appoven-public-cs-overlay-close:hover {
    background: #e5e7eb;
    color: #111827;
}

.appoven-public-cs-overlay-content {
    padding: 2rem;
}

.appoven-public-cs-detail-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.appoven-public-cs-delta-badge {
    font-size: 0.875rem;
    font-weight: 700;
    color: #059669;
    background: #d1fae5;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-left: auto;
}

.appoven-public-cs-detail-hook {
    font-size: 1.15rem;
    font-style: italic;
    color: #374151;
    border-left: 4px solid #f97316;
    padding: 0.75rem 1.25rem;
    margin: 0 0 2rem 0;
    background: #fffbeb;
    border-radius: 0 0.5rem 0.5rem 0;
    line-height: 1.6;
}

.appoven-public-cs-detail-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.appoven-public-cs-img-col {
    text-align: center;
}

.appoven-public-cs-img-col img {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.appoven-public-cs-detail-section {
    margin-bottom: 2rem;
}

.appoven-public-cs-detail-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

body.appoven-no-scroll {
    overflow: hidden;
}

/* ── Shared styles (used by both admin and public) ────────────────────────── */

.appoven-cs-img-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.appoven-cs-no-image {
    background: #f3f4f6;
    color: #9ca3af;
    padding: 2rem;
    text-align: center;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.appoven-cs-loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

.appoven-cs-no-data {
    color: #9ca3af;
    font-size: 0.875rem;
    font-style: italic;
}

/* ── What Changed grid ────────────────────────────────────────────────────── */

.appoven-cs-what-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.appoven-cs-what-grid > div {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.appoven-cs-what-grid strong {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.appoven-cs-what-grid p {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* ── Fitness Curve Chart ──────────────────────────────────────────────────── */

.appoven-cs-curve-chart {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.appoven-cs-curve-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.appoven-cs-curve-label {
    width: 55px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-align: right;
    flex-shrink: 0;
}

.appoven-cs-curve-bar-wrap {
    flex: 1;
    background: #f3f4f6;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
}

.appoven-cs-curve-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.appoven-cs-curve-score {
    width: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
    text-align: right;
    flex-shrink: 0;
}

/* ── Admin Detail Panel ───────────────────────────────────────────────────── */

.appoven-cs-detail-panel {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.appoven-cs-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.appoven-cs-detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #111827;
}

.appoven-cs-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.appoven-cs-img-col {
    text-align: center;
}

.appoven-cs-img-col img {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.appoven-cs-comparison-full img {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.appoven-cs-section {
    margin-bottom: 1.5rem;
}

.appoven-cs-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.appoven-cs-hook-block {
    border-left: 4px solid #f97316;
    padding: 0.75rem 1rem;
    margin: 0 0 0.75rem 0;
    background: #fffbeb;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: #374151;
    line-height: 1.5;
}

.appoven-cs-breakthrough-desc {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.appoven-cs-score-jump {
    font-size: 0.9rem;
    color: #374151;
}

.appoven-cs-score-jump strong {
    color: #059669;
}

.appoven-cs-narrative-text {
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.6;
}

.appoven-cs-narrative-text p {
    margin-bottom: 0.75rem;
}

.appoven-cs-lineage-path {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.appoven-cs-lineage-path code {
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.appoven-cs-review-panel {
    padding-top: 1rem;
    border-top: 2px solid #e5e7eb;
    margin-top: 1rem;
}

.appoven-cs-review-panel h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #111827;
}

.appoven-cs-review-done {
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f9fafb;
}

.appoven-cs-review-done.appoven-positive {
    border-left: 4px solid #059669;
}

.appoven-cs-review-done.appoven-negative {
    border-left: 4px solid #dc2626;
}

.appoven-cs-review-done p {
    margin: 0.5rem 0 0;
    color: #374151;
    font-size: 0.9rem;
}

.appoven-cs-review-done small {
    color: #9ca3af;
    font-size: 0.8rem;
}

/* ── Filters ──────────────────────────────────────────────────────────────── */

.appoven-cs-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.appoven-cs-filters label {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 600;
}

.appoven-cs-filters select {
    margin-left: 0.25rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    background: white;
}

/* ── Hook cell in table ───────────────────────────────────────────────────── */

.appoven-cs-hook-cell {
    max-width: 200px;
    font-size: 0.85rem;
    color: #6b7280;
    font-style: italic;
}

/* ── Tier colours (re-stated for both contexts) ───────────────────────────── */

.appoven-cs-tier-highlight { background: #d1fae5; color: #065f46; }
.appoven-cs-tier-solid     { background: #fef3c7; color: #92400e; }
.appoven-cs-tier-archived  { background: #f3f4f6; color: #6b7280; }

/* ── Approval status colours ──────────────────────────────────────────────── */

.appoven-status-approved { background: #d1fae5; color: #065f46; }
.appoven-status-rejected { background: #fee2e2; color: #991b1b; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .appoven-public-cs-grid {
        grid-template-columns: 1fr;
    }

    .appoven-cs-side-by-side,
    .appoven-public-cs-detail-images {
        grid-template-columns: 1fr;
    }

    .appoven-cs-what-grid {
        grid-template-columns: 1fr;
    }

    .appoven-public-cs-overlay {
        padding: 1rem;
    }

    .appoven-public-cs-overlay-inner {
        margin: 1rem auto;
    }

    .appoven-public-cs-overlay-content {
        padding: 1.25rem;
    }

    .appoven-cs-filters {
        flex-wrap: wrap;
    }
}
