/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Contenu principal masqué pendant le chargement */
.main-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.main-content.loaded {
    opacity: 1;
    visibility: visible;
}


body {
    font-family: Chicago, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #000000;
    /* Teal classique Mac */
    color: #000;
    min-height: 100vh;
    overflow-x: hidden;
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}


/* Effet CRT sur tout le site */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;

    /* Scanlines */
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 3px);
    animation: scanlines 8s linear infinite;
}

/* Barre de chargement Mac OS 9 pour Three.js */
.mac-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Chicago, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f0f0;
    color: #000;
}

.mac-loading-text {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    user-select: none;
}

.mac-loading-bar {
    width: 200px;
    height: 16px;
    background: #f0f0f0;
    border: 2px solid #000;
    box-shadow:
        inset -2px -2px 0 #999,
        inset 2px 2px 0 #fff,
        1px 1px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.mac-loading-bar-fill {
    height: 100%;
    background: linear-gradient(to bottom, #ffffff 0%, #cccccc 50%, #aaaaaa 100%);
    border-right: 1px solid #999;
    box-shadow: inset -1px -1px 0 #999, inset 1px 1px 0 #fff;
    transition: width 0.3s ease;
    position: relative;
    width: 0%;
}

.mac-loading-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.1) 3px,
        rgba(0, 0, 0, 0.1) 6px
    );
    animation: loading-stripes 1s linear infinite;
}

@keyframes loading-stripes {
    0% { transform: translateX(-12px); }
    100% { transform: translateX(0); }
}

.mac-loading-percent {
    font-size: 11px;
    color: #666;
    margin-top: 8px;
    font-family: Chicago, -apple-system, sans-serif;
    user-select: none;
}

/* Effet de pixels/phosphore */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;

    background-image:
        repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 3px,
            transparent 3px,
            transparent 6px);
    background-size: 6px 6px;
    opacity: 0.4;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(10px);
    }
}


.noselect {
    -webkit-touch-callout: none;
    /* iOS Safari */
    -webkit-user-select: none;
    /* Safari */
    -khtml-user-select: none;
    /* Konqueror HTML */
    -moz-user-select: none;
    /* Old versions of Firefox */
    -ms-user-select: none;
    /* Internet Explorer/Edge */
    user-select: none;
    /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

/* Barre de menu Mac OS 9 - Version bas d'écran */
.menu-bar {
    background: linear-gradient(to bottom, #ffffff 0%, #d6d6d6 100%);
    border-bottom: 2px solid #000;
    height: 42px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    font-size: 13px;
    font-weight: bold;
}

/* Bouton menu mobile (caché sur desktop) */
.mobile-menu-toggle {
    display: none;
}


.apple-menu {
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid #999;
    cursor: pointer;
    background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
}

.apple-menu:hover {
    background: linear-gradient(to bottom, #e0e0e0 0%, #d0d0d0 100%);
}


/* Styles pour le menu Apple */
.apple-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.apple-menu.active {
    background: linear-gradient(to bottom, #333333 0%, #000000 100%);
    color: #fff;
}

/* Menu déroulant Apple */
.apple-menu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 240px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
    border: 3px solid #000;
    border-radius: 0 8px 8px 8px;
    z-index: 1001;
    box-shadow:
        8px 8px 0 rgba(0, 0, 0, 0.5),
        inset -2px -2px 0 #999,
        inset 2px 2px 0 #fff,
        inset -1px -1px 0 #ccc,
        inset 1px 1px 0 #f5f5f5;
    font-family: Chicago, -apple-system, sans-serif;
    display: none;
    animation: appleMenuAppear 0.2s ease-out;
}

.apple-menu-dropdown.active {
    display: block;
}

/* Animation d'apparition */
@keyframes appleMenuAppear {
    0% {
        transform: translateY(-10px) scale(0.95);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Items du menu Apple */
.apple-menu-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid rgba(153, 153, 153, 0.3);
    background: transparent;
    position: relative;
    transition: all 0.1s ease;
    user-select: none;
    display: flex;
    align-items: center;
}

.apple-menu-item:hover {
    background: linear-gradient(to right, #000000 0%, #333333 100%);
    color: #fff;
    box-shadow: inset 1px 1px 0 #444;
}

.apple-menu-item:active {
    background: linear-gradient(to right, #333333 0%, #000000 100%);
    transform: translateX(1px);
}

.apple-menu-item:last-child {
    border-bottom: none;
    border-radius: 0 0 5px 5px;
}

.apple-menu-item:first-child {
    border-radius: 5px 5px 0 0;
}

/* Icônes et labels */
.apple-menu-icon {
    display: inline-block;
    width: 20px;
    margin-right: 10px;
    text-align: center;
    font-size: 14px;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.2));
}

.apple-menu-label {
    flex: 1;
    font-weight: normal;
}

/* Séparateurs */
.apple-menu-separator {
    height: 1px;
    background: linear-gradient(to right,
            transparent 0%,
            #999 10%,
            #999 90%,
            transparent 100%);
    margin: 5px 10px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Effet spécial pour certains items */
.apple-menu-item[data-action="shutdown"]:hover {
    background: linear-gradient(to right, #d73527 0%, #a02622 100%);
    color: #fff;
}

.apple-menu-item[data-action="restart"]:hover {
    background: linear-gradient(to right, #ff9500 0%, #cc7700 100%);
    color: #fff;
}

/* Version mobile du menu Apple */
@media (max-width: 768px) {
    .apple-menu-dropdown {
        width: 220px;
        right: 0;
        left: auto;
    }

    .apple-menu-item {
        padding: 12px 15px;
        font-size: 14px;
    }

    .apple-menu-icon {
        font-size: 16px;
        margin-right: 12px;
    }
}

/* Classe pour désactiver l'effet CRT */
body.no-crt::before,
body.no-crt::after {
    display: none !important;
}

body.no-crt .desktop {
    animation: none !important;
}

.apple-logo {
    width: 14px;
    height: 16px;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTcuNSAyQzcuNSAwLjUgOSAwIDEwIDBDMTAgMSA5LjUgMi41IDguNSAyLjVDNy41IDIuNSA3LjUgMiA3LjUgMloiIGZpbGw9ImJsYWNrIi8+CjxwYXRoIGQ9Ik03IDF2Mi41YzAtMC41LTAuNS0xLTEtMUg0Yy0yIDAtMy41IDEuNS0zLjUgMy41djVjMCAyIDEuNSAzLjUgMy41IDMuNWgzYzIgMCAzLjUtMS41IDMuNS0zLjVWNmMwLTItMS41LTMuNS0zLjUtMy41SDF0MCAwIiBmaWxsPSJibGFjayIvPgo8L3N2Zz4=') no-repeat center;
    background-size: contain;
}

/* Menus de navigation */
.menu-items {
    display: flex;
    flex: 1;
    height: 100%;
}

.menu-item {
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    transition: background 0.1s;
}

.menu-item:hover {
    background: rgba(0, 0, 0, 0.1);
}

.menu-item.active {
    background: #4e4e4e;
    color: #fff;
}

/* Horloge système */
.system-clock {
    padding: 0 15px;
    font-size: 12px;
    border-left: 1px solid #999;
}

html,
body {
    touch-action: manipulation;
    overscroll-behavior: none;
}

/* Bureau */
.desktop {
    padding-top: 42px;
    padding-bottom: 0;
    min-height: 100vh;
    position: relative;
    touch-action: none;
    overscroll-behavior: none;
}

/* Pseudo-élément pour le background avec filtre */
.desktop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    /* ← Utilise la variable CSS */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.75) saturate(0.8);
    z-index: -1;
}

/* Fenêtre Mac OS 9 */
.window {
    position: absolute;
    background: #dddddd;
    border: 2px solid #000;
    border-radius: 8px 8px 0 0;
    box-shadow:
        10px 10px 0 rgba(0, 0, 0, 0.5),
        inset -1px -1px 0 #999,
        inset 1px 1px 0 #fff;
    min-width: 400px;
    animation: windowOpen 0.3s ease-out;
    overflow: hidden;

    /* Remplacez height: 500px par : */
    min-height: 200px;
    max-height: 80vh;
    /* Limite à 80% de la hauteur d'écran */

    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* Supprimez les anciens indicateurs de .window et remplacez par : */
.window-content::before,
.window-content::after {
    content: '';
    position: sticky;
    left: 0;
    right: 0;
    height: 15px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.window-content::before {
    top: 0;
    background: linear-gradient(to bottom,
            rgba(240, 240, 240, 0.95) 0%,
            rgba(240, 240, 240, 0.8) 30%,
            rgba(240, 240, 240, 0.4) 70%,
            transparent 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.window-content::after {
    bottom: 0;
    background: linear-gradient(to top,
            rgba(240, 240, 240, 0.95) 0%,
            rgba(240, 240, 240, 0.8) 30%,
            rgba(240, 240, 240, 0.4) 70%,
            transparent 100%);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
}

/* Classes pour activer les indicateurs */
.window-content.has-content-above::before {
    opacity: 1;
}

.window-content.has-content-below::after {
    opacity: 1;
}

.window-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border: 2px solid #999;
    /* Bordure plus épaisse aussi */
    border-radius: 0;
}

.window-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #ffffff 0%, #cccccc 100%);
    border: 2px solid #000;
    /* Bordure thumb plus épaisse */
    border-radius: 0;
    box-shadow: inset -2px -2px 0 #999, inset 2px 2px 0 #fff;
    min-height: 30px;
    /* Thumb plus haut aussi */
}

.window-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to right, #f0f0f0 0%, #b0b0b0 100%);
}

.window-content::-webkit-scrollbar-thumb:active {
    background: linear-gradient(to right, #e0e0e0 0%, #a0a0a0 100%);
}

/* Contenu de fenêtre */
.window-content {
    padding: 20px;
    background: #f0f0f0;
    height: 100%;
    overflow-y: auto;
    /* Toujours auto pour gérer l'overflow */
    -webkit-overflow-scrolling: touch;
    /* Smooth scroll sur iOS */

    /* Styliser les scrollbars natives pour ressembler à Mac OS 9 */
    scrollbar-width: thick;
    scrollbar-color: #666666 #cccccc;
}


.window-content::-webkit-scrollbar {
    width: 32px;
    background: #f0f0f0;
}

/* Classe pour activer le scroll quand nécessaire */
.window-content.needs-scroll {
    overflow-y: auto;
    /* Activé seulement si besoin */
}

.window-content-wrapper {
    position: relative;
    flex: 1;
    overflow: hidden;
    margin: 8px;
    border: 1px solid #999;
    /* Plus de gestion complexe - juste un container simple */
}

.window-content-wrapper::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Afficher l'indicateur quand le contenu est scrollable */
.window-content-wrapper.has-scroll::after {
    opacity: 1;
}

/* Version plus visible pour debug */
.window-content-wrapper::after {
    background: rgba(0, 0, 0, 0.3);
    /* Plus visible */
    width: 6px;
}


@keyframes windowOpen {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Barre de titre */
.window-header {
    background: linear-gradient(to bottom, #ffffff 0%, #cccccc 100%);
    border-bottom: 2px solid #000;
    height: 26px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: move;
    border-radius: 6px 6px 0 0;
    /* Légèrement plus petit que .window */
    /* Supprimé le border-radius répété */
}

.window-header.active {
    background: linear-gradient(to bottom, #b5b5b5 0%, #909090 100%);
}

/* Boutons de fenêtre */
.window-controls {
    display: flex;
    gap: 8px;
    margin-right: 8px;
}

.window-button {
    width: 12px;
    height: 12px;
    border: 1px solid #000;
    background: #fff;
    border-radius: 100%;
    cursor: pointer;
    position: relative;
}

.window-button.close {
    background: #ff6b6b;
}

.window-button.minimize {
    background: #ffeb3b;
}

.window-button.maximize {
    background: #c1c1c1;
}

.window-button:hover {
    filter: brightness(0.9);
}

/* Titre de fenêtre */
.window-title {
    flex: 1;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    /* Supprimé complètement le border-radius d'ici */
    user-select: none;
}

/* Style de la scrollbar pour Mac OS 9 (déjà défini globalement mais pour être sûr) */
.window::-webkit-scrollbar {
    width: 16px;
}

.window::-webkit-scrollbar-track {
    background: #f0f0f0;
    border: 1px solid #999;
}

.window::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #ffffff 0%, #cccccc 100%);
    border: 1px solid #000;
    box-shadow: inset -1px -1px 0 #999, inset 1px 1px 0 #fff;
}

body.dragging-window {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Styles spécifiques au portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
}


.portfolio-item {
    background: #fff;
    border: 2px solid #000;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.portfolio-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.portfolio-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border: 1px solid #999;
    image-rendering: auto;
}

.portfolio-item h3 {
    margin: 10px 0 5px;
    font-size: 14px;
}

.portfolio-item p {
    font-size: 11px;
    color: #666;
}

/* Icônes de bureau */
.desktop-icon {
    position: relative;
    width: 100px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.desktop-icon:hover .icon-image {
    filter: brightness(1.2);
}

.icon-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    filter: drop-shadow(1px 1px 3px rgba(0, 0, 0, 0.61));
}

.icon-label {
    font-size: 11.5px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 10px;
    border: 1px solid transparent;
}

.desktop-icon.selected .icon-label {
    background: #000;
    color: #fff;
    border: 1px dotted #fff;
}

@media (min-width: 769px) {
    .tooltip {
        position: fixed;
        background: linear-gradient(to bottom, #ffffccb7 0%, #fffacdba 100%);
        border: 2px solid #000;
        padding: 6px 8px;
        font-size: 11px;
        font-weight: bold;
        white-space: normal;
        max-width: 200px;
        line-height: 1.2;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: none;
        box-shadow:
            2px 2px 0 rgba(0, 0, 0, 0.5),
            inset -1px -1px 0 #ddd,
            inset 1px 1px 0 #fff;
        pointer-events: none;
        font-family: Chicago, -apple-system, sans-serif;
        word-wrap: break-word;
        text-align: left;
    }

    .desktop-icon.tooltip-disabled .tooltip {
        opacity: 0 !important;
        visibility: hidden !important;
        transition: none !important;
    }

    body.dragging-active .desktop-icon .tooltip {
        opacity: 0 !important;
        visibility: hidden !important;
        transition: none !important;
    }
}

/* Boutons style Mac OS 9 */
.mac-button {
    background: linear-gradient(to bottom, #ffffff 0%, #cccccc 100%);
    border: 2px solid #000;
    padding: 4px 16px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow:
        1px 1px 0 rgba(0, 0, 0, 0.3),
        inset -1px -1px 0 #999,
        inset 1px 1px 0 #fff;
    user-select: none;
}

.mac-button:hover {
    background: linear-gradient(to bottom, #f0f0f0 0%, #c0c0c0 100%);
}

.mac-button:active {
    background: linear-gradient(to bottom, #cccccc 0%, #ffffff 100%);
    box-shadow:
        inset 1px 1px 0 #999,
        inset -1px -1px 0 #fff;
}

/* Barre de défilement style Mac */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
    border: 1px solid #999;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to right, #ffffff 0%, #cccccc 100%);
    border: 1px solid #000;
    box-shadow: inset -1px -1px 0 #999, inset 1px 1px 0 #fff;
}

/* Effet de flicker CRT */
@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    94% {
        opacity: 0.975;
    }
}

.desktop {
    animation: flicker .3s infinite;
}

#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    /* Empêche le scroll */
    touch-action: none;
    /* Empêche le scroll tactile par défaut */
}

/* Alert box Mac */
.alert-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dddddd;
    border: 3px solid #000;
    padding: 20px;
    min-width: 300px;
    z-index: 2000;
    box-shadow:
        3px 3px 0 rgba(0, 0, 0, 0.5),
        inset -2px -2px 0 #999,
        inset 2px 2px 0 #fff;
    display: none;
}

/* Conteneurs de bureau */
.desktop-content {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.desktop-content.active {
    display: block;
}

/* Corbeille toujours visible */
.trash-icon .icon-image {
    width: 80px;
    /* ← Changer de 48px à 80px */
    height: 80px;
    /* ← Changer de 48px à 80px */
    margin: 0 auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    filter: drop-shadow(1px 1px 3px rgba(255, 255, 255, 0.61));
}

.trash-icon {
    width: 100px;
    /* ← Même largeur que les autres icônes */
    text-align: center;
    cursor: pointer;
    user-select: none;
    z-index: 50;
}

.trash-icon .icon-label {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
}

/* Effet hover sur corbeille */
.trash-icon.drag-over .icon-image {
    background: #ff6b6b;
    transform: scale(1.1);
}

/* Icône en cours de drag */
.desktop-icon.dragging {
    opacity: 0.5;
    cursor: move;
}

.alert-icon {
    width: 32px;
    height: 32px;
    background: #ffeb3b;
    border: 2px solid #000;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    line-height: 28px;
    font-weight: bold;
    margin-right: 10px;
}

.mobile-menu {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 15px;
    width: 220px;
    background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
    border: 3px solid #000;
    border-radius: 8px;
    z-index: 999;
    box-shadow:
        8px 8px 0 rgba(0, 0, 0, 0.8),
        inset -2px -2px 0 #999,
        inset 2px 2px 0 #fff,
        inset -1px -1px 0 #ccc,
        inset 1px 1px 0 #f5f5f5;
    font-family: Chicago, -apple-system, sans-serif;
}

/* Flèche vintage avec bordure */
.mobile-menu::before {
    content: '';
    position: absolute;
    bottom: -11px;
    right: 25px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #000;
    z-index: 1;
}

.mobile-menu::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 27px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #f0f0f0;
    z-index: 2;
}

.mobile-menu-item {
    padding: 10px 20px 10px 35px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 1px solid #999;
    background: transparent;
    position: relative;
    transition: all 0.15s ease;
    user-select: none;
}

.mobile-menu-item::before {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.3));
}

.mobile-menu-item:hover {
    background: linear-gradient(to right, #000000 0%, #333333 100%);
    color: #fff;
    box-shadow: inset 1px 1px 0 #444;
}

.mobile-menu-item:active {
    background: linear-gradient(to right, #333333 0%, #000000 100%);
    transform: translateX(1px);
}

.mobile-menu-item:last-child {
    border-bottom: none;
    border-radius: 0 0 5px 5px;
}

.mobile-menu-item:first-child {
    border-radius: 5px 5px 0 0;
}

/* Animation d'apparition vintage avec rebond */
.mobile-menu.active {
    display: block;
    animation: vintageMenuAppear 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Styles pour la fenêtre terminal customisée */
.terminal-window {
    background: #1e1e1e;
    border: 1px solid #333333;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.terminal-window-header {
    background: linear-gradient(to bottom, #3c3c3c 0%, #2d2d2d 100%);
    border-bottom: 1px solid #1a1a1a;
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: move;
    position: relative;
}

.terminal-window-controls {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    border: 0.5px solid rgba(0, 0, 0, 0.3);
}

.terminal-button.close {
    background: linear-gradient(135deg, #ff5f57 0%, #ff4945 100%);
}


.terminal-button:hover {
    filter: brightness(1.1);
}

.terminal-button.close:hover::after {
    content: '×';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: #8b0000;
    font-weight: bold;
}


.terminal-window-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Container terminal sans l'ancien header */
.terminal-window .terminal-container {
    background: #1e1e1e;
    color: #ffffff;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    height: 418px;
    /* 450px total - 32px header */
    display: flex;
    flex-direction: column;
}

/* Supprimer l'ancien header interne */
.terminal-window .terminal-header {
    display: none;
}

.terminal-window .terminal-output {
    flex: 1;
    padding: 12px 16px;
    overflow-y: auto;
    background: #1e1e1e;
    scrollbar-width: thin;
    scrollbar-color: #444444 #1e1e1e;
}

.terminal-window .terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-window .terminal-output::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.terminal-window .terminal-output::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 4px;
}

.terminal-window .terminal-output::-webkit-scrollbar-thumb:hover {
    background: #555555;
}

.terminal-window .terminal-line {
    margin-bottom: 3px;
    word-wrap: break-word;
}

.terminal-window .terminal-prompt {
    color: #50fa7b;
    user-select: none;
}

.terminal-window .terminal-command {
    color: #f8f8f2;
}

.terminal-window .terminal-output-text {
    color: #f8f8f2;
    white-space: pre-wrap;
}

.terminal-window .terminal-info {
    color: #6272a4;
    user-select: none;
}

.terminal-window .terminal-text {
    color: #8be9fd;
}

.terminal-window .terminal-input-line {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #1e1e1e;
    border-top: 1px solid #404040;
}

.terminal-window .terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f8f8f2;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    margin-left: 4px;
}

.terminal-window .terminal-input::placeholder {
    color: #6272a4;
}

.terminal-window .terminal-input::selection {
    background: rgba(80, 250, 123, 0.3);
}

/* Animation d'ouverture pour le terminal */
.terminal-window {
    animation: terminalOpen 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes terminalOpen {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes vintageMenuAppear {
    0% {
        transform: translateY(30px) scale(0.8);
        opacity: 0;
        filter: blur(2px);
    }

    50% {
        transform: translateY(-5px) scale(1.02);
        opacity: 0.8;
        filter: blur(1px);
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
        filter: blur(0);
    }
}


@keyframes vintageShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Effet sonore visuel sur le clic */
.mobile-menu-item:active::before {
    animation: iconBounce 0.2s ease;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.2);
    }
}

/* Cacher les éléments desktop sur mobile */
.mobile-tabs {
    display: none;
}

.mobile-app-container {
    display: none;
}

/* Styles pour le contenu des projets (version améliorée) */
.project-content {
    line-height: 1.4;
    font-size: 13px;
}

.project-content h1 {
    font-size: 16px;
    margin: 15px 0 10px 0;
    border-bottom: 1px solid #999;
    padding-bottom: 5px;
}

.project-content h2 {
    font-size: 15px;
    margin: 12px 0 8px 0;
}

.project-content h3 {
    font-size: 14px;
    margin: 10px 0 6px 0;
}

.project-content p {
    margin: 8px 0;
}

.project-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.project-content li {
    margin: 3px 0;
    list-style-type: disc;
}

.project-content a {
    color: #0066cc;
    text-decoration: underline;
}

.project-content img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #999;
    margin: 10px 0;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.project-content strong {
    font-weight: bold;
}

.trash-icon.drag-over {
    opacity: 0.7 !important;
    transform: scale(1.1) !important;
    transition: all 0.2s ease;
}

/* Interface mobile en mode application */
@media (max-width: 768px) {
    .mobile-app-container {
        display: block;
        padding: 0;
    }

    .window.main-window {
        border-top: none;
        margin-bottom: 0;
    }

    /* Barre d'onglets mobile */
    .mobile-tabs {
        display: flex;
        background: #e0e0e0;
        border-bottom: 2px solid #000;
        position: sticky;
        bottom: 48px;
        z-index: 100;
    }

    .mobile-tab {
        flex: 1;
        padding: 12px;
        text-align: center;
        font-size: 12px;
        font-weight: bold;
        border-right: 1px solid #999;
        cursor: pointer;
        background: linear-gradient(to bottom, #f0f0f0 0%, #e0e0e0 100%);
    }

    .mobile-tab:last-child {
        border-right: none;
    }

    .mobile-tab.active {
        background: #fff;
        border-bottom: 2px solid #fff;
        margin-bottom: -2px;
    }

    .window {
        min-width: unset !important;
        /* ← Supprime la largeur minimale sur mobile */
        width: calc(100vw - 20px) !important;
        /* ← Force la largeur calculée */
        max-width: calc(100vw - 20px) !important;
        /* ← Empêche de dépasser */
    }

    h1 {
        font-size: 20px !important;
    }

    .mac-button {
        width: 100%;
        margin: 5px 0;
    }

    .alert-box {
        width: 90%;
        min-width: unset;
    }

    .trash-icon {
        display: block !important;
        /* SUPPRIMER aussi la position fixe mobile */
        /* bottom: 120px !important; */
    }

    .desktop-icon {
        display: block;
        /* Ajoutez d'autres styles pour adapter l'apparence sur mobile */
        /* Ajoutez d'autres propriétés CSS selon vos besoins */
    }

    .menu-bar {
        height: 48px;
        padding: 0;
        display: flex;
        bottom: 0;
        /* Reste en bas sur mobile */
        top: auto;
        /* Annule le top: 0 du desktop */
    }

    /* Ajustement pour éviter le conflit avec les boutons du navigateur mobile */
    .desktop {
        padding-top: 0;
        /* Annule le padding-top du desktop */
        padding-bottom: 60px;
        /* Remet le padding-bottom pour mobile */
    }

    .menu-items {
        display: none !important;
    }

    .system-clock {
        /* L'heure reste à droite */
        order: 3;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        padding: 0 15px;
        height: 100%;
        cursor: pointer;
        font-size: 20px;
        color: #000;
        order: 2;
        /* ← Place le menu entre MS et l'heure */
        flex: 1;
        /* ← Prend l'espace restant */
        justify-content: center;
        /* ← Centre le hamburger */
    }

    body {
        background-color: #c0c0c0;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    /* Version CRT allégée pour mobile */
    body::before {
        display: block;
        /* Scanlines plus légères sur mobile */
        background: repeating-linear-gradient(0deg,
                transparent,
                transparent 3px,
                rgba(0, 0, 0, 0.05) 3px,
                rgba(0, 0, 0, 0.05) 4px);
        animation: scanlines 12s linear infinite;
    }

    body::after {
        display: block;
        /* Effet pixels réduit pour mobile */
        background-image:
            repeating-linear-gradient(90deg,
                rgba(255, 255, 255, 0.02) 0px,
                rgba(255, 255, 255, 0.02) 4px,
                transparent 4px,
                transparent 8px);
        opacity: 0.2;
    }

    .menu-bar {
        height: 48px;
        padding: 0;
        display: flex;
        /* ← Structure explicite */
        bottom: 0;
    }

    .menu-items {
        display: none !important;
    }

    .system-clock {
        /* L'heure reste à droite */
        order: 3;
    }

    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        padding: 0 15px;
        height: 100%;
        cursor: pointer;
        font-size: 20px;
        color: #000;
        order: 2;
        /* ← Place le menu entre MS et l'heure */
        flex: 1;
        /* ← Prend l'espace restant */
        justify-content: center;
        /* ← Centre le hamburger */
    }

    .tooltip {
        bottom: auto;
        top: -35px;
        font-size: 12px;
        padding: 6px 10px;
    }


    body {
        background-color: #c0c0c0;
    }

    .terminal-window.keyboard-active {
        height: 50vh !important;
        top: 10px !important;
        transition: height 0.3s ease, top 0.3s ease;
    }

    .terminal-window.keyboard-active .terminal-container {
        height: calc(50vh - 32px) !important;
    }

    .terminal-window.keyboard-active .terminal-output {
        max-height: calc(50vh - 80px) !important;
    }

    /* Repositionner le menu Apple dropdown pour mobile */
    .apple-menu-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 48px !important;
        /* Hauteur de la menu-bar mobile */
        left: 0 !important;
        right: auto !important;
        width: 240px;
        /* Garder les autres styles existants */
        background: linear-gradient(to bottom, #ffffff 0%, #f0f0f0 50%, #e0e0e0 100%);
        border: 3px solid #000;
        border-radius: 8px 8px 0 8px;
        /* Modifier le border-radius pour le bas */
        z-index: 1001;
        box-shadow:
            8px -8px 0 rgba(0, 0, 0, 0.5),
            /* Ombre vers le haut */
            inset -2px -2px 0 #999,
            inset 2px 2px 0 #fff,
            inset -1px -1px 0 #ccc,
            inset 1px 1px 0 #f5f5f5;
        font-family: Chicago, -apple-system, sans-serif;
        display: none;
        animation: appleMenuAppearMobile 0.2s ease-out;
    }

    /* Animation spécifique pour mobile (depuis le bas) */
    @keyframes appleMenuAppearMobile {
        0% {
            transform: translateY(10px) scale(0.95);
            opacity: 0;
        }

        100% {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    /* Ajuster les items pour mobile si nécessaire */
    .apple-menu-item {
        padding: 12px 15px;
        font-size: 14px;
    }

    .apple-menu-icon {
        font-size: 16px;
        margin-right: 12px;
    }



    .window-content::-webkit-scrollbar {
        width: 20px;
        /* Plus fin sur mobile */
    }

    .window-content {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        /* Important pour Safari iOS */
    }

    .terminal-window {
        width: calc(100vw - 20px) !important;
        left: 10px !important;
        top: 60px !important;
        transition: height 0.3s ease, top 0.3s ease;
    }

    .terminal-window.keyboard-active {
        /* Dimensions calculées en JS pour 50% de l'écran */
        transition: height 0.3s ease, top 0.3s ease;
    }

    .terminal-window .terminal-container {
        transition: height 0.3s ease;
    }

    /* S'assurer que l'input reste visible */
    .terminal-window .terminal-input-line {
        position: sticky;
        bottom: 0;
        background: #1e1e1e;
        z-index: 10;
        border-top: 1px solid #404040;
    }

    /* Zone de contenu scrollable */
    .terminal-window .terminal-output {
        flex: 1;
        overflow-y: auto;
        padding-bottom: 10px;
        scroll-behavior: smooth;
    }
}

/* Empêcher le scroll sur iPad/tablettes */
@media (max-width: 1024px) {
    #desktop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        touch-action: none;
    }

    body {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        touch-action: none;
    }

    /* Permettre le scroll SEULEMENT dans les fenêtres */
    .window-content {
        touch-action: auto;
        overflow-y: auto;
    }
}

/* Style pour forcer le scroll en bas quand le clavier apparaît */
.terminal-window .terminal-output.auto-scroll {
    scroll-behavior: smooth;
}

/* Context Menu Styles */
.context-menu {
    position: fixed;
    min-width: 120px;
    background: #f0f0f0;
    border: 2px solid #000;
    box-shadow: inset -1px -1px 0 #999, inset 1px 1px 0 #fff, 2px 2px 5px rgba(0,0,0,0.3);
    z-index: 10000;
    font-family: Chicago, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 12px;
    user-select: none;
}

.context-menu-item {
    padding: 4px 12px;
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    display: block;
    width: 100%;
    transition: background-color 0.1s ease;
}

.context-menu-item:hover {
    background: #000;
    color: #fff;
}

.context-menu-item:active {
    background: #333;
    color: #fff;
}

.context-menu-separator {
    height: 1px;
    background: #999;
    margin: 2px 8px;
    box-shadow: 0 1px 0 #fff;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .context-menu {
        font-size: 14px;
        min-width: 140px;
    }
    
    .context-menu-item {
        padding: 8px 16px;
    }
}
