@font-face {
    font-family: 'vg5000_regularregular';
    src: url('../fonts/vg5000-regular_web-webfont.woff2') format('woff2'),
         url('../fonts/vg5000-regular_web-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'karrikregular';
    src: url('../fonts/karrik-regular-webfont.woff2') format('woff2'),
         url('../fonts/karrik-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", 'karrikregular', sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

.desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Conteneur d'une icône (Dossier ou Fichier) */
.desktop-item {
    position: absolute;
    width: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    touch-action: none;
    z-index: 10;
}

.desktop-item:active {
    cursor: grabbing;
}

/* Zone de l'icône */
.icon-wrapper {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 4px;
    transition: background-color 0.1s ease;
}

.icon-wrapper svg,
.icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.18)) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

/* Texte sous l'icône façon macOS */
.item-label {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.25;
    color: #0b1215;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* État sélectionné (style Finder / Bureau MacBook) */
.desktop-item.selected .icon-wrapper {
    background-color: rgba(0, 0, 0, 0.08);
}

.desktop-item.selected .item-label {
    background-color: #0058d0;
    color: #ffffff;
}

/* --- GLOBE DE DONNÉES "food and h" --- */
.graph-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: auto;
    cursor: grab;
    touch-action: none;
}

.graph-overlay:active {
    cursor: grabbing;
}

.graph-overlay.active {
    display: block;
}

.graph-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.graph-line {
    stroke: #9e9e9e;
    stroke-width: 1px;
    transition: stroke 0.2s ease, stroke-width 0.2s ease;
}

.graph-line.highlighted {
    stroke: #222222;
    stroke-width: 1.8px;
}

.graph-nodes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.graph-node {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
    cursor: pointer;
    touch-action: none;
    will-change: transform, opacity;
}

.graph-node img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    border: 1px solid rgba(140, 140, 140, 0.45);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.graph-node:hover img {
    border-color: #222;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}

.graph-close-btn {
    position: fixed;
    top: 20px;
    right: 28px;
    z-index: 600;
    pointer-events: auto;
    font-family: 'vg5000_regularregular', monospace;
    font-size: 0.95em;
    color: #333;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #999;
    padding: 5px 12px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.graph-close-btn:hover {
    background: #0b1215;
    color: #ffffff;
    border-color: #0b1215;
}

/* Lightbox d'ouverture d'une image du schéma */
.node-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 40px;
}

.node-lightbox.active {
    display: flex;
}

.node-lightbox img {
    max-width: 88vw;
    max-height: 82vh;
    object-fit: contain;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid #ccc;
}

.node-lightbox-caption {
    margin-top: 14px;
    font-family: 'vg5000_regularregular', monospace;
    font-size: 0.9em;
    color: #444;
}

.node-lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-family: 'vg5000_regularregular', monospace;
    font-size: 1em;
    color: #333;
    background: #fff;
    border: 1px solid #999;
    padding: 5px 12px;
    cursor: pointer;
}

.node-lightbox-close:hover {
    background: #0b1215;
    color: #fff;
}
