/* =================================================================
   FORUM PUBLIC - STYLES CSS
   Styles pour le forum public en lecture seule (SEO)

   @author EcoWeb CenC
   @version 1.0
   @date 2025-10-29
   ================================================================= */

/* =================================================================
   VARIABLES GLOBALES
   ================================================================= */

:root {
    --forum-primary: var(--cenc-orange);
    --forum-secondary: var(--cenc-brown);
    --forum-accent: var(--cenc-green);
    --forum-locked: var(--cenc-gray);
    --forum-premium: var(--cenc-gold);
    --forum-bg-light: var(--cenc-gray-light);
    --forum-border: var(--border-color);
    --forum-text: var(--cenc-gray-dark);
    --forum-text-muted: var(--cenc-gray);
}

/* =================================================================
   BADGES ET INDICATEURS
   ================================================================= */

.forum-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}

.forum-badge.badge-inscrit {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.forum-badge.badge-adherent {
    background: rgba(243, 156, 18, 0.1);
    color: var(--cenc-gold-dark);
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.forum-badge.badge-public {
    background: rgba(39, 174, 96, 0.1);
    color: var(--cenc-green-dark);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

/* Badges de comptage */
.topic-count-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.count-badge.count-public {
    background: rgba(39, 174, 96, 0.1);
    color: var(--cenc-green-dark);
}

.count-badge.count-members {
    background: rgba(243, 156, 18, 0.1);
    color: var(--cenc-gold-dark);
}

/* =================================================================
   CARTES DE RESTRICTION
   ================================================================= */

.forum-restriction-card {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--cenc-hemp-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-large);
    margin: 2rem 0;
    align-items: center;
    box-shadow: var(--shadow-light);
}

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

.restriction-content {
    flex: 1;
}

.restriction-content h4 {
    margin: 0 0 0.5rem 0;
    color: var(--forum-secondary);
    font-size: 1.25rem;
    font-weight: 700;
}

.restriction-content p {
    margin: 0 0 1rem 0;
    color: var(--cenc-gray);
    line-height: 1.6;
}

/* =================================================================
   APERÇUS DE CONTENU RÉSERVÉ
   ================================================================= */

.forum-locked-content-wrapper {
    margin: 2rem 0;
}

.forum-content-preview {
    position: relative;
    max-height: 300px;
    overflow: hidden;
    background: white;
    border: 1px solid var(--forum-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.preview-text {
    color: var(--forum-text-muted);
    line-height: 1.8;
}

.preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
}

.forum-content-locked {
    position: relative;
    opacity: 0.6;
    user-select: none;
    pointer-events: none;
}

.locked-content-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--forum-bg-light);
    border-left: 3px solid var(--forum-premium);
    margin: 1rem 0;
    border-radius: 0.25rem;
}

.stat-item {
    color: var(--forum-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.locked-content-cta {
    margin-top: 1.5rem;
}

/* =================================================================
   APPELS À L'ACTION (CTA)
   ================================================================= */

.forum-cta {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: var(--border-radius-large);
    margin: 2rem 0;
    align-items: center;
    box-shadow: var(--shadow-light);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.forum-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.forum-cta-inscription {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-color);
}

.forum-cta-adhesion {
    background: var(--cenc-hemp-light);
    border: 1px solid var(--border-color);
}

.forum-cta-adhesion-large {
    flex-direction: column;
    text-align: center;
}

.forum-cta-icon {
    font-size: 3rem;
    line-height: 1;
    flex-shrink: 0;
}

.forum-cta-content {
    flex: 1;
}

.forum-cta-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--forum-secondary);
    font-weight: 700;
}

.forum-cta-content p {
    margin: 0 0 1rem 0;
    color: var(--cenc-gray);
    line-height: 1.6;
}

.cta-advantages {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.cta-advantages li {
    padding: 0.5rem 0;
    color: var(--forum-text);
    font-weight: 500;
}

/* CTA Compact */
.forum-cta-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.forum-cta-inscription-compact {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-color);
}

.cta-text {
    font-weight: 600;
    color: var(--forum-text);
}

/* Boutons */
.btn-premium {
    background: var(--cenc-orange);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all var(--transition-fast);
    cursor: pointer;
    box-shadow: var(--shadow-light);
}

.btn-premium:hover {
    background: var(--cenc-orange-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--forum-primary);
    color: var(--forum-primary);
}

.btn-outline:hover {
    background: var(--forum-primary);
    color: white;
    box-shadow: var(--shadow-light);
}

/* =================================================================
   BANNIÈRE STICKY
   ================================================================= */

.forum-sticky-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--forum-primary);
    color: white;
    padding: 1rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.forum-sticky-banner .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-icon {
    font-size: 1.5rem;
}

.banner-text {
    font-weight: 600;
    font-size: 1.1rem;
    flex: 1;
}

.btn-white {
    background: white;
    color: var(--forum-primary);
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-white:hover {
    background: #f5f5f5;
    color: var(--forum-primary);
}

.banner-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    transition: opacity 0.2s ease;
}

.banner-close:hover {
    opacity: 0.8;
}

/* =================================================================
   CATÉGORIES RÉSERVÉES
   ================================================================= */

.category-card-locked {
    opacity: 0.85;
    position: relative;
    background: var(--cenc-gray-light);
    cursor: not-allowed;
}

.category-card-locked::before {
    content: '🔒';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    opacity: 0.3;
}

.category-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.category-card-locked:hover .category-locked-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    padding: 2rem;
}

.overlay-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.overlay-text strong {
    display: block;
    font-size: 1.25rem;
    color: var(--forum-secondary);
    margin-bottom: 0.25rem;
}

.overlay-text p {
    color: var(--forum-text-muted);
    margin: 0.5rem 0 1rem 0;
}

/* =================================================================
   SIDEBAR
   ================================================================= */

.forum-sidebar-card {
    background: white;
    border: 1px solid var(--forum-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-light);
}

.forum-sidebar-card h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: var(--forum-text);
    font-weight: 700;
}

.forum-why-register {
    border-left: 3px solid var(--info);
}

.forum-member-benefits {
    border-left: 3px solid var(--forum-premium);
}

.why-list,
.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.why-list li,
.benefits-list li {
    padding: 0.5rem 0;
    color: var(--forum-text);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* =================================================================
   INFO BOX
   ================================================================= */

.forum-info-box {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--info);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 2rem 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    position: relative;
}

.info-box-content {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex: 1;
}

.info-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.info-text {
    flex: 1;
}

.info-text strong {
    display: block;
    color: var(--forum-secondary);
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.info-text p {
    margin: 0;
    color: var(--forum-text-muted);
    line-height: 1.6;
}

.info-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.info-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.info-actions .btn-primary {
    background: linear-gradient(135deg, var(--cenc-orange, #E67E22), var(--cenc-orange-light, #F39C12));
    color: white;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.2);
}

.info-actions .btn-primary:hover {
    background: linear-gradient(135deg, var(--cenc-orange-dark, #D35400), var(--cenc-orange, #E67E22));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.info-actions .btn-outline {
    background: transparent;
    border: 2px solid var(--cenc-brown, #8B4513);
    color: var(--cenc-brown, #8B4513);
    box-shadow: none;
}

.info-actions .btn-outline:hover {
    background: var(--cenc-brown, #8B4513);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.2);
}

.info-actions .btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
}

.info-close {
    background: transparent;
    border: none;
    color: var(--info);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
}

.info-close:hover {
    opacity: 0.7;
}

/* =================================================================
   BREADCRUMB
   ================================================================= */

.breadcrumb-container {
    background: white;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
}

.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    padding: 0 0.5rem;
    color: var(--forum-text-muted);
}

.breadcrumb-item a {
    color: var(--forum-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--forum-secondary);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--forum-text-muted);
}

/* =================================================================
   BARRE DE RECHERCHE
   ================================================================= */

.forum-search-bar {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.forum-search-bar form {
    display: flex;
    gap: 0.75rem;
}

.forum-search-bar input[type="text"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.forum-search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--forum-primary);
}

/* =================================================================
   DISCUSSIONS ET TOPICS
   ================================================================= */

.topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-item {
    background: white;
    border: 1px solid var(--forum-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.topic-item:hover {
    box-shadow: var(--shadow-light);
    transform: translateY(-2px);
}

.topic-item-locked {
    opacity: 0.8;
    background: var(--cenc-gray-light);
}

.topic-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.topic-title {
    flex: 1;
}

.topic-title a {
    color: var(--forum-text);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.topic-title a:hover {
    color: var(--forum-primary);
}

.topic-meta {
    display: flex;
    gap: 1rem;
    color: var(--forum-text-muted);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.topic-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* =================================================================
   PAGINATION
   ================================================================= */

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--forum-border);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--forum-text);
    background: white;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--forum-bg-light);
    color: var(--forum-primary);
}

.pagination .active {
    background: var(--forum-primary);
    color: white;
    border-color: var(--forum-primary);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 768px) {
    .forum-cta,
    .forum-restriction-card {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .forum-sticky-banner .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .banner-text {
        font-size: 1rem;
        text-align: center;
    }

    .info-box-content {
        flex-direction: column;
    }

    .info-actions {
        width: 100%;
        flex-direction: column;
    }

    .info-actions .btn {
        width: 100%;
    }

    .topic-meta {
        font-size: 0.8rem;
    }

    .forum-search-bar form {
        flex-direction: column;
    }

    .forum-search-bar button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .forum-cta-icon {
        font-size: 2rem;
    }

    .forum-cta-content h3 {
        font-size: 1.25rem;
    }

    .restriction-icon {
        font-size: 2rem;
    }

    .banner-icon {
        display: none;
    }
}

/* =================================================================
   PRINT
   ================================================================= */

@media print {
    .forum-sticky-banner,
    .forum-cta,
    .forum-restriction-card,
    .forum-info-box,
    .banner-close,
    .info-close {
        display: none !important;
    }

    .forum-content-preview::after {
        display: none;
    }
}

/* =================================================================
   DARK MODE (si implémenté)
   ================================================================= */

@media (prefers-color-scheme: dark) {
    /* Variables pour le mode sombre - à implémenter si nécessaire */
}
