/* Variables par défaut */
:root {
    --primary-color: #2F80ED;
    --secondary-color: #252525;
    --text-color: #949494;
    --accent-color: #F6F6F6;
    --white: #FFFFFF;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.2);
    --transition: all 0.3s ease;
}

/* Container principal */
.am-projects-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Filtres - Style de base */
.am-projects-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(148, 148, 148, 0.2);
}

.am-filter-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    padding: 10px 5px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.am-filter-btn:hover {
    color: var(--secondary-color);
}

.am-filter-btn.active {
    color: var(--primary-color);
}

.am-filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -21px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Grille principale */
.am-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 380px;
    gap: 24px;
}

/* Items du projet */
.am-project-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #1F2937;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Tailles des items */
.am-item-normal {
    grid-column: span 1;
    grid-row: span 1;
}

.am-item-tall {
    grid-column: span 1;
    grid-row: span 2;
}

/* Effet hover par défaut */
.am-project-item:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* Lien du projet */
.am-project-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* Image */
.am-project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.am-project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.am-project-item:hover .am-project-image img {
    transform: scale(1.08);
}

/* Overlay gradient par défaut */
.am-project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.7) 80%, 
        rgba(0,0,0,0.85) 100%);
    z-index: 1;
    transition: var(--transition);
}

.am-project-item:hover .am-project-overlay {
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.2) 40%,
        rgba(0,0,0,0.75) 80%, 
        rgba(0,0,0,0.9) 100%);
}

/* Placeholder */
.am-project-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.8;
}

/* Contenu sur l'image */
.am-project-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Pagination - Styles de base */
.am-projects-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.am-projects-pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.am-projects-pagination li {
    list-style: none;
}

/* Styles pour TOUS les éléments de pagination */
.am-projects-pagination a,
.am-projects-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

/* Style par défaut des liens */
.am-projects-pagination a {
    background: var(--accent-color, #F6F6F6);
    color: var(--text-color, #949494);
}

/* Hover sur les liens */
.am-projects-pagination a:hover {
    background: var(--primary-color, #2F80ED);
    color: #FFFFFF;
}

/* IMPORTANT: Style pour la page ACTIVE/COURANTE */
.am-projects-pagination .page-numbers.current,
.am-projects-pagination .current .page-numbers,
.am-projects-pagination li.active .page-numbers,
.am-projects-pagination li.active span {
    background: var(--primary-color, #2F80ED) !important;
    color: #FFFFFF !important;
    cursor: default;
    pointer-events: none;
}

/* Style alternatif si WordPress génère différemment */
.am-projects-pagination span.current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    background: var(--primary-color, #2F80ED) !important;
    color: #FFFFFF !important;
}

/* Dots (points de suspension) */
.am-projects-pagination .dots,
.am-projects-pagination span.dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: var(--text-color, #949494);
    cursor: default;
    background: transparent;
}

/* Flèches désactivées */
.am-projects-pagination .prev.disabled,
.am-projects-pagination .next.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Animations de pagination */
.am-projects-pagination a,
.am-projects-pagination .page-numbers {
    transition: all 0.3s ease;
}

/* Animation Grow */
[data-pagination-hover="grow"] .am-projects-pagination a:hover {
    transform: scale(1.1);
}

/* Animation Shrink */
[data-pagination-hover="shrink"] .am-projects-pagination a:hover {
    transform: scale(0.9);
}

/* Animation Pulse */
[data-pagination-hover="pulse"] .am-projects-pagination a:hover {
    animation: pagination-pulse 0.5s;
}

/* Animation Pop */
[data-pagination-hover="pop"] .am-projects-pagination a:hover {
    animation: pagination-pop 0.3s;
}

@keyframes pagination-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pagination-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3) rotate(5deg); }
    100% { transform: scale(1); }
}


/* Header du projet */
.am-project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 15px;
}

.am-project-title {
    font-size: 20px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.am-item-tall .am-project-title {
    font-size: 26px;
}

.am-project-year {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

/* Tags */
.am-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.am-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #FFFFFF;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

/* Couleurs des tags par défaut */
.am-tag-developpement {
    background: rgba(59, 130, 246, 0.9);
}

.am-tag-formation {
    background: rgba(16, 185, 129, 0.9);
}

.am-tag-design {
    background: rgba(168, 85, 247, 0.9);
}

.am-tag-accompagnement {
    background: rgba(251, 146, 60, 0.9);
}

.am-tag-seo {
    background: rgba(239, 68, 68, 0.9);
}

.am-tag-serveur {
    background: rgba(99, 102, 241, 0.9);
}

.am-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* État caché */
.am-project-item.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* Pagination */
.am-projects-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.am-projects-pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.am-projects-pagination li {
    list-style: none;
}

.am-projects-pagination a,
.am-projects-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    background: var(--accent-color);
    color: var(--text-color);
}

.am-projects-pagination a:hover {
    background: var(--primary-color);
    color: #FFFFFF;
}

.am-projects-pagination .current span {
    background: var(--primary-color);
    color: #FFFFFF;
}

/* Styles de filtres additionnels */

/* Style Pills */
.am-filter-style-pills .am-projects-filters {
    background: #F3F4F6;
    padding: 8px;
    border-radius: 50px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border-bottom: none;
}

.am-filter-style-pills .am-filter-btn {
    border-radius: 40px;
    padding: 10px 24px;
}

.am-filter-style-pills .am-filter-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Style Buttons */
.am-filter-style-buttons .am-projects-filters {
    border-bottom: none;
}

.am-filter-style-buttons .am-filter-btn {
    padding: 12px 28px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    background: white;
}

.am-filter-style-buttons .am-filter-btn:hover {
    border-color: var(--primary-color);
}

.am-filter-style-buttons .am-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Style Minimal */
.am-filter-style-minimal .am-projects-filters {
    border-bottom: none;
}

.am-filter-style-minimal .am-filter-btn {
    padding: 8px 0;
    margin: 0 20px;
}

/* Animations au hover des filtres */
.am-hover-grow .am-filter-btn:hover {
    transform: scale(1.05);
}

.am-hover-shrink .am-filter-btn:hover {
    transform: scale(0.95);
}

.am-hover-pulse .am-filter-btn:hover {
    animation: pulse 0.5s;
}

.am-hover-float .am-filter-btn:hover {
    transform: translateY(-3px);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Indicateurs actifs */
.am-active-indicator-dot .am-filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.am-active-indicator-none .am-filter-btn.active::after {
    display: none;
}

/* Variantes d'overlay */
.am-overlay-top .am-project-overlay {
    background: linear-gradient(to top, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.7) 100%);
}

.am-overlay-full .am-project-overlay {
    background: rgba(0,0,0,0.5);
}

.am-overlay-radial .am-project-overlay {
    background: radial-gradient(circle at center, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0.7) 100%);
}

.am-overlay-none .am-project-overlay {
    display: none;
}

/* Effets hover des cartes */
.am-hover-effect-none .am-project-item:hover {
    transform: none;
}

.am-hover-effect-lift .am-project-item:hover {
    transform: translateY(-8px);
}

.am-hover-effect-zoom .am-project-item:hover {
    transform: scale(1.03);
}

.am-hover-effect-rotate .am-project-item:hover {
    transform: rotate(2deg) scale(1.02);
}

.am-hover-effect-blur .am-project-item {
    filter: blur(2px);
    transition: filter 0.3s;
}

.am-hover-effect-blur .am-project-item:hover {
    filter: blur(0px);
}

/* Styles de tags */
.am-tag-style-outline .am-tag {
    background: transparent !important;
    border: 2px solid currentColor;
}

.am-tag-style-ghost .am-tag {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.am-project-item {
    animation: fadeInUp 0.5s ease both;
}

.am-project-item:nth-child(1) { animation-delay: 0.05s; }
.am-project-item:nth-child(2) { animation-delay: 0.1s; }
.am-project-item:nth-child(3) { animation-delay: 0.15s; }
.am-project-item:nth-child(4) { animation-delay: 0.2s; }
.am-project-item:nth-child(5) { animation-delay: 0.25s; }
.am-project-item:nth-child(6) { animation-delay: 0.3s; }
.am-project-item:nth-child(7) { animation-delay: 0.35s; }
.am-project-item:nth-child(8) { animation-delay: 0.4s; }
.am-project-item:nth-child(9) { animation-delay: 0.45s; }
.am-project-item:nth-child(10) { animation-delay: 0.5s; }

/* Message vide */
.am-no-projects {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-color);
    font-size: 16px;
}

/* Responsive Tablette */
@media (max-width: 1024px) {
    .am-projects-wrapper {
        padding: 40px 20px;
    }
    
    .am-projects-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 350px;
        gap: 20px;
    }
    
    .am-project-content {
        padding: 25px;
    }
    
    .am-project-title {
        font-size: 18px;
    }
    
    .am-item-tall .am-project-title {
        font-size: 22px;
    }
}

/* Responsive Mobile */
@media (max-width: 640px) {
    .am-projects-wrapper {
        padding: 30px 16px;
    }
    
    .am-projects-filters {
        gap: 20px;
        flex-wrap: wrap;
    }
    
    .am-filter-btn {
        font-size: 14px;
    }
    
    .am-projects-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 320px;
        gap: 16px;
    }
    
    .am-item-tall {
        grid-row: span 1;
    }
    
    .am-project-content {
        padding: 20px;
    }
    
    .am-project-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .am-project-title {
        font-size: 18px;
    }
    
    .am-item-tall .am-project-title {
        font-size: 18px;
    }
    
    .am-project-year {
        font-size: 14px;
    }
    
    .am-tag {
        font-size: 12px;
        padding: 5px 12px;
    }
    
    .am-projects-pagination a,
    .am-projects-pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}