:root {
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --accent-color: #00d4ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
}

#desktop {
    width: 100%;
    height: 100%;
    background-color: #000; 
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism utility */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Menu Bar */
#menu-bar {
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    z-index: 10000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-left, .menu-right {
    display: flex;
    align-items: center;
}

.menu-trigger {
    padding: 0 10px;
    height: 30px;
    display: flex;
    align-items: center;
    cursor: default;
    border-radius: 4px;
    transition: background 0.1s;
}

.menu-trigger:hover, .menu-trigger.active {
    background: rgba(255, 255, 255, 0.2);
}

.app-name {
    font-weight: 800;
}

/* Dropdown Menus */
.dropdown-menu {
    position: absolute;
    top: 32px;
    min-width: 220px;
    padding: 5px;
    border-radius: 8px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    animation: menuFadeIn 0.15s ease-out;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu.hidden {
    display: none;
}

#apple-menu { left: 5px; }
#finder-menu { left: 40px; }
#file-menu { left: 105px; }
#edit-menu { left: 165px; }
#go-menu { left: 230px; }

#wifi-menu { right: 120px; }
#battery-menu { right: 80px; }
#search-menu { right: 50px; }
#clock-menu { right: 5px; }

.dropdown-menu .menu-item {
    padding: 4px 12px;
    border-radius: 5px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-menu .menu-item:hover:not(.header):not(.sub) {
    background: var(--accent-color);
}

.dropdown-menu .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 8px;
}

.dropdown-menu .header {
    font-weight: 700;
    opacity: 0.9;
    font-size: 11px;
    text-transform: uppercase;
}

.shortcut {
    opacity: 0.4;
    font-size: 11px;
    margin-left: 20px;
}

.dropdown-menu .sub {
    font-size: 12px;
    opacity: 0.6;
}

.small-icon {
    width: 14px;
    height: 14px;
}

.menu-right .menu-trigger i {
    width: 16px;
    height: 16px;
}

/* Spotlight Customization */
.spotlight-input {
    min-width: 350px;
    padding: 10px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
}

.search-container input {
    background: transparent;
    border: none;
    outline: none;
    color: white;
    width: 100%;
    font-size: 16px;
}

/* Windows */
.window {
    position: absolute;
    min-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
}

.window.hidden {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    pointer-events: none;
}

.window-header {
    height: 38px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: move;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.window-title {
    flex: 1;
    text-align: center;
    color: white;
    font-size: 13px;
    font-weight: 600;
    margin-right: 50px; /* Offset for traffic lights */
}

.traffic-lights {
    display: flex;
    gap: 8px;
}

.traffic-lights span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
}

.close { background: #ff5f57; }
.minimize { background: #febc2e; }
.maximize { background: #28c840; }

.window-content {
    flex: 1;
    padding: 20px;
    color: white;
}

/* About Me Content */
.profile-info {
    text-align: center;
}

.avatar-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    
    /* Changement pour l'effet Liquid Glass */
    padding: 6px; /* Anneau un peu plus épais pour apprécier l'effet */
    
    /* Fond vitreux */
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.5), 
        rgba(255, 255, 255, 0.1)
    );
    
    /* Flou et bordures pour le réalisme */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    
    /* Ombres complexes : une portée externe + un reflet interne */
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.2), 
        inset 0 2px 5px rgba(255, 255, 255, 0.8),
        inset 0 -2px 5px rgba(0, 0, 0, 0.05);
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
}

.bio {
    font-size: 14px;
    opacity: 0.8;
    margin: 10px 0;
    line-height: 1.4;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.stats div span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.6;
}

/* Music Player Content */
.player-controls {
    text-align: center;
    margin-top: 15px;
}

.open-link-btn {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.open-link-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.open-link-btn:active {
    transform: scale(0.98);
}

.link-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.link-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 5px;
}

.link-content p {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 5px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 15px 0;
    position: relative;
}

.progress {
    width: 40%;
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
}

.buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.play-btn {
    transform: scale(1.5);
}

/* Desktop Icons */
#desktop-grid {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-end;
}

.desktop-icon {
    width: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
    cursor: pointer;
}

.desktop-icon img {
    width: 60px;
    height: 60px;
    margin-bottom: 5px;
}

.desktop-icon span {
    font-size: 12px;
    text-align: center;
}

/* Dock */
#dock-container {
    position: absolute;
    bottom: 10px;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 10px;
    z-index: 2000;
}

#dock {
    display: flex;
    align-items: flex-end;
    padding: 8px;
    border-radius: 20px;
    gap: 10px;
    height: 64px;
}

.dock-item {
    width: 50px; /* Taille par défaut */
    height: 50px;
    margin: 0;   /* Marge gérée proprement */
    
    /* On sépare les transitions pour une fluidité maximale */
    /* Transform = effet de rebond au survol */
    /* Width/Margin/Opacity = effet d'ouverture/fermeture fluide */
    transition: 
        transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        width 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        margin 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.3s ease;
        
    cursor: pointer;
    position: relative;
    flex-shrink: 0; /* Empêche l'écrasement */
}

.dock-item:hover {
    transform: scale(1.4) translateY(-10px);
}

.dock-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.dock-divider {
    width: 1px;
    height: 80%;
    background: rgba(255,255,255,0.2);
    align-self: center;
    margin: 0 5px;
    
    /* Animation fluide de l'apparition du trait */
    transition: 
        width 0.3s ease, 
        margin 0.3s ease, 
        opacity 0.3s ease;
}


.dock-hidden {
    width: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden;
    pointer-events: none;
    border: none;
}

.dock-item::after {
    content: attr(data-title);
    position: absolute;
    bottom: 140%; /* Position un peu plus haute */
    left: 50%;
    
    /* Effet Liquid Glass */
    background: linear-gradient(
        135deg, 
        rgba(255, 255, 255, 0.25), 
        rgba(255, 255, 255, 0.05)
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    
    /* Bordures et reflets */
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.2), /* Ombre portée douce */
        inset 0 1px 0 0 rgba(255, 255, 255, 0.3), /* Reflet supérieur */
        inset 0 -1px 20px rgba(255, 255, 255, 0.05); /* Lueur interne */
    
    /* Typographie */
    color: rgba(255, 255, 255, 0.95);
    padding: 6px 12px;
    border-radius: 99px; /* Forme de pilule parfaite */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 9px; /* Petit car il sera grossi par le zoom de l'icône */
    font-weight: 500;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    white-space: nowrap;
    
    /* Animation fluide */
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.8); /* Départ légèrement plus petit */
    transform-origin: bottom center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.dock-item:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    bottom: 125%; /* Petite animation de descente/montée */
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .hide-mobile { display: none; }
    #dock-container {
        bottom: 200px;
    }
    #dock {
        height: 58px;
        gap: 5px;
        padding: 6px;
    }
    .dock-item {
        width: 42px;
        height: 42px;
    }
    .window {
        width: 90% !important;
        left: 5% !important;
        top: 60px !important;
    }
    .desktop-icon {
        width: 60px;
    }
    .desktop-icon img {
        width: 50px;
        height: 50px;
    }
}

/* MacOS 26 Alert System */
#macos-alert-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Fond sombre très léger */
    backdrop-filter: blur(8px);      /* Flou sur tout l'arrière-plan */
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#macos-alert-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#macos-alert-box {
    width: 320px;
    padding: 30px;
    border-radius: 28px;
    text-align: center;
    
    /* Effet Liquid Glass avancé */
    background: linear-gradient(145deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.3),
        inset 0 1px 0 rgba(255,255,255,0.4);
    
    /* Animation d'entrée */
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

#macos-alert-overlay.visible #macos-alert-box {
    transform: scale(1);
}

.alert-icon {
    width: 60px; 
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #ffffff, #d4d4d4);
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    color: #333;
}

#alert-title {
    font-size: 18px;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#alert-message {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 25px;
    line-height: 1.5;
}

.alert-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    background: #fff;
}

.alert-btn:active {
    transform: scale(0.96);
}



/* Réduction spécifique WiFi et Search */
[data-menu="wifi-menu"] svg, 
[data-menu="search-menu"] svg {
    width: 16px !important;
    height: 16px !important;
}

[data-menu="battery-menu"] svg {
    width: 22px !important;
    height: 22px !important;
}


/* Logo MCL - Style MacOS 26 / Liquid Metal */
/* Nouveau style pour le logo image */
.mcl-logo-img {
    height: 18px; /* Ajusté pour la barre de menu de 30px */
    width: auto;
    display: block;
    transition: transform 0.2s ease, filter 0.2s ease;
    /* Optionnel : ajoute une légère ombre portée comme le texte original */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Effet au survol dans le menu */
.menu-trigger:hover .mcl-logo-img {
    transform: scale(1.05);
    filter: drop-shadow(0 0 4px rgba(0, 212, 255, 0.6));
}

/* Version plus grande pour la boîte d'alerte */
.mcl-logo-img.large {
    height: 28px; /* Ajustez selon la taille souhaitée dans l'alerte */
    width: auto;
}

/* Ajustement du conteneur de l'icône d'alerte pour bien centrer l'image */
.alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* Empêche l'image de dépasser si elle est trop grande */
}




/* Context Menu - MacOS 26 Style */
#context-menu {
    position: absolute;
    width: 220px;
    z-index: 999999; /* Au-dessus de tout */
    
    /* Le style Liquid Glass */
    background: rgba(240, 240, 240, 0.45); /* Très translucide */
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    
    /* Bordures et Ombres */
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    
    padding: 6px;
    
    /* Animation d'ouverture */
    transform-origin: top left;
    transform: scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#context-menu.visible {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ctx-item {
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    transition: background 0.1s;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ctx-item:hover {
    background: rgba(0, 212, 255, 0.6); /* Couleur d'accentuation */
    color: white;
}

.ctx-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 4px 10px;
}

.ctx-shortcut {
    opacity: 0.5;
    font-size: 11px;
}




/* Indicateur d'application ouverte (Le Point) */
.dock-item::before {
    content: '';
    position: absolute;
    bottom: -6px; /* Position sous l'icône */
    left: 50%;
    transform: translateX(-50%);
    
    /* Style du point */
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    
    /* Glow effet néon/verre */
    box-shadow: 
        0 0 4px rgba(255, 255, 255, 0.8),
        0 0 8px rgba(0, 212, 255, 0.4);
        
    /* État par défaut : invisible */
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Quand l'app est active */
.dock-item.running::before {
    opacity: 1;
    transform: translateX(-50%) scale(1); /* Animation de pop */
}




/* --- Wallpaper Selection Grid --- */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 25px;
    padding: 10px;
}

.wallpaper-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wallpaper-item:hover {
    transform: scale(1.08);
}

.wallpaper-item img, 
.wallpaper-item .wp-preview {
    width: 140px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    /* Style Liquid Glass pour les bordures des miniatures */
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.wallpaper-item span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    font-weight: 500;
}

.wp-preview {
    width: 100%;
    height: 100%;
}





#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 999999; /* Au-dessus de tout */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.8s ease-in-out, filter 0.8s ease-in-out;
}

/* Classe pour cacher l'écran à la fin */
#boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
    filter: blur(20px); /* Effet de dissipation cool */
}

.boot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.boot-logo {
    width: 100px; /* Ajustez selon la taille de votre image */
    height: auto;
    
    /* Effet Liquid Glass sur le logo */
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
    opacity: 0;
    animation: logoFadeIn 1s ease-out forwards;
}

.boot-progress-container {
    width: 220px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15); /* Piste sombre */
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards; /* Apparaît après le logo */
}

.boot-progress-bar {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 10px;
    
    /* Le fameux "Glow" liquide */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(0, 212, 255, 0.6);
    
    /* Animation de chargement fluide */
    transition: width 2.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes logoFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}




/* Empêcher le drag des images spécifiquement */
img {
    -webkit-user-drag: none;  /* Safari et Chrome */
    user-drag: none;          /* Non-standard mais utile */
    -webkit-touch-callout: none; /* Empêche le menu contextuel sur mobile au appui long */
    pointer-events: auto; /* Garde le clic possible (pour ouvrir les apps) */
}



/* Correctif : Force l'impossibilité de cliquer si la fenêtre est cachée */
.window.hidden, .window.hidden * {
    pointer-events: none !important;
}




/* --- Style pour les fichiers dans les fenêtres (Finder Grid) --- */

.finder-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    padding: 10px;
    align-items: flex-start;
}

.finder-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 6px;
    padding: 5px;
}

.finder-file:hover {
    background: rgba(255, 255, 255, 0.15); /* Effet de sélection au survol */
}

.finder-file:active {
    background: rgba(255, 255, 255, 0.25);
}

.finder-file img {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    /* Petit effet d'ombre pour donner de la profondeur au fichier */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); 
}

.finder-file span {
    font-size: 12px;
    color: white;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    
    /* Pour couper le texte s'il est trop long (optionnel) */
    max-width: 100%;
    word-wrap: break-word;
}