/* ============================================
   Community Gallery & Detail Page Styles
   ============================================ */

/* Card hover effect */
.community-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #dee2e6;
}
.community-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.community-card .card-title a {
    text-decoration: none;
    color: inherit;
}
.community-card .card-title a:hover {
    color: #0d6efd;
}

/* Metrics grid inside gallery cards */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.metrics-grid .metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}
.metric-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}
.metric-value {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Detail page metric cards */
.metric-card-detail {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    padding: 1rem;
    text-align: center;
}
.metric-card-detail .metric-label {
    display: block;
    margin-bottom: 4px;
}
.metric-card-detail .metric-value {
    font-size: 1.4rem;
}

/* Vote button states */
.vote-btn {
    transition: all 0.2s ease;
}
.vote-btn.voted {
    color: #0d6efd;
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}
.vote-btn.voted i {
    color: #0d6efd;
}

/* Share results section on backtest page */
#share-results-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

/* Gallery page header */
.gallery-header {
    background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 12px 12px;
}

/* Filter bar */
.filter-bar {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

/* Pagination */
.pagination .page-link {
    border-radius: 6px;
    margin: 0 2px;
}

/* Commentary preview */
.commentary-preview {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

/* ============================================
   Top Performers Strip
   ============================================ */
.top-performers-strip {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 1rem;
}
.top-performer-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.top-performer-link:hover {
    background: rgba(13, 110, 253, 0.06);
    color: inherit;
}
.tp-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 2px;
}
.tp-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1b2838;
}

/* ============================================
   Inline CTA Banner
   ============================================ */
.inline-cta {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border: 1px solid #c2d5f7;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.inline-cta span {
    font-weight: 500;
    color: #1b2838;
}

/* ============================================
   SEO Content Section (How to Read Results)
   ============================================ */
.seo-content-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 2rem;
}
.seo-content-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1b2838;
    margin-bottom: 1.25rem;
}
.seo-content-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}
.seo-content-section h3:first-child {
    margin-top: 0;
}
.seo-content-section p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: #555;
}
.seo-content-section a {
    color: #0d6efd;
}

/* ============================================
   Detail Page: Summary Paragraph
   ============================================ */
.detail-summary {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #495057;
    border-left: 3px solid #0d6efd;
    padding-left: 1rem;
}

/* ============================================
   Detail Page: Try This Strategy CTA
   ============================================ */
.try-strategy-cta {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    border: 1px solid #c2d5f7;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
}
.try-strategy-cta h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1b2838;
    margin-bottom: 0.5rem;
}
.try-strategy-cta p {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* ============================================
   Related Backtests Section
   ============================================ */
.related-backtests h2 {
    color: #1b2838;
    margin-bottom: 0.75rem;
}
.related-card {
    border: 1px solid #e9ecef;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .metric-card-detail .metric-value {
        font-size: 1.1rem;
    }
    .gallery-header {
        padding: 2rem 0;
    }
    .top-performers-strip {
        padding: 0.75rem;
    }
    .tp-value {
        font-size: 0.8rem;
    }
    .inline-cta {
        flex-direction: column;
        text-align: center;
    }
    .inline-cta .btn {
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
    .seo-content-section {
        padding: 1.25rem;
    }
    .try-strategy-cta {
        padding: 1rem;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */
body.dark-mode .community-card {
    background: #1e1e2e;
    border-color: #333;
}
body.dark-mode .community-card .card-footer {
    background: #252535;
    border-color: #333;
}
body.dark-mode .metrics-grid .metric {
    border-bottom-color: #333;
}
body.dark-mode .metric-card-detail {
    background: #252535;
    border-color: #333;
}
body.dark-mode #share-results-section {
    background: #1e1e2e;
    border-color: #333;
}
body.dark-mode .filter-bar {
    background: #1e1e2e;
    border-color: #333;
}
body.dark-mode .community-card .card-title a {
    color: #e0e0e0;
}
body.dark-mode .community-card .card-title a:hover {
    color: #6ea8fe;
}
body.dark-mode .top-performers-strip {
    background: linear-gradient(135deg, #1e1e2e 0%, #252535 100%);
    border-color: #333;
}
body.dark-mode .tp-value {
    color: #e0e0e0;
}
body.dark-mode .inline-cta {
    background: linear-gradient(135deg, #1a1a2e 0%, #1e2a3a 100%);
    border-color: #333;
}
body.dark-mode .inline-cta span {
    color: #e0e0e0;
}
body.dark-mode .seo-content-section {
    background: #1e1e2e;
    border-color: #333;
}
body.dark-mode .seo-content-section h2,
body.dark-mode .seo-content-section h3 {
    color: #e0e0e0;
}
body.dark-mode .seo-content-section p {
    color: #b0b0b0;
}
body.dark-mode .detail-summary {
    color: #b0b0b0;
    border-left-color: #6ea8fe;
}
body.dark-mode .try-strategy-cta {
    background: linear-gradient(135deg, #1a1a2e 0%, #1e2a3a 100%);
    border-color: #333;
}
body.dark-mode .try-strategy-cta h3 {
    color: #e0e0e0;
}
body.dark-mode .related-card {
    background: #1e1e2e;
    border-color: #333;
}
