/* =========================
   PAGE APPLICATIONS
========================= */

.applications-page {
    background: #ffffff;
    padding-bottom: 50px;
}

/* =========================
   HERO
========================= */
.applications-hero {
    background: #eef6ef;
    padding: 58px 0 52px;
    border-top: 1px solid #e1e8e2;
    border-bottom: 1px solid #e1e8e2;
}

.applications-hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    background: #e3f3e6;
    color: #2f9e44;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}

.applications-hero-content h1 {
    font-size: 52px;
    line-height: 1.15;
    font-weight: 800;
    color: #1d2329;
    margin-bottom: 16px;
}

.applications-hero-content p {
    max-width: 760px;
    margin: 0 auto;
    font-size: 20px;
    line-height: 1.75;
    color: #55635b;
}

/* =========================
   MENU HORIZONTAL
========================= */
.applications-tabs {
    background: #ffffff;
    border-bottom: 1px solid #e3e8e3;
    padding: 18px 0;
}

.applications-tabs-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.applications-tabs-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 999px;
    background: #f0f1f0;
    color: #3e4742;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

.tab-btn:hover,
.tab-btn.active {
    background: #2f9e44;
    color: #ffffff;
}

.applications-search input {
    width: 100%;
    max-width: 260px;
    padding: 12px 14px;
    border: 1px solid #d8ded9;
    border-radius: 10px;
    background: #fafafa;
    color: #777;
    font-size: 14px;
}

/* =========================
   SECTION
========================= */
.applications-list-section {
    padding: 38px 0 36px;
}

.applications-section-head {
    margin-bottom: 28px;
}

.applications-section-head h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1d2329;
}

/* =========================
   GRID CARTES
========================= */
.applications-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.application-card {
    background: #ffffff;
    border: 1px solid #e3e7e3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.application-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.application-card-image {
    position: relative;
    height: 240px;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.application-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 12px;
}

.application-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #2f9e44;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 999px;
}

.application-card-content {
    padding: 18px 18px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.application-mini-label {
    display: inline-block;
    font-size: 12px;
    color: #4f9c5f;
    margin-bottom: 8px;
    font-weight: 600;
}

.application-card-content h3 {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: #1f252c;
    margin-bottom: 10px;
}

.application-card-content p {
    font-size: 15px;
    line-height: 1.6;
    color: #5d695f;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    cursor: help;
    border-bottom: 1px dotted rgba(47, 158, 68, 0.2);
    transition: all 0.2s ease;
}

.application-card-content p:hover {
    border-bottom-color: rgba(47, 158, 68, 0.6);
}

/* Tooltip au survol affichant le texte complet */
.application-card-content p::after {
    content: attr(data-full);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: #2f9e44;
    color: #ffffff;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.65;
    white-space: normal;
    width: 300px;
    max-width: calc(100vw - 32px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    margin-bottom: 10px;
    word-wrap: break-word;
    text-align: left;
}

/* Flèche du tooltip */
.application-card-content p::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #2f9e44;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
}

.application-card-content p:hover::after,
.application-card-content p:hover::before {
    opacity: 1;
    visibility: visible;
}

.card-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #2f9e44;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    padding: 13px 16px;
    border-radius: 4px;
    transition: background 0.25s ease;
    margin-top: auto;
}

.card-btn:hover {
    background: #25853a;
}

/* =========================
   EMPTY STATE
========================= */
.empty-state {
    background: #ffffff;
    border: 1px solid #e1e7e1;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    color: #5d695f;
    font-size: 16px;
}

/* =========================
   DROPDOWN MENU (MOBILE)
========================= */
.tabs-menu-container {
    display: none;
    align-items: center;
    gap: 12px;
}

.tabs-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    background: #f0f1f0;
    color: #3e4742;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tabs-menu-btn:hover {
    background: #e0e3e0;
}

.tabs-menu-btn.active {
    background: #2f9e44;
    color: #ffffff;
}

.menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.menu-label {
    display: inline;
}

.tabs-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e3e8e3;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    min-width: 200px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 100;
    margin-top: 4px;
}

.tabs-menu-dropdown.open {
    max-height: 400px;
}

.dropdown-content {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.dropdown-content .tab-btn {
    width: 100%;
    border-radius: 0;
    background: transparent;
    color: #3e4742;
    padding: 12px 16px;
    margin: 0;
    justify-content: flex-start;
    border-bottom: 1px solid #f0f1f0;
    transition: all 0.2s ease;
}

.dropdown-content .tab-btn:last-child {
    border-bottom: none;
}

.dropdown-content .tab-btn:hover {
    background: #f5f5f5;
}

.dropdown-content .tab-btn.active {
    background: #eef6ef;
    color: #2f9e44;
}

.applications-tabs-menu.desktop-menu {
    display: flex !important;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .applications-hero-content h1 {
        font-size: 42px;
    }

    .applications-hero-content p {
        font-size: 18px;
    }

    .applications-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .application-card-image {
        height: 220px;
    }
    
    .application-card-content h3 {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .applications-hero {
        padding: 50px 0 44px;
    }
    
    .applications-list-section {
        padding: 42px 0 36px;
    }
    
    .applications-section-head h2 {
        font-size: 32px;
    }
    
    .applications-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .application-card-image {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .applications-hero {
        padding: 44px 0 38px;
    }

    .applications-hero-content h1 {
        font-size: 34px;
    }

    .applications-hero-content p {
        font-size: 16px;
    }

    .applications-tabs-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        flex-wrap: wrap;
    }

    /* Afficher le menu déroulant */
    .tabs-menu-container {
        display: flex;
        order: 1;
    }

    /* Masquer le menu desktop */
    .applications-tabs-menu.desktop-menu {
        display: none !important;
    }

    .applications-search {
        order: 2;
        flex-grow: 1;
        min-width: 200px;
    }

    .applications-search input {
        width: 100%;
    }
    
    .applications-section-head h2 {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .applications-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .application-card-image {
        height: 180px;
    }
    
    .application-card-content {
        padding: 14px 14px 16px;
    }
    
    .application-card-content h3 {
        font-size: 16px;
    }
    
    .application-card-content p {
        font-size: 13px;
        margin-bottom: 14px;
    }
    
    .card-btn {
        font-size: 13px;
        padding: 11px 14px;
    }
}

@media (max-width: 520px) {
    .tab-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 13px;
    }

    .applications-tabs-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .applications-section-head h2 {
        font-size: 22px;
    }

    .application-card {
        border-radius: 8px;
    }
    
    .application-card-image {
        height: 160px;
    }
    
    .application-card-image img {
        padding: 10px;
    }
    
    .application-badge {
        top: 10px;
        left: 10px;
        font-size: 10px;
        padding: 6px 10px;
    }

    .application-card-content {
        padding: 12px 10px 10px;
    }
    
    .application-mini-label {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .application-card-content h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .application-card-content p {
        font-size: 12px;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
    }
    
    .card-btn {
        font-size: 12px;
        padding: 9px 12px;
        border-radius: 4px;
    }
}
.card-image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.application-card-image {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.application-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.35s ease;
}

.card-image-link:hover img {
    transform: scale(1.02);
}

.search-field {
    width: 100%;
    min-width: 260px;
}