/* ==================== */
/* VARIABLES & BASE CSS */
/* ==================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #0055A4;
    --primary-dark: #003366;
    --secondary: #FFD700;
    --light: #F8F9FA;
    --dark: #2C2F33;
    --gray: #DDE1E4;
}

/* =============== */
/* LAYOUT STRUCTURE */
/* =============== */
.references-wrapper {
    padding-top: 70px;
    /* Navbar height offset */
}

* {
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============= */
/* COMPONENTS */
/* ============= */

/* ----- Hero Section ----- */
.references-hero {
    height: 300px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-align: center;
    color: white;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Floating Shapes */
.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.1;
    animation: float 15s infinite linear;
}

.triangle {
    width: 100px;
    height: 100px;
    background: var(--secondary);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    top: 60%;
    left: 80%;
    animation-delay: 3s;
}

.square {
    width: 60px;
    height: 60px;
    background: var(--secondary);
    top: 30%;
    left: 70%;
    animation-delay: 6s;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(10deg);
    }

    100% {
        transform: translateY(0) rotate(0deg);
    }
}

/* ----- References Grid ----- */
.references-container {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
    gap: 30px;
    width: 90%;
}

.reference-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    width: 100%; /* Ajouté */
    max-width: 500px; /* Ajouté */
    margin: 0 auto; /* Ajouté */
}

.reference-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* Carousel Styles */
.reference-image {
    height: 250px;
    overflow: hidden;
    position: relative;
}

.image-carousel {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.carousel-inner {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Changé de cover à contain pour voir l'image entière */
    object-position: center;
    transition: transform 0.5s ease;
    background-color: #f8f9fa;
    /* Fond clair pour les images avec transparence */
}

.reference-card:hover .carousel-item img {
    transform: scale(1.05);
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 2;
}

.carousel-control.prev {
    left: 15px;
}

.carousel-control.next {
    right: 15px;
}

.reference-card:hover .carousel-control {
    opacity: 1;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.carousel-indicator.active {
    background: white;
}

/* Reference Details */
.reference-details {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.reference-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 500;
}

.reference-features span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

/* Nouveau style pour les informations du projet */
.reference-project-info {
    background: var(--light);
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.project-info-item {
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.project-info-item:last-child {
    margin-bottom: 0;
}

.project-info-item strong {
    color: var(--primary);
    font-weight: 600;
    margin-right: 8px;
}

.reference-description {
    margin-bottom: 20px;
}

.reference-description h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.reference-description p {
    color: var(--dark);
    line-height: 1.6;
    font-size: 0.95rem;
}

.reference-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: auto;
    width: fit-content;
}

.reference-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 85, 164, 0.2);
}

/* ============== */
/* MEDIA QUERIES */
/* ============== */

/* ----- Tablet & Small Desktop ----- */
@media (max-width: 1024px) {
    .references-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }

    .reference-image {
        height: 220px;
    }
}

/* ----- Tablet Portrait ----- */
@media (max-width: 768px) {
    .references-hero {
        height: calc(150px + 10vh);
        padding-top: 20px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .hero-content p {
        font-size: 0.9rem;
    }

    .references-container {
        grid-template-columns: 1fr;
    }

    .reference-card {
        max-width: 500px;
        margin: 0 auto;
    }

    .carousel-control {
        opacity: 1;
        width: 30px;
        height: 30px;
    }
}

/* ----- Mobile ----- */
@media (max-width: 480px) {
    .references-hero {
        height: 200px;
    }

    .hero-content h1 {
        font-size: 1.8rem;
    }

    .reference-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .carousel-control {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }

    .carousel-indicators {
        bottom: 10px;
    }

    .carousel-indicator {
        width: 8px;
        height: 8px;
    }

    .reference-project-info {
        padding: 12px 15px;
        margin-bottom: 15px;
    }

    .project-info-item {
        font-size: 0.9rem;
    }
}

/* ----- Navbar ----- */
.navbar {
    background-color: var(--primary);
    color: var(--gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    height: 70px;
}

.logo img {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.05);
}

/* Nav Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--gray);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.nav-links a:hover {
    color: var(--light);
    transform: translateY(-2px);
    text-shadow: 0 2px 5px rgba(255, 255, 255, 0.3);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--light);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.nav-links a.active::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--primary);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1;
    border-radius: 0 0 5px 5px;
    overflow: hidden;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: var(--gray);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    padding-left: 20px;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Burger Menu */
.menu-btn {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
}

.menu-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--gray);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }
}

/* ----- Tablet Styles ----- */
@media (max-width: 768px) {
    .menu-btn {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--primary);
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        z-index: 100;
    }

    .nav-links.active {
        max-height: 500px;
        padding: 1rem 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        padding: 1rem;
        display: flex;
        justify-content: center;
    }

    .dropdown-content {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
    }

    .dropdown:hover .dropdown-content {
        display: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    .nav-bar {
        margin: 0 auto 1.5rem auto;
    }
}

/* ----- Mobile Styles ----- */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem;
    }
}

/* ----- Footer ----- */
.footer {
    background-color: var(--gray);
    color: #000;
    padding: 4rem 2rem 0;
    width: 100%;
    overflow: hidden;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4rem;
    padding-bottom: 3rem;
}

/* Footer Logo */
.footer-logo {
    flex: 1;
    min-width: 250px;
    display: flex;
    justify-content: center;
    transition: transform 0.5s ease;
}

.footer-logo-img {
    width: 220px;
    height: auto;
    filter: brightness(0) saturate(100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.footer-logo:hover .footer-logo-img {
    transform: scale(1.08) rotate(-2deg);
    filter: brightness(0) saturate(100%) drop-shadow(0 4px 8px rgba(0, 85, 164, 0.3));
}

/* Footer Navigation */
.footer-nav {
    flex: 1;
    max-width: 220px;
    padding: 0 1rem;
}

.footer-nav h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.nav-bar {
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    margin-bottom: 1.5rem;
    transform-origin: left;
    transition: transform 0.4s ease, width 0.4s ease;
}

.footer-nav:hover .nav-bar {
    width: 80px;
    background-color: var(--primary-dark);
}

.footer-nav ul {
    list-style: none;
    padding: 0;
}

.footer-nav li {
    margin-bottom: 0.8rem;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.footer-nav li:hover {
    transform: translateX(8px);
}

.footer-link {
    color: #000;
    text-decoration: none;
    font-size: 1rem;
    position: relative;
    padding-bottom: 2px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-link:hover::after {
    width: 100%;
}

/* Footer QR Code */
.footer-qrcode {
    flex: 1;
    min-width: 250px;
    display: flex;
    justify-content: center;
    position: relative;
}

.qrcode-container {
    position: relative;
    display: inline-block;
    text-align: center;
    margin-bottom: 50px;
}

.qrcode-img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    transition: all 0.5s ease;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px;
}

.qrcode-img:hover {
    transform: scale(1.05) rotate(2deg);
    border-color: var(--primary);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.qrcode-text {
    position: absolute;
    bottom: -45px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 10px 20px;
    border-radius: 6px;
    opacity: 0;
    transition: all 0.4s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.qrcode-text::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--primary);
}

.qrcode-img:hover+.qrcode-text,
.qrcode-container:hover .qrcode-text {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Footer Bottom */
.footer-separator {
    height: 1.5px;
    background-color: #000;
    width: 90%;
    margin: 0 auto;
    opacity: 0.2;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.8rem;
}

/* Responsive Footer */
@media (max-width: 1024px) {
    .footer-content {
        gap: 3rem;
    }

    .footer-logo-img {
        width: 200px;
    }

    .qrcode-img {
        width: 200px;
        height: 200px;
    }

    .qrcode-text {
        font-size: 1rem;
        bottom: -40px;
        padding: 8px 16px;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 3rem 1.5rem 0;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2.5rem;
    }

    .footer-nav {
        max-width: 100%;
        padding: 0;
    }

    .nav-bar {
        margin: 0 auto 1.5rem auto;
    }

    .footer-logo,
    .footer-qrcode {
        min-width: 100%;
    }

    .footer-logo-img {
        width: 180px;
    }

    .qrcode-img {
        width: 180px;
        height: 180px;
    }

    .qrcode-text {
        bottom: -35px;
        font-size: 0.95rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1.2rem 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2.5rem 1rem 0;
    }

    .footer-logo-img {
        width: 160px;
    }

    .qrcode-img {
        width: 150px;
        height: 150px;
    }

    .footer-nav h3 {
        font-size: 1.2rem;
    }

    .footer-link {
        font-size: 0.95rem;
    }

    .qrcode-text {
        bottom: -30px;
        font-size: 0.85rem;
        padding: 6px 12px;
    }

    .qrcode-text::before {
        top: -6px;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid var(--primary);
    }
}

/* Lightbox pour les images agrandies */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Pour les écrans moyens */
@media (max-width: 900px) {
    .references-container {
        grid-template-columns: 1fr;
        width: 95%;
    }
    
    .reference-card {
        max-width: 100%;
        margin: 0 auto;
    }
}

/* Pour les mobiles */
@media (max-width: 480px) {
    .references-container {
        padding: 0 10px;
        gap: 20px;
    }
    
    .reference-card {
        border-radius: 8px;
    }
    
    .reference-image {
        height: 200px;
    }
    
    .reference-details {
        padding: 15px;
    }
}