@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500&display=swap");

html, body
{
    background-color: #E6E6E6 !important;
    font-family: "Space Grotesk", system-ui, -apple-system, sans-serif !important;
}

.animated-bg {
    display: flex;
    flex-direction: column;

    background: linear-gradient(
        120deg,
        #1D6A7D,
        #3B8EA5,
        #6FB1C7,
        #1D6A7D
    );
    background-size: 300% 300%;
    animation: gradientMove 18s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    background-color: transparent;
    border-bottom: 1px solid transparent;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.navbar {
    position: sticky !important;
    top: 0;
    z-index: 100;
    padding: 1rem 1.5rem;

    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Logo */
.navbar-logo img {
    height: 72px;
    transition: height 0.3s ease;
}

.navbar-center {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

/* Onglet style tic-tac */
.nav-item {
    position: relative;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 50px; /* forme arrondie type tic-tac */
    transition: all 0.3s ease; /* fluidité */
    z-index: 0;
    margin-right: 0.5rem;
}

/* Contour invisible par défaut */
.nav-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    border: 2px solid transparent;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    z-index: -1;
}

/* Actif : contour visible */
.nav-item.active::before {
    background-color : #1D6A7D !important;
    color : #fff !important;
    opacity: 1;
    transform: scale(1);
}

/* Hover : contour apparaît doucement */
.nav-item:not(.active):hover::before {
    opacity: 0.5;
    transform: scale(1);
}

/* Texte actif */
.nav-item.active {
    color: #ffffff;
}

/* Texte hover */
.nav-item:not(.active):hover {
    color: #e0e0ff;
}

.user-large
{
    font-size : 20px !important;
}

.page-content {
    background-color: #ffffff;

    padding: 3rem 2rem;
    min-height: 100vh;

    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

.page-content {
    animation: slideUp 0.8s ease-out both;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero {
    min-height: 100vh;
    background: linear-gradient(
        120deg,
        #1D6A7D,
        #3B8EA5,
        #6FB1C7,
        #1D6A7D
    );
    background-size: 300% 300%;
    animation: gradientMove 18s ease infinite;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 6rem;
}


.upload-box {
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;

    transition: all 0.3s ease;
}

.upload-box:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #ffffff;
}

.upload-icon {
    display: block;
    font-size: 48px;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 1rem;
}

.upload-box p {
    color: #ffffff;
    font-size: 16px;
}

.upload-box.dragover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #ffffff;
}

.upload-box.success {
    border-color: #9effb8;
}

.upload-box.success .upload-icon {
    color: #9effb8;
}
.analysis-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    width: 100%;
}

.progress-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.progress-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: #ffffff;
    border-radius: 999px;
    transition: width 600ms ease-out;
}

.progress-fill.error {
    background: #ff6b6b;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

#progress-percent {
    font-weight: 600;
}

.hero-right {
    position: relative;
    display: flex;
    justify-content: center;
}

.image-stack {
    position: relative;
    width: min(420px, 90vw);
    aspect-ratio: 1 / 1;
}

.image-card {
    position: absolute;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 20px;

    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s ease;
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.card-main {
    width: 80%;
    height: 80%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.card-top {
    width: 50%;
    height: 40%;
    top: 0;
    left: 0;
    transform: translate(-90px, -60px);
    z-index: 3;
}

.card-bottom {
    width: 220px;
    height: 180px;
    bottom: 0;
    right: 0;
    transform: translate(90px, 60px);
    z-index: 3;
}

.image-stack:hover .card-main {
     transform: translate(-50%, -50%) scale(1.03);
}

/* .image-stack:hover .card-top {
    transform: translate(-60px, -30px) scale(1.03);
}

.image-stack:hover .card-bottom {
    transform: translate(60px, 30px) scale(1.03);
} */

.hidden {
    display: none;
}

@media (max-width: 1024px) {
    .hero-container {
        flex-direction: column;
        gap: 4rem;
        text-align: center;
    }

    .hero-left {
        max-width: 600px;
    }

    .image-stack {
        width: 360px;
    }

    .card-top {
        transform: translate(-60px, -40px);
    }

    .card-bottom {
        transform: translate(60px, 40px);
    }
    .navbar {
        padding: 0.75rem 1.25rem;
    }

    .navbar-logo img {
        height: 60px;
    }

    .navbar-center {
        gap: 1rem;
    }

    .nav-item {
        padding: 0.4rem 0.9rem;
        font-size: 14px;
    }
}

@media (max-width: 768px) {

    .navbar {
        padding: 0.6rem 1rem;
    }

    .navbar-center {
        display: none;
    }

    .navbar-logo img {
        height: 48px;
    }

    .navbar-right {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .nav-item {
        padding: 0.35rem 0.6rem;
    }

    .user-large {
        font-size: 18px !important;
    }

    .navbar-right img {
        height: 22px;
    }
}

@media (max-width: 480px) {

    .navbar-logo img {
        height: 42px;
    }

    .navbar-right {
        gap: 0.5rem;
    }

    .user-large {
        font-size: 16px !important;
    }
}

/* ===== Mobile hardening / responsive patch ===== */

/* 1) Empêcher les débordements horizontaux (souvent causés par transforms + widths fixes) */
html, body {
  width: 100%;
  overflow-x: hidden;
}

/* 2) Un container de page plus souple (ton HTML utilise id="page-content" + class animated-bg) */
#page-content {
  min-height: 100dvh; /* mieux que 100vh sur mobile (barres navigateur) */
}

/* 3) Page content: padding responsive */
.page-content {
  padding: clamp(1rem, 3vw, 2rem);
}

/* 4) Navbar: hauteur + padding responsive */
.navbar {
  padding: clamp(0.6rem, 2.5vw, 1rem) clamp(0.8rem, 3vw, 1.5rem);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* 5) Logo responsive */
.navbar-logo img {
  height: clamp(40px, 10vw, 72px);
}

/* 6) Hero: éviter le “trop grand” sur mobile */
.hero {
  min-height: 100dvh; /* mobile safe */
}

.hero-container {
  padding: clamp(1.25rem, 4vw, 4rem) clamp(1rem, 4vw, 2rem);
  gap: clamp(1.5rem, 6vw, 6rem);
}

/* 7) Upload box: padding responsive */
.upload-box {
  padding: clamp(1.25rem, 4vw, 3rem);
  border-radius: 16px;
}

/* 8) Stack d’images: limiter les éléments “en dehors de l’écran” */
.image-stack {
  width: min(360px, 92vw);
}

/* Option: sur très petit écran, on réduit les cartes secondaires (sinon ça déborde) */
@media (max-width: 420px) {
  .card-top,
  .card-bottom {
    display: none;
  }
}

/* 9) Toasts: tenir dans l’écran */
.toast-msg {
  max-width: min(92vw, 400px);
}

/* Ton wrapper inline a max-width:400px, mais on sécurise sur mobile */
@media (max-width: 480px) {
  /* si possible, remplace ton inline style par une classe.
     sinon, on force les contraintes globales ici: */
  .toast-msg {
    font-size: 0.85rem;
    padding: 10px 14px;
    border-radius: 12px;
  }
}

@media (max-width: 768px) {
  .navbar-center {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .navbar-center::-webkit-scrollbar { display: none; }

  .nav-item {
    white-space: nowrap;
    flex: 0 0 auto;
    font-size: 14px;
  }
}