/* Réalisations Page Styles */

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* Filters Section */
#filters-section {
    padding: 2rem 3rem;
    background: var(--darker-bg);
    display: flex;
    justify-content: center;
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 1200px;
}

.filter-btn {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    background: rgba(252, 207, 3, 0.2);
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(252, 207, 3, 0.2);
}

.filter-btn.active {
    background: var(--primary-yellow);
    border-color: var(--primary-yellow);
    color: var(--dark-bg);
    box-shadow: 0 4px 15px rgba(252, 207, 3, 0.3);
}

.filter-btn.active:hover {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--dark-bg);
}

/* Hero Section Réalisations */
#hero-realisations {
    padding: 12rem 3rem 6rem;
    text-align: center;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
}

#hero-realisations .hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

#hero-realisations .hero-content h1 span {
    color: var(--primary-yellow);
    text-shadow: 0 0 20px rgba(252, 207, 3, 0.8);
}

#hero-realisations .hero-tagline {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Projects Grid */
#projects-grid {
    padding: 4rem 3rem 6rem;
    background: var(--darker-bg);
    position: relative;
    z-index: 1;
    margin-bottom: 2rem;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    perspective: 1200px;
}

.project-item {
    position: relative;
    aspect-ratio: 16/10;
    border-radius: 20px;
    overflow: visible;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.project-mockup {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.project-mockup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.project-overlay {
    position: absolute;
    top: calc(100% - 20px);
    left: 0;
    right: 0;
    background: linear-gradient(
        135deg,
        var(--dark-bg) 0%,
        var(--gray-60) 50%,
        rgba(252, 207, 3, 0.1) 100%
    );
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 0 0 20px 20px;
    padding: 0;
    text-align: left;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: top;
    z-index: -1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.project-overlay h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
}

.project-type {
    font-size: 0.9rem;
    color: var(--primary-yellow);
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.15s;
}

.project-company {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-style: italic;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.2s;
}

/* Description supprimée des miniatures pour plus d'ergonomie */

/* Hover Effects */
.project-item:hover {
    box-shadow: 
        0 20px 60px rgba(252, 207, 3, 0.2),
        0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.project-item:hover .project-overlay {
    max-height: 220px;
    padding: 2rem 1.5rem 1.5rem;
}

.project-item:hover .project-overlay h3,
.project-item:hover .project-type,
.project-item:hover .project-company {
    opacity: 1;
    transform: translateY(0);
}

.project-item:hover .project-mockup img {
    transform: scale(1.05);
}

/* Active/Expanded state (75% scale as specified) */
.project-item.expanded {
    transform: scale(0.75);
}

/* Project Viewer Modal */
.viewer-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2147483649 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: all 0.4s ease;
    pointer-events: none !important;
}

.viewer-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Assurer que le viewer soit au-dessus de tous les autres éléments */
body:has(.viewer-overlay.active) #2ro-cookie-banner,
body:has(.viewer-overlay.active) .preloader {
    z-index: 1 !important;
}

/* Forcer l'affichage du viewer au-dessus de tout */
.viewer-overlay.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483649 !important;
    display: flex !important;
}

/* Règle ultime pour forcer l'affichage du viewer SEULEMENT quand actif */
div#project-viewer.viewer-overlay.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483649 !important;
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    background: rgba(0, 0, 0, 0.9) !important;
}

/* S'assurer que sans la classe active, le viewer est bien caché */
div#project-viewer.viewer-overlay:not(.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.viewer-container {
    background: var(--dark-bg) !important;
    border-radius: 20px !important;
    width: 90vw !important;
    max-width: 1200px !important;
    height: 80vh !important;
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid var(--card-border) !important;
    transform: scale(0.9) translateY(50px);
    transition: transform 0.4s ease;
    z-index: 2147483650 !important;
}

.viewer-overlay.active .viewer-container {
    transform: scale(1) translateY(0);
}

.viewer-close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: var(--text-light) !important;
    font-size: 1.5rem !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 2147483651 !important;
    transition: all 0.3s ease;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.viewer-close:hover {
    background: var(--primary-yellow);
    color: var(--dark-bg);
    transform: rotate(90deg);
}

.viewer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.viewer-left {
    padding: 3rem;
    background: var(--darker-bg);
    overflow-y: auto;
}

.viewer-right {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-details h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-type {
    background: var(--primary-yellow);
    color: var(--dark-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.meta-company {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-full-description {
    margin-bottom: 2rem;
}

.project-full-description p {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1rem;
}

.project-features h4,
.project-tech h4 {
    color: var(--primary-yellow);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-features ul {
    list-style: none;
    padding: 0;
}

.project-features li {
    color: var(--text-light);
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.project-features li::before {
    content: '→';
    color: var(--primary-yellow);
    position: absolute;
    left: 0;
    font-weight: 600;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    background: rgba(252, 207, 3, 0.1);
    border: 1px solid var(--primary-yellow);
    color: var(--primary-yellow);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Gallery */
.project-gallery {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.gallery-thumbnail {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumbnail:hover,
.gallery-thumbnail.active {
    opacity: 1;
    border-color: var(--primary-yellow);
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation Active State */
nav li.active {
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .projects-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 1.5rem;
    }
    
    .viewer-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .viewer-left {
        padding: 2rem;
        max-height: 50vh;
    }
    
    .viewer-right {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    #filters-section {
        padding: 1.5rem 1.5rem;
    }
    
    .filters-container {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    #hero-realisations {
        padding: 10rem 1.5rem 4rem;
    }
    
    #hero-realisations .hero-content h1 {
        font-size: 2.5rem;
    }
    
    #projects-grid {
        padding: 3rem 1.5rem;
    }
    
    .projects-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .project-item {
        aspect-ratio: 16/9 !important;
        max-height: none !important;
        margin: 0 auto;
        max-width: 350px;
        position: relative;
    }
    
    .project-overlay {
        padding: 1rem 1rem 0.5rem 1rem !important;
        max-height: none !important;
        height: auto !important;
        position: relative !important;
        top: auto !important;
        z-index: 1 !important;
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
        border-radius: 0 0 20px 20px !important;
    }
    
    .project-overlay h3 {
        font-size: 1.4rem !important;
        margin-bottom: 0.5rem !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .project-type {
        font-size: 1rem !important;
        margin-bottom: 0.3rem !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .project-company {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Description supprimée des miniatures pour plus d'ergonomie */
    
    .project-mockup {
        aspect-ratio: 16/9;
    }
    
    .project-item:hover .project-overlay {
        max-height: 200px;
        padding: 1.5rem 1rem 1rem;
    }
    
    .viewer-container {
        width: 95vw;
        height: 90vh;
        margin: 1rem;
    }
    
    .viewer-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .viewer-left {
        padding: 1.5rem;
        max-height: 40vh;
    }
    
    .project-details h2 {
        font-size: 2rem;
    }
}