@import url('https://fonts.googleapis.com/css2?family=Gabarito:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   Cognitera — socle de design partagé par toute la plateforme
   Tokens issus du design system Figma (Intégration privée / Desktop - 1).
   Chargé globalement avant les feuilles de style spécifiques à chaque page.
   ========================================================================== */

:root {
    /* Couleurs de marque */
    --cog-navy: #191D36;
    --cog-navy-deep: #111425;
    --cog-navy-soft: #15192E;
    --cog-navy-light: #22284A;
    --cog-ink: #00184B;

    --cog-green: #98EC2B;
    --cog-green-strong: #7FD117;
    --cog-green-dim: rgba(152, 236, 43, 0.14);

    /* Surfaces claires */
    --cog-bg: #F5F6F3;
    --cog-surface: #FFFFFF;
    --cog-surface-alt: #F9F9F9;
    --cog-line: rgba(25, 29, 54, 0.08);
    --cog-muted: #9396A6;

    /* Surfaces sombres */
    --cog-dark-surface: rgba(0, 0, 0, 0.15);
    --cog-dark-surface-strong: rgba(0, 0, 0, 0.28);
    --cog-dark-line: rgba(255, 255, 255, 0.07);
    --cog-on-dark: #FFFFFF;
    --cog-on-dark-soft: rgba(255, 255, 255, 0.75);
    --cog-on-dark-muted: rgba(255, 255, 255, 0.4);

    /* Sémantique */
    --cog-danger: #E5484D;
    --cog-danger-dark: #C93B3F;
    --cog-warning: #F5A524;

    /* Géométrie */
    --cog-radius-hero: 50px;
    --cog-radius-card: 20px;
    --cog-radius-btn: 10px;
    --cog-radius-pill: 999px;

    --cog-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    --cog-shadow-lift: 0 18px 40px rgba(25, 29, 54, 0.14);
    --cog-glow: 0 0 0 4px rgba(152, 236, 43, 0.18);

    --cog-shell: 1290px;

    /* Typographie */
    --cog-font: 'Gabarito', 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* Fond sombre : les écrans de jeu et l'interface joueur.
   À poser sur <body> via la classe .cog-dark (voir layout). */
.cog-dark {
    background: var(--cog-navy);
    color: var(--cog-on-dark);
}

/* --------------------------------------------------------------------------
   Coquille des espaces authentifiés : barre latérale + contenu
   -------------------------------------------------------------------------- */

.cog-app {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    min-height: 100vh;
    background: var(--cog-bg);
}

.cog-app__main {
    min-width: 0;
}

.cog-side {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 26px;
    height: 100vh;
    padding: 26px 18px 22px;
    background: var(--cog-navy);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
}

.cog-side__brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 10px;
    text-decoration: none;
}

.cog-side__brand:hover {
    text-decoration: none;
}

.cog-side__mark {
    width: 26px;
    height: 30px;
    display: block;
}

.cog-side__wordmark {
    width: 94px;
    height: 21px;
    display: block;
}

.cog-side__context {
    margin: -14px 0 0;
    padding: 0 10px;
    font-family: var(--cog-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.5);
    overflow-wrap: anywhere;
}

.cog-side__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cog-side__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--cog-radius-btn);
    font-family: var(--cog-font);
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.68);
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease;
}

.cog-side__link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #FFFFFF;
    text-decoration: none;
}

/* L'entrée courante : fond vert et texte encre, jamais la couleur seule —
   aria-current double l'information pour les lecteurs d'écran. */
.cog-side__link.is-active {
    background: var(--cog-green);
    color: var(--cog-ink);
}

.cog-side__link.is-active:hover {
    background: var(--cog-green-strong);
    color: var(--cog-ink);
}

.cog-side__icon {
    flex-shrink: 0;
}

.cog-side__foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding: 16px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cog-side__user {
    font-family: var(--cog-font);
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    overflow-wrap: anywhere;
}

.cog-side__signout {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: transparent;
    font-family: var(--cog-font);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.cog-side__signout:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.4);
    color: #FFFFFF;
}

/* En dessous de 1000px la colonne devient un bandeau horizontal défilant :
   la navigation reste entièrement atteignable, sans JavaScript. */
@media (max-width: 1000px) {
    .cog-app {
        grid-template-columns: minmax(0, 1fr);
    }

    .cog-side {
        position: static;
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 14px;
        height: auto;
        padding: 12px 16px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        overflow: visible;
    }

    .cog-side__brand {
        padding: 0;
    }

    .cog-side__wordmark,
    .cog-side__context {
        display: none;
    }

    .cog-side__nav {
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .cog-side__nav::-webkit-scrollbar {
        display: none;
    }

    .cog-side__link {
        padding: 9px 13px;
        font-size: 14px;
        white-space: nowrap;
    }

    /* Libellé masqué visuellement mais conservé pour les lecteurs d'écran :
       `display: none` le retirerait de l'arbre d'accessibilité et laisserait
       des liens sans intitulé. */
    .cog-side__link span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    .cog-side__link.is-active span {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip-path: none;
    }

    .cog-side__foot {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        margin: 0;
        padding: 0;
        border-top: none;
    }

    .cog-side__user {
        display: none;
    }

    .cog-side__signout {
        width: auto;
        padding: 9px 14px;
        white-space: nowrap;
    }
}

/* --------------------------------------------------------------------------
   Messages flash — superposés, lisibles sur fond clair comme sur fond sombre
   -------------------------------------------------------------------------- */

.cog-flash {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: calc(100% - 32px);
    max-width: 560px;
    transform: translateX(-50%);
    pointer-events: none;
}

.cog-flash__item {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 14px 20px;
    border-radius: var(--cog-radius-btn);
    font-family: var(--cog-font);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.cog-flash__item::before {
    content: "";
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
}

.cog-flash__item--notice {
    background: var(--cog-green);
    color: var(--cog-ink);
}

.cog-flash__item--notice::before {
    background: var(--cog-ink);
}

.cog-flash__item--alert {
    background: var(--cog-danger);
    color: #FFFFFF;
}

.cog-flash__item--alert::before {
    background: #FFFFFF;
}

@media (max-width: 640px) {
    .cog-flash__item {
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* --------------------------------------------------------------------------
   Filigrane de marque sur les écrans de jeu plein écran
   -------------------------------------------------------------------------- */

.cog-watermark {
    position: fixed;
    right: 28px;
    bottom: 22px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.45;
    pointer-events: none;
}

.cog-watermark img {
    display: block;
}

.cog-watermark__mark {
    width: 20px;
    height: 23px;
}

.cog-watermark__wordmark {
    width: 76px;
    height: 17px;
}

@media (max-width: 768px) {
    .cog-watermark {
        right: 14px;
        bottom: 12px;
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Compteur d'éléments en attente dans la barre latérale */
.cog-side__badge {
    margin-left: auto;
    padding: 2px 8px;
    border-radius: var(--cog-radius-pill);
    background: var(--cog-green);
    font-size: 12px;
    font-weight: 700;
    color: var(--cog-ink);
}

.cog-side__link.is-active .cog-side__badge {
    background: var(--cog-ink);
    color: var(--cog-green);
}
