/* Lexique Categories Navigation */
.lexique-filters {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 70px;
    align-items: center;
    width: 100%;
}

.lexique-filters-panel {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    justify-content: center;
    width: min(100%, 1420px);
    padding: 22px 24px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.14);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.category-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    overflow: visible;
    padding: 0;
    width: auto;
    flex: 1 1 auto;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.category-buttons::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome, Safari and Opera */
}

.category-btn {
    padding: 10px 18px;
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.category-btn:hover {
    background: rgba(138, 43, 226, 0.1);
    color: white;
    transform: translateY(-2px);
    border-color: #8b5cf6;
}

.category-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border-color: #8b5cf6;
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.4);
}

/* Lexique Search Tab */
.lexique-search-tab {
    display: flex;
    align-items: center;
    padding: 2px 18px;
    border: 1px solid rgba(138, 43, 226, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    width: min(100%, 250px);
    flex-shrink: 0;
    align-self: auto;
}

.lexique-search-tab:focus-within {
    border-color: #8b5cf6;
    background: rgba(138, 43, 226, 0.1);
}

.search-tab-icon {
    margin-right: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

#lexiqueSearch {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.95rem;
    padding: 8px 0;
    width: 100%;
    outline: none;
}

.btn-search-trigger {
    display: none;
}

/* Lexique Category */
.lexique-category {
    margin-bottom: 80px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.lexique-category.hidden {
    display: none;
}

.category-title {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    margin-bottom: 40px !important;
    margin-top: 60px !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.18em !important;
    width: 100% !important;
    justify-content: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.category-title span {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 24px !important;
    min-height: 54px !important;
    white-space: nowrap !important;
    border-radius: 999px !important;
    border: 1px solid rgba(139, 92, 246, 0.18) !important;
    background: linear-gradient(135deg, rgba(27, 21, 46, 0.96), rgba(19, 16, 33, 0.96)) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22) !important;
}

.category-title span::before {
    content: '' !important;
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 4px !important;
    height: 22px !important;
    background: linear-gradient(to bottom, #8b5cf6, #d946ef) !important;
    border-radius: 2px !important;
}

.category-title span {
    padding-left: 30px !important;
}

.category-title::after {
    content: '' !important;
    height: 1px !important;
    width: 160px !important;
    flex: 0 0 160px !important;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.3), transparent) !important;
}

.category-title::before {
    content: '' !important;
    height: 1px !important;
    width: 160px !important;
    flex: 0 0 160px !important;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3)) !important;
}

/* Terms Grid Layout */
.terms-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 60px !important;
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-items: start !important;
    /* Fix: cards don't stretch anymore */
}

/* Premium Card Styles - Redesigned */
.premium-info-bar {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 32px !important;
    padding: 30px !important;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0 !important;
    width: 100%;
    -webkit-backdrop-filter: blur(15px) !important;
    backdrop-filter: blur(15px) !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-sizing: border-box !important;
    /* Allow grid to manage sizing */
    position: relative;
    overflow: hidden;
}

.premium-info-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.premium-info-bar:hover::before {
    opacity: 1;
}

.premium-info-bar.search-match {
    border-color: #8b5cf6 !important;
    box-shadow: 0 0 35px rgba(138, 43, 226, 0.4) !important;
    background: rgba(138, 43, 226, 0.05) !important;
}

.premium-info-bar:hover {
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 20px rgba(124, 58, 237, 0.1) !important;
    transform: translateY(-8px) !important;
}

.info-bar-main {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 20px !important;
}

.info-bar-left {
    display: flex !important;
    flex-direction: column !important;
    /* Stack icon and title */
    align-items: flex-start !important;
    gap: 15px !important;
    width: 100% !important;
}

.info-bar-icon-box {
    width: 64px !important;
    height: 64px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.8rem !important;
    /* Bigger for emojis */
    flex-shrink: 0 !important;
    transition: all 0.4s ease !important;
    position: relative;
    overflow: hidden;
}

.premium-info-bar:hover .info-bar-icon-box {
    transform: scale(1.1) rotate(5deg);
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.info-bar-content h3 {
    font-family: 'Outfit', sans-serif !important;
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: white !important;
    letter-spacing: -0.02em !important;
}

.btn-premium-action {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    padding: 12px 24px !important;
    border-radius: 16px !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    cursor: pointer !important;
    text-decoration: none !important;
    width: 100% !important;
    margin-top: auto;
}

.btn-premium-action:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%) !important;
    color: white !important;
    border-color: #8b5cf6 !important;
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.4) !important;
    transform: translateY(-2px);
}

.info-bar-reveal {
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.premium-info-bar.active .info-bar-reveal {
    max-height: 1000px !important;
    opacity: 1 !important;
    margin-top: 25px !important;
    padding-top: 25px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.term-definition {
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.7 !important;
    font-size: 0.95rem !important;
    margin-bottom: 20px !important;
}

.term-example {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    color: white;
    border-left: 2px solid var(--color-primary);
}

/* Scroll to top button */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
    z-index: 1000;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Accent indications via colors & Glows */
.term-card.gradient-green .info-bar-icon-box {
    border-color: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1) !important;
}

.term-card.gradient-green:hover .info-bar-icon-box {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3) !important;
}

.term-card.gradient-purple .info-bar-icon-box {
    border-color: rgba(139, 92, 246, 0.2) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.1) !important;
}

.term-card.gradient-purple:hover .info-bar-icon-box {
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3) !important;
}

.term-card.gradient-blue .info-bar-icon-box {
    border-color: rgba(59, 130, 246, 0.2) !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.1) !important;
}

.term-card.gradient-blue:hover .info-bar-icon-box {
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3) !important;
}

.term-card.gradient-orange .info-bar-icon-box {
    border-color: rgba(245, 158, 11, 0.2) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1) !important;
}

.term-card.gradient-orange:hover .info-bar-icon-box {
    border-color: rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3) !important;
}

/* Responsive Updates */
@media (max-width: 1200px) {
    .terms-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .lexique-filters {
        align-items: stretch;
    }

    .lexique-filters-panel {
        flex-direction: column;
        width: 100%;
        padding: 20px;
        border-radius: 22px;
    }

    .category-buttons {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .category-title::after {
        width: 72px !important;
        flex: 0 0 72px !important;
    }

    .category-title::before {
        width: 72px !important;
        flex: 0 0 72px !important;
    }

    .terms-grid {
        grid-template-columns: 1fr !important;
    }

    .info-bar-main {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
    }

    .info-bar-left {
        flex-direction: row !important;
    }

    .btn-premium-action {
        width: auto !important;
    }

    .lexique-search-tab #lexiqueSearch {
        width: 140px;
    }

    .lexique-search-tab {
        width: 100%;
        align-self: stretch;
    }
}
