/* ========================================
   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: #0A0A0A;
    --forum-card-bg: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 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;
    --ukraine-blue: #005BBB;
    --ukraine-blue-light: #0073E6;
    --text-primary: #FFFFFF;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    --text-subtle: #64748B;
}

/* ========================================
   CONTENT CONTAINER
   ======================================== */
.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px;
}

/* ========================================
   SEARCH BAR - Ultra moderne
   ======================================== */
.forum-search-container {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto 60px 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: 60px;
    padding: 0 140px 0 64px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.8) 0%, rgba(20, 20, 20, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1.5px solid var(--forum-border);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 400;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#forum-search::placeholder {
    color: var(--text-subtle);
    font-weight: 300;
}

#forum-search:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(20, 20, 20, 1) 100%);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.08),
                0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

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

#forum-search:focus ~ .forum-search-icon {
    color: var(--gold-primary);
}

.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(--ukraine-blue) 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;
}

/* 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(0, 91, 187, 0.15) 0%,
                rgba(0, 115, 230, 0.1) 100%);
    border: 1px solid rgba(0, 91, 187, 0.3);
    border-radius: 999px;
    color: var(--ukraine-blue-light);
    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(0, 91, 187, 0.25) 0%,
                rgba(0, 115, 230, 0.2) 100%);
    border-color: rgba(0, 115, 230, 0.5);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 91, 187, 0.2);
}

/* 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: 100%;
        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(--ukraine-blue);
        color: #fff;
    }

    .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);
    }
}

/* ====================== BOX CATÉGORIES FORUM ====================== */
.forum-categories-box {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px 0 32px 0;
}

.forum-categories-box h4 {
    color: #FACC15;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #CBD5E1;
    border: 1px solid rgba(255, 215, 0, 0.15);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(250, 204, 21, 0.15);
    color: #FACC15;
    border-color: #FACC15;
    transform: translateY(-1px);
}

.category-btn.active {
    background: #FACC15;
    color: #0A0A0A;
    font-weight: 700;
    border-color: #FACC15;
}

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

.category-btn {
    padding: 8px 16px;
    font-size: 13.5px;
    border-radius: 9999px;
}

/* ====================== BOX CATÉGORIES FORUM ====================== */
.forum-categories-box {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px auto 32px auto;     /* Centré */
    max-width: 900px;                /* Même largeur que la recherche */
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.forum-categories-box h4 {
    color: #FACC15;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #CBD5E1;
    border: 1px solid rgba(255, 215, 0, 0.15);
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(250, 204, 21, 0.15);
    color: #FACC15;
    border-color: #FACC15;
    transform: translateY(-1px);
}

.category-btn.active {
    background: #FACC15;
    color: #0A0A0A;
    font-weight: 700;
    border-color: #FACC15;
}

/* ========================================
   RESPONSIVE - Même comportement que la recherche
   ======================================== */
@media (max-width: 1024px) {
    .forum-categories-box {
        max-width: 100%;
        margin: 24px 0 32px 0;
        padding: 18px 20px;
    }
}

@media (max-width: 640px) {
    .forum-categories-box {
        padding: 16px 18px;
    }
    
    .category-btn {
        padding: 8px 14px;
        font-size: 13.5px;
    }
}
