/**
 * NovaFiche Styles - Version 1.0
 * Style sobre, charte NovaFuture (vert)
 */

/* ============================================
   Variables & Reset
   ============================================ */
:root {
    --novafiche-green: #096E09;
    --novafiche-green-light: #0a8a0a;
    --novafiche-green-dark: #075207;
    --novafiche-green-bg: #e8f5e8;
    --novafiche-dark: #1a1a1a;
    --novafiche-gray-dark: #333;
    --novafiche-gray: #666;
    --novafiche-gray-light: #999;
    --novafiche-gray-lighter: #e5e5e5;
    --novafiche-bg: #f8f9fa;
    --novafiche-white: #ffffff;
    --novafiche-radius: 8px;
    --novafiche-radius-sm: 4px;
    --novafiche-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --novafiche-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --novafiche-transition: 0.2s ease;
}

.novafiche-container,
.novafiche-experts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.novafiche-container *,
.novafiche-container *::before,
.novafiche-container *::after,
.novafiche-experts-container *,
.novafiche-experts-container *::before,
.novafiche-experts-container *::after {
    box-sizing: border-box;
}

/* ============================================
   Header
   ============================================ */
.novafiche-header {
    text-align: center;
    padding: 30px 0 25px;
}

.novafiche-title {
    font-size: 3rem !important;
    font-weight: 700;
    margin: 0 !important;
    line-height: 1;
    color: var(--novafiche-dark);
}

.novafiche-green {
    color: var(--novafiche-green);
}

.novafiche-tagline {
    margin: 10px 0 0 !important;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--novafiche-gray);
}

/* ============================================
   Search - FORCE OVERRIDE
   ============================================ */
.novafiche-search-wrap {
    max-width: 600px;
    margin: 0 auto 35px;
}

.novafiche-search {
    position: relative;
}

.novafiche-container .novafiche-search-icon,
.novafiche-search .novafiche-search-icon,
i.novafiche-search-icon {
    position: absolute !important;
    right: 18px !important;
    left: auto !important;
    top: 50% !important;
    transform: translateY(-50%);
    color: var(--novafiche-gray-light);
    font-size: 1.1rem;
    pointer-events: none;
}

.novafiche-container .novafiche-search-input,
.novafiche-search .novafiche-search-input,
input.novafiche-search-input {
    width: 100%;
    padding: 16px 50px 16px 20px !important;
    font-size: 1rem;
    border: 2px solid var(--novafiche-gray-lighter);
    border-radius: var(--novafiche-radius);
    background: var(--novafiche-white);
    transition: border-color var(--novafiche-transition), box-shadow var(--novafiche-transition);
}

.novafiche-search-input:focus {
    outline: none;
    border-color: var(--novafiche-green);
    box-shadow: 0 0 0 3px rgba(9, 110, 9, 0.1);
}

.novafiche-search-input::placeholder {
    color: var(--novafiche-gray-light);
}

/* Autocomplete Results */
.novafiche-search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--novafiche-white);
    border: 1px solid var(--novafiche-gray-lighter);
    border-radius: var(--novafiche-radius);
    box-shadow: var(--novafiche-shadow-hover);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.novafiche-search-results.active {
    display: block;
}

.novafiche-search-result-item {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--novafiche-dark);
    border-bottom: 1px solid var(--novafiche-gray-lighter);
    transition: background var(--novafiche-transition);
}

.novafiche-search-result-item:last-child {
    border-bottom: none;
}

.novafiche-search-result-item:hover,
.novafiche-search-result-item.active {
    background: var(--novafiche-green-bg);
    color: var(--novafiche-green);
}

.novafiche-search-no-results {
    padding: 15px 18px;
    color: var(--novafiche-gray);
    text-align: center;
}

/* ============================================
   Categories Grid - 5 colonnes, 10 items (5+5)
   FORCE OVERRIDE
   ============================================ */
.novafiche-container .novafiche-categories,
nav.novafiche-categories {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    margin-bottom: 50px !important;
    max-width: none !important;
}

.novafiche-container .novafiche-category,
nav.novafiche-categories .novafiche-category,
a.novafiche-category {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none;
    padding: 30px 15px !important;
    border-radius: var(--novafiche-radius);
    background: var(--novafiche-white);
    border: 2px solid var(--novafiche-gray-lighter);
    transition: all var(--novafiche-transition);
}

.novafiche-category:hover {
    border-color: var(--novafiche-green);
    box-shadow: var(--novafiche-shadow-hover);
}

.novafiche-container .novafiche-category-icon,
.novafiche-category .novafiche-category-icon,
div.novafiche-category-icon {
    width: 90px !important;
    height: 90px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--novafiche-green-bg);
    border-radius: 50% !important;
    margin-bottom: 15px !important;
    transition: all var(--novafiche-transition);
}

.novafiche-category-icon i {
    font-size: 2.5rem !important;
    color: var(--novafiche-green);
}

.novafiche-category:hover .novafiche-category-icon {
    background: var(--novafiche-green);
}

.novafiche-category:hover .novafiche-category-icon i {
    color: var(--novafiche-white);
}

/* Card Need Help - style spécial */
.novafiche-category-help,
a.novafiche-category.novafiche-category-help {
    border-color: var(--novafiche-green) !important;
    background: var(--novafiche-white) !important;
}

.novafiche-category-icon-help,
div.novafiche-category-icon.novafiche-category-icon-help {
    background: var(--novafiche-white) !important;
    border: 2px solid var(--novafiche-green) !important;
}

.novafiche-category-icon-help img {
    width: 55px !important;
    height: 55px !important;
    object-fit: contain;
}

.novafiche-category-help:hover {
    background: var(--novafiche-white) !important;
    box-shadow: var(--novafiche-shadow-hover);
}

.novafiche-category-help:hover .novafiche-category-icon-help {
    background: var(--novafiche-white) !important;
}

.novafiche-category-help:hover .novafiche-category-name {
    color: var(--novafiche-green) !important;
}

.novafiche-container .novafiche-category-name,
.novafiche-category .novafiche-category-name,
span.novafiche-category-name {
    font-size: 1rem !important;
    font-weight: 600;
    color: var(--novafiche-gray-dark);
    text-align: center;
    line-height: 1.3;
}

.novafiche-category:hover .novafiche-category-name {
    color: var(--novafiche-green);
}

/* ============================================
   Sections
   ============================================ */
.novafiche-section {
    margin-bottom: 50px;
}

.novafiche-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.novafiche-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0;
}

/* ============================================
   Grid
   ============================================ */
.novafiche-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* ============================================
   Cards
   ============================================ */
.novafiche-card {
    background: var(--novafiche-white);
    border-radius: var(--novafiche-radius);
    overflow: hidden;
    box-shadow: var(--novafiche-shadow);
    transition: box-shadow var(--novafiche-transition), transform var(--novafiche-transition);
}

.novafiche-card:hover {
    box-shadow: var(--novafiche-shadow-hover);
    transform: translateY(-3px);
}

.novafiche-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.novafiche-card-image {
    position: relative;
    width: 100%;
    padding-top: 60%;
    overflow: hidden;
    background: var(--novafiche-bg);
}

.novafiche-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.novafiche-card:hover .novafiche-card-image img {
    transform: scale(1.05);
}

.novafiche-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--novafiche-green) 0%, var(--novafiche-green-dark) 100%);
}

.novafiche-card-image-placeholder span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
    color: var(--novafiche-white);
    opacity: 0.8;
}

.novafiche-card-content {
    padding: 18px;
}

.novafiche-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--novafiche-dark);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.novafiche-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
}

.novafiche-card-cat {
    color: var(--novafiche-green);
    font-weight: 500;
    cursor: pointer;
    transition: color var(--novafiche-transition);
}

.novafiche-card-cat:hover {
    color: var(--novafiche-green-light);
    text-decoration: underline;
}

.novafiche-card-comments {
    color: var(--novafiche-gray-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ============================================
   Buttons
   ============================================ */
.novafiche-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--novafiche-radius);
    border: none;
    cursor: pointer;
    transition: all var(--novafiche-transition);
    white-space: nowrap;
}

.novafiche-btn-primary {
    background: var(--novafiche-green);
    color: var(--novafiche-white);
}

.novafiche-btn-primary:hover {
    background: var(--novafiche-green-light);
    color: var(--novafiche-white);
}

.novafiche-btn-secondary {
    background: var(--novafiche-white);
    color: var(--novafiche-green);
    border: 2px solid var(--novafiche-green);
}

.novafiche-btn-secondary:hover {
    background: var(--novafiche-green);
    color: var(--novafiche-white);
}

.novafiche-btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.novafiche-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Load More */
.novafiche-load-more-wrap {
    text-align: center;
    margin-top: 30px;
}

/* ============================================
   Support Teaser (bottom of main page)
   ============================================ */
.novafiche-support-teaser {
    background: var(--novafiche-green-bg);
    border-radius: var(--novafiche-radius);
    padding: 40px;
    text-align: center;
    margin-top: 60px;
}

.novafiche-support-teaser-content {
    max-width: 600px;
    margin: 0 auto;
}

.novafiche-support-teaser-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.novafiche-support-teaser-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0 0 15px;
}

.novafiche-support-teaser-text {
    font-size: 1rem;
    color: var(--novafiche-gray);
    margin: 0 0 25px;
    line-height: 1.6;
}

/* ============================================
   Sticky Button
   ============================================ */
.novafiche-sticky-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--novafiche-white);
    border: 2px solid var(--novafiche-green);
    border-radius: 50px;
    box-shadow: var(--novafiche-shadow-hover);
    text-decoration: none;
    color: var(--novafiche-green);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    transition: all var(--novafiche-transition);
}

.novafiche-sticky-btn:hover {
    background: var(--novafiche-green);
    color: var(--novafiche-white);
    transform: translateY(-2px);
}

.novafiche-sticky-btn-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.novafiche-sticky-btn:hover .novafiche-sticky-btn-icon {
    filter: brightness(0) invert(1);
}

/* ============================================
   Content Support Button (end of single)
   ============================================ */
.novafiche-content-support {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid var(--novafiche-gray-lighter);
}

.novafiche-content-support-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: var(--novafiche-green-bg);
    border-radius: var(--novafiche-radius);
}

.novafiche-content-support-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.novafiche-content-support-text {
    flex: 1;
}

.novafiche-content-support-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0 0 5px;
}

.novafiche-content-support-desc {
    font-size: 0.9rem;
    color: var(--novafiche-gray);
    margin: 0;
}

/* ============================================
   Experts Page
   ============================================ */
.novafiche-experts-header {
    text-align: center;
    padding: 10px 0;
}

.novafiche-experts-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 10px;
}

.novafiche-experts-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0 0 8px;
}

.novafiche-experts-subtitle {
    font-size: 0.95rem;
    color: var(--novafiche-gray);
    margin: 0 0 15px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Welcome (logged in) */
.novafiche-experts-welcome {
    background: var(--novafiche-green-bg);
    border-radius: var(--novafiche-radius);
    padding: 20px 25px;
    margin-bottom: 30px;
    text-align: center;
}

.novafiche-experts-welcome-text {
    font-size: 1rem;
    color: var(--novafiche-dark);
    margin: 0;
}

/* Guest (not logged in) */
.novafiche-experts-guest {
    margin-bottom: 30px;
}

.novafiche-experts-guest-box {
    background: var(--novafiche-white);
    border: 2px solid var(--novafiche-green);
    border-radius: var(--novafiche-radius);
    padding: 25px 30px;
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
}

.novafiche-experts-guest-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0 0 15px;
    text-align: center;
}

.novafiche-experts-guest-text {
    font-size: 0.95rem;
    color: var(--novafiche-gray);
    line-height: 1.6;
    margin: 0 0 12px;
}

.novafiche-experts-guest-actions {
    margin-top: 20px;
    text-align: center;
}

.novafiche-experts-guest-login {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--novafiche-gray);
}

.novafiche-experts-guest-login a {
    color: var(--novafiche-green);
    font-weight: 600;
}

/* Forums Section */
.novafiche-experts-forums {
    margin-bottom: 30px;
}

.novafiche-experts-forums-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--novafiche-gray-lighter);
}

/* Forums Grid - 2 colonnes */
.novafiche-forums-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

/* Forum Card */
.novafiche-forum-card {
    background: var(--novafiche-white);
    border: 2px solid var(--novafiche-gray-lighter);
    border-radius: var(--novafiche-radius);
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.novafiche-forum-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.novafiche-forum-card-header i {
    font-size: 1.4rem;
    color: var(--novafiche-green);
}

.novafiche-forum-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--novafiche-dark);
    margin: 0;
}

.novafiche-forum-card .novafiche-forum-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.novafiche-forum-card .novafiche-forum-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--novafiche-gray-lighter);
}

.novafiche-forum-card .novafiche-forum-subitem:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.novafiche-forum-card .novafiche-forum-subitem i {
    color: var(--novafiche-gray-light);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.novafiche-forum-card .novafiche-forum-subitem span {
    flex: 1;
    font-size: 0.9rem;
    color: var(--novafiche-gray-dark);
}

.novafiche-forum-card .novafiche-forum-subitem .novafiche-btn-sm {
    flex-shrink: 0;
}

/* Bouton small */
.novafiche-btn-sm {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
}

/* ============================================
   No Content
   ============================================ */
.novafiche-no-content {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--novafiche-gray);
    font-size: 1rem;
}

/* ============================================
   Responsive: Tablet (max 992px)
   ============================================ */
@media (max-width: 992px) {
    .novafiche-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .novafiche-title {
        font-size: 2.5rem !important;
    }
    
    .novafiche-container .novafiche-categories,
    nav.novafiche-categories {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }
    
    .novafiche-container .novafiche-category,
    a.novafiche-category {
        padding: 20px 10px !important;
    }
    
    .novafiche-container .novafiche-category-icon,
    div.novafiche-category-icon {
        width: 65px !important;
        height: 65px !important;
    }
    
    .novafiche-category-icon i {
        font-size: 1.8rem !important;
    }
    
    .novafiche-category-icon-help img {
        width: 40px !important;
        height: 40px !important;
    }
    
    .novafiche-container .novafiche-category-name,
    span.novafiche-category-name {
        font-size: 0.85rem !important;
    }
    
    .novafiche-content-support-inner {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   Responsive: Mobile (max 600px)
   ============================================ */
@media (max-width: 600px) {
    .novafiche-container,
    .novafiche-experts-container {
        padding: 0 15px;
    }
    
    .novafiche-header {
        padding: 20px 0;
    }
    
    .novafiche-title {
        font-size: 2rem !important;
    }
    
    .novafiche-tagline {
        font-size: 1rem;
    }
    
    .novafiche-search-input {
        padding: 14px 15px 14px 45px;
        font-size: 0.95rem;
    }
    
    /* Grille catégories mobile : 2 colonnes */
    .novafiche-container .novafiche-categories,
    nav.novafiche-categories {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .novafiche-container .novafiche-category,
    a.novafiche-category {
        padding: 15px 10px !important;
    }
    
    .novafiche-container .novafiche-category-icon,
    div.novafiche-category-icon {
        width: 50px !important;
        height: 50px !important;
        margin-bottom: 10px !important;
    }
    
    .novafiche-category-icon i {
        font-size: 1.4rem !important;
    }
    
    .novafiche-category-icon-help img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .novafiche-container .novafiche-category-name,
    span.novafiche-category-name {
        font-size: 0.75rem !important;
    }
    
    .novafiche-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .novafiche-section-title {
        font-size: 1.3rem;
    }
    
    /* Sticky button mobile - icône seule */
    .novafiche-sticky-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px;
        border-radius: 50%;
    }
    
    .novafiche-sticky-btn-text {
        display: none;
    }
    
    .novafiche-sticky-btn-icon {
        width: 24px;
        height: 24px;
    }
    
    /* Support teaser mobile */
    .novafiche-support-teaser {
        padding: 30px 20px;
    }
    
    .novafiche-support-teaser-icon {
        width: 60px;
        height: 60px;
    }
    
    .novafiche-support-teaser-title {
        font-size: 1.3rem;
    }
    
    /* Experts page mobile */
    .novafiche-experts-header {
        padding: 15px 0 10px;
    }
    
    .novafiche-experts-icon {
        width: 60px;
        height: 60px;
    }
    
    .novafiche-experts-title {
        font-size: 1.6rem;
    }
    
    .novafiche-experts-guest-box {
        padding: 20px 15px;
    }
    
    /* Forums grid mobile - 1 colonne */
    .novafiche-forums-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .novafiche-forum-card {
        padding: 20px;
    }
    
    .novafiche-content-support-inner {
        padding: 20px;
        gap: 15px;
    }
    
    .novafiche-content-support-icon {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
.novafiche-btn:focus,
.novafiche-category:focus,
.novafiche-card-link:focus,
.novafiche-search-input:focus,
.novafiche-sticky-btn:focus {
    outline: 2px solid var(--novafiche-green);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .novafiche-container *,
    .novafiche-experts-container * {
        transition: none !important;
        animation: none !important;
    }
}
