/**
 * Styles CSS pour les pages publiques des réalisations
 * Design cohérent avec le thème LudoFuites
 */

/* ========== ANIMATIONS GLOBALES ========== */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-scale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes shimmer-effect {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Classes d'animation */
.animate-fade-in-up {
    animation: fade-in-up 0.8s ease-out;
}

.animate-fade-in-scale {
    animation: fade-in-scale 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slide-in-left 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slide-in-right 0.6s ease-out;
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite;
}

/* ========== CARTES DE RÉALISATIONS ========== */

.realisation-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.realisation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.05),
        rgba(16, 185, 129, 0.05)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.realisation-card:hover::before {
    opacity: 1;
}

.realisation-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(59, 130, 246, 0.1);
}

.realisation-card .card-image {
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.realisation-card:hover .card-image img {
    transform: scale(1.08);
}

.realisation-card .card-content {
    position: relative;
    z-index: 2;
}

/* Effet de survol sur les titres */
.realisation-card .card-title {
    position: relative;
    transition: all 0.3s ease;
}

.realisation-card .card-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    transition: width 0.3s ease;
}

.realisation-card:hover .card-title::after {
    width: 100%;
}

/* ========== GALERIE D'IMAGES ========== */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.3)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item .overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-item:hover .overlay-content {
    transform: translateY(0);
}

/* ========== MODALE D'IMAGE ========== */

.image-modal {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.image-modal.modal-open {
    opacity: 1;
}

.image-modal .modal-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.image-modal .modal-controls {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.image-modal:hover .modal-controls {
    opacity: 1;
}

.image-modal .modal-caption {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

/* ========== BADGES ET STATUTS ========== */

.badge {
    position: relative;
    overflow: hidden;
}

.badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.badge:hover::before {
    left: 100%;
}

.badge-featured {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    animation: pulse-soft 3s infinite;
}

.badge-category {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.badge-keyword {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* ========== FILTRES ET RECHERCHE ========== */

.filter-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.filter-bar:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.search-input {
    position: relative;
}

.search-input::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: inherit;
    background: linear-gradient(45deg, #3b82f6, #10b981) border-box;
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-input:focus-within::before {
    opacity: 1;
}

/* ========== PAGINATION ========== */

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.pagination-item {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pagination-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(59, 130, 246, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.pagination-item:hover::before {
    left: 100%;
}

.pagination-item.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    transform: scale(1.1);
}

/* ========== LAZY LOADING ========== */

.lazy {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy.loaded {
    opacity: 1;
}

.lazy-placeholder {
    background: linear-gradient(
        90deg,
        #f3f4f6 25%,
        #e5e7eb 50%,
        #f3f4f6 75%
    );
    background-size: 200px 100%;
    animation: shimmer-effect 1.5s infinite linear;
}

/* ========== SECTIONS SPÉCIALES ========== */

.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff08" points="0,1000 1000,0 1000,1000"/></svg>');
    pointer-events: none;
}

.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== BOUTONS SPÉCIALISÉS ========== */

.btn-gradient {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-gradient-light {
    background: linear-gradient(135deg, #dbe9ff, #386dff86);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
}

/* ========== RESPONSIVE DESIGN ========== */

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .realisation-card {
        margin-bottom: 1rem;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .image-modal .modal-image {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}

@media (max-width: 640px) {
    .realisation-card:hover {
        transform: translateY(-4px) scale(1.01);
    }
    
    .gallery-item:hover img {
        transform: scale(1.05);
    }
}

/* ========== DARK MODE SUPPORT ========== */

@media (prefers-color-scheme: dark) {
    .filter-bar {
        background: rgba(31, 41, 55, 0.95);
        border-color: rgba(75, 85, 99, 0.2);
    }
    
    .filter-bar:hover {
        background: rgba(31, 41, 55, 1);
    }
    
    .lazy-placeholder {
        background: linear-gradient(
            90deg,
            #374151 25%,
            #4b5563 50%,
            #374151 75%
        );
    }
}

/* ========== PRINT STYLES ========== */

@media print {
    .filter-bar,
    .pagination,
    .btn,
    .modal,
    .no-print {
        display: none !important;
    }
    
    .realisation-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== ACCESSIBILITY ========== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* Améliorer la visibilité du focus */
.focus-visible:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Réduire les animations pour les utilisateurs qui les préfèrent réduites */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .realisation-card:hover {
        transform: none;
    }
    
    .gallery-item:hover img {
        transform: none;
    }
}
