/* ========================================
   FORUM PAGE - Against Stones
   Design moderne, élégant et minimaliste
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --forum-bg: #2a2a2a;
    --forum-card-bg: var(--as-card-bg, linear-gradient(145deg, #333333 0%, #262626 100%));
    --forum-border: rgba(255, 255, 255, 0.06);
    --forum-border-hover: rgba(255, 215, 0, 0.3);
    --gold-primary: #FFD700;
    --gold-secondary: #D4AF37;
    --gold-muted: #B8941F;
    --text-primary: #FFFFFF;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-subtle: #64748B;
}

/* ========================================
   FORUM INTRO — headline via quote pastille only
   ======================================== */
.forum-intro {
    max-width: min(720px, 92%);
    margin: clamp(20px, 3vw, 28px) auto var(--as-space-stack-sm, 16px);
    text-align: center;
}

.forum-intro__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.forum-intro .quote-box {
    margin-block: 0;
    max-width: 100%;
}

.forum-intro .quote-box__text {
    font-size: clamp(1.05rem, 2.2vw, 1.35rem);
    font-weight: 600;
}

.forum-intro .quote-box__footnote {
    margin-top: 0.65rem;
    font-size: 0.82rem;
    color: var(--text-muted, #94A3B8);
}

/* ========================================
   SEARCH BAR - Ultra moderne
   ======================================== */
.forum-search-container {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto var(--as-space-stack-md, 28px) auto;
}

.forum-search-wrapper {
    flex: 1;
    position: relative;
}

#forum-search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.forum-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.forum-search-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

#forum-search {
    width: 100%;
    height: 52px;
    padding: 0 140px 0 56px;
    background: var(--as-surface-2, #1a1f28);
    border: 1px solid var(--as-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 10px);
    color: var(--as-text, var(--text-primary));
    font-size: 15px;
    font-weight: 400;
    font-family: 'Montserrat', system-ui, sans-serif;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: var(--shadow-soft, 0 2px 12px rgba(0, 0, 0, 0.18));
}

#forum-search::placeholder {
    color: var(--as-text-muted, var(--text-subtle));
    font-weight: 400;
}

#forum-search:focus {
    outline: none;
    border-color: var(--as-gold-muted, #c9a227);
    background: var(--as-surface-2, #1a1f28);
    box-shadow: 0 0 0 3px var(--as-gold-glow, rgba(255, 215, 0, 0.12));
    transform: none;
}

#forum-search:focus + .search-btn {
    background: linear-gradient(135deg, var(--as-gold, #FFD700) 0%, var(--as-gold-dark, #D4AF37) 100%);
    color: #000;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

#forum-search:focus ~ .forum-search-icon {
    color: var(--as-gold-muted, #c9a227);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    height: 44px;
    width: 120px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--forum-border);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    color: #000;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.search-btn:hover svg {
    transform: translateX(3px);
}

/* NEW THREAD BUTTON - Élégant */
.btn-new-thread {
    height: 60px;
    padding: 0 32px;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    border: none;
    border-radius: 16px;
    color: #000;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-new-thread::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
                transparent 0%,
                rgba(255, 255, 255, 0.3) 50%,
                transparent 100%);
    transition: left 0.6s ease;
}

.btn-new-thread:hover::before {
    left: 100%;
}

.btn-new-thread:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-new-thread:active {
    transform: translateY(-1px);
}

.btn-new-thread svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ========================================
   FORUM COUNTER - Minimaliste
   ======================================== */
.forum-counter {
    text-align: center;
    margin-bottom: 48px;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.forum-counter strong {
    color: var(--gold-primary);
    font-weight: 600;
    font-size: 16px;
    margin-right: 4px;
}

/* ========================================
   THREADS GRID - Layout moderne
   ======================================== */
.forum-threads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
    margin-bottom: 100px;
}

/* ========================================
   THREAD CARD - Design sophistiqué
   ======================================== */
.forum-thread-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.forum-thread-card {
    background: var(--forum-card-bg);
    border: 1.5px solid var(--forum-border);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Shimmer effect au hover */
.forum-thread-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
                transparent 0%,
                rgba(255, 215, 0, 0.05) 50%,
                transparent 100%);
    transition: left 0.8s ease;
    z-index: 1;
    pointer-events: none;
}

.forum-thread-link:hover .forum-thread-card::before {
    left: 100%;
}

/* Glow effect au hover */
.forum-thread-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1.5px;
    background: linear-gradient(135deg,
                var(--gold-primary) 0%,
                var(--gold-muted) 50%,
                var(--gold-secondary) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                   linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.forum-thread-link:hover .forum-thread-card {
    transform: translateY(-8px) scale(1.01);
    border-color: var(--forum-border-hover);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(255, 215, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.forum-thread-link:hover .forum-thread-card::after {
    opacity: 0.4;
}

.thread-cover-image {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.thread-cover-image img,
.thread-cover-image .thread-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* CATEGORY BADGE - Design pill moderne */
.thread-category-header {
    padding: 24px 28px 0 28px;
    position: relative;
    z-index: 2;
}

.thread-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: linear-gradient(135deg,
                rgba(255, 215, 0, 0.1) 0%,
                rgba(212, 175, 55, 0.06) 100%);
    border: 1px solid rgba(255, 215, 0, 0.22);
    border-radius: 999px;
    color: var(--gold-primary);
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forum-thread-link:hover .thread-category-badge {
    background: linear-gradient(135deg,
                rgba(255, 215, 0, 0.16) 0%,
                rgba(212, 175, 55, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.38);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.12);
}

/* THREAD CONTENT - Hiérarchie typographique */
.thread-content {
    padding: 24px 28px;
    flex: 1;
    position: relative;
    z-index: 2;
}

.thread-title {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 14px 0;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forum-thread-link:hover .thread-title {
    color: var(--gold-primary);
    letter-spacing: -0.01em;
}

.thread-excerpt {
    font-size: 14.5px;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
    font-family: 'Inter', sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.forum-thread-link:hover .thread-excerpt {
    color: var(--text-secondary);
}

/* THREAD FOOTER - Info compacte */
.thread-footer {
    padding: 0 28px 24px;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-subtle);
    font-family: 'Inter', sans-serif;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 20px;
    position: relative;
    z-index: 2;
}

.thread-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

.thread-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-subtle);
}

.forum-thread-link:hover .thread-stat-item {
    color: var(--text-secondary);
}

.thread-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thread-author-name {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
}

.forum-thread-link:hover .thread-author-name {
    color: var(--gold-primary);
}

/* ========================================
   EMPTY STATE - Élégant
   ======================================== */
.forum-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 120px 40px;
    color: var(--text-subtle);
    font-size: 16px;
    font-weight: 300;
    font-family: 'Inter', sans-serif;
}

.forum-empty::before {
    content: '💬';
    display: block;
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.2;
    filter: grayscale(100%);
}

/* ========================================
   PAGINATION - Minimaliste
   ======================================== */
.forum-pagination {
    margin: 100px 0 60px;
    text-align: center;
}

.forum-pagination-wrapper {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--forum-border);
}

.forum-pagination-link {
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.forum-pagination-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--forum-border);
}

.forum-pagination-link.active {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-secondary) 100%);
    color: #000;
    font-weight: 600;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.forum-pagination-link.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ========================================
   RESPONSIVE - TABLET
   ======================================== */
@media (max-width: 1024px) {
    .content {
        padding: 60px 32px;
    }

    .forum-threads-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 28px;
    }

    .forum-search-container {
        max-width: 100%;
    }
}

/* ========================================
   RESPONSIVE - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .content {
        padding: 40px 20px;
    }

    .forum-search-container {
        flex-direction: column;
        gap: 16px;
        margin-bottom: 48px;
    }

    .forum-search-wrapper {
        width: 100%;
    }

    #forum-search {
        height: 56px;
        padding: 0 120px 0 56px;
        font-size: 15px;
    }

    .forum-search-icon {
        left: 20px;
    }

    .forum-search-icon svg {
        width: 18px;
        height: 18px;
    }

    .search-btn {
        width: 100px;
    }

    .btn-new-thread {
        width: 87%;
        height: 56px;
        justify-content: center;
        font-size: 14px;
    }

    .forum-counter {
        font-size: 13px;
        margin-bottom: 40px;
    }

    .forum-counter strong {
        font-size: 15px;
    }

    .forum-threads-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 80px;
    }

    .forum-thread-card {
        border-radius: 16px;
    }

    .thread-category-header {
        padding: 20px 24px 0 24px;
    }

    .thread-content {
        padding: 20px 24px;
    }

    .thread-title {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .thread-excerpt {
        font-size: 14px;
        line-height: 1.6;
    }

    .thread-footer {
        padding: 0 24px 20px;
        padding-top: 18px;
        flex-wrap: wrap;
        gap: 12px;
        font-size: 12px;
    }

    .thread-stats {
        gap: 16px;
    }

    .forum-pagination {
        margin: 80px 0 40px;
    }

    .forum-pagination-wrapper {
        gap: 8px;
        padding: 6px;
    }

    .forum-pagination-link {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* ========================================
   RESPONSIVE - PETIT MOBILE
   ======================================== */
@media (max-width: 480px) {
    .content {
        padding: 32px 16px;
    }

    #forum-search {
        height: 52px;
        padding: 0 110px 0 52px;
        font-size: 14px;
        border-radius: 14px;
    }

    .forum-search-icon {
        left: 18px;
    }

    .search-btn {
        width: 90px;
        height: 40px;
        font-size: 13px;
    }

    .btn-new-thread {
        height: 52px;
        padding: 0 24px;
        font-size: 14px;
        border-radius: 14px;
    }

    .thread-category-badge {
        font-size: 10px;
        padding: 5px 14px;
    }

    .thread-title {
        font-size: 16px;
    }

    .thread-excerpt {
        font-size: 13px;
    }

    .forum-pagination-link {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* ========================================
   ACCESSIBILITY & STATES
   ======================================== */
.forum-thread-link:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 4px;
    border-radius: 20px;
}

.btn-new-thread:focus-visible,
#forum-search:focus-visible,
.search-btn:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

.forum-pagination-link:focus-visible {
    outline: 2px solid var(--gold-primary);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .forum-thread-card {
        border-width: 2px;
    }

    .thread-category-badge {
        background: var(--gold-primary);
        color: #0a0a0c;
    }

    .thread-excerpt {
        color: var(--text-secondary);
    }
}

/* Dark mode enhancement (déjà dark par défaut) */
@media (prefers-color-scheme: dark) {
    .forum-thread-card {
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6),
                    inset 0 1px 0 rgba(255, 255, 255, 0.04);
    }
}

/* ====================== CATÉGORIES & FIL D’ARIANE ====================== */
.forum-categories-box {
    background: var(--as-surface, #141820);
    border: 1px solid var(--as-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-sm, 10px);
    padding: 18px 20px;
    margin: 0 auto var(--as-space-stack-md, 28px) auto;
    max-width: 900px;
    box-shadow: var(--shadow-soft, 0 2px 12px rgba(0, 0, 0, 0.18));
}

.forum-categories-box h4 {
    color: var(--as-text-muted, #8e8e96);
    margin: 0 0 12px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: 'Montserrat', sans-serif;
}

.categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.forum-categories-box a.category-btn,
a.category-btn {
    display: inline-flex;
    align-items: center;
    background: var(--as-surface-2, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--as-border-subtle, rgba(255, 255, 255, 0.08));
    padding: 8px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.forum-categories-box a.category-btn:link,
.forum-categories-box a.category-btn:visited,
a.category-btn:link,
a.category-btn:visited {
    color: rgba(255, 255, 255, 0.65);
}

.forum-categories-box a.category-btn:hover,
a.category-btn:hover {
    background: rgba(212, 168, 83, 0.12);
    border-color: var(--as-gold-muted, #d4a853);
    color: var(--as-gold-muted, #d4a853);
    text-decoration: none;
    transform: translateY(-1px);
}

.forum-categories-box a.category-btn.active,
.forum-categories-box a.category-btn.active:link,
.forum-categories-box a.category-btn.active:visited,
a.category-btn.active,
a.category-btn.active:link,
a.category-btn.active:visited {
    background: rgba(212, 168, 83, 0.18);
    border-color: var(--as-gold-muted, #d4a853);
    color: var(--as-gold-muted, #d4a853);
    font-weight: 600;
    text-decoration: none;
}

.forum-categories-box a.category-btn:focus-visible,
a.category-btn:focus-visible {
    outline: 2px solid var(--as-gold, #ffd700);
    outline-offset: 2px;
}

.forum-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    max-width: 900px;
    margin: 0 auto 20px auto;
    font-size: 0.875rem;
    line-height: 1.4;
}

.forum-breadcrumb__sep {
    color: rgba(255, 255, 255, 0.35);
    user-select: none;
    font-weight: 300;
}

.forum-breadcrumb__link:link,
.forum-breadcrumb__link:visited {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}

.forum-breadcrumb__link:hover {
    color: var(--as-gold-muted, #d4a853);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(212, 168, 83, 0.55);
}

.forum-breadcrumb__link--current:link,
.forum-breadcrumb__link--current:visited,
.forum-breadcrumb__current {
    color: var(--as-gold-muted, #d4a853);
    font-weight: 600;
    text-decoration: none;
}

.forum-breadcrumb__link:focus-visible {
    outline: 2px solid var(--as-gold, #ffd700);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (max-width: 1024px) {
    .forum-categories-box,
    .forum-breadcrumb {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .forum-categories-box {
        margin-bottom: 32px;
        padding: 18px 20px;
    }
}

@media (max-width: 640px) {
    .forum-categories-box {
        padding: 16px 18px;
    }

    .forum-categories-box a.category-btn,
    a.category-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}
