/* =========================================
   STILI GLOBALI E CURSORI
   ========================================= */
body {
    background-color: #ffffff;
    color: #000000;
    margin: 0;
    height: 100vh;
    height: 100dvh; 
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    font-family: Tahoma, "Trebuchet MS", sans-serif;
    overflow: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="black" stroke="white" stroke-width="1" d="M4 4v16l5-5 3 7 2-1-3-7h6z"/></svg>'), auto;
}

a, button, .clickable {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="black" stroke="white" stroke-width="1" d="M10 14V4a1.5 1.5 0 0 1 3 0v6l1-1a1.5 1.5 0 0 1 2 1l1-1a1.5 1.5 0 0 1 2 1l1-1a1.5 1.5 0 0 1 2 2v6c0 3-3 6-6 6H9c-3 0-5-2-5-5V9l6 5z"/></svg>'), pointer;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes windowOpenLaggy {
    0% { transform: scale(0.6); opacity: 0; }
    50% { transform: scale(0.85); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.window-animated {
    animation: windowOpenLaggy 0.4s steps(4, end) forwards;
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 40px;
    box-sizing: border-box;
    z-index: 1000;
    opacity: 0;
    animation: fadeInUp 1s steps(10, end) forwards;
    pointer-events: auto;
}

.logo img { width: 80px; height: auto; filter: invert(1); }
.nav-links { display: flex; align-items: center; gap: 25px; }
.nav-links a img {
    width: 35px; height: auto;
    transition: transform 0.3s steps(3, end), filter 0.3s steps(3, end);
    filter: invert(1);
}
.nav-links a[href="/fanzine"] img { width: 50px; }
.nav-links a:hover img { transform: scale(1.1); filter: invert(1) brightness(0.8); }

/* =========================================
   CLIPPY & BUBBLE
   ========================================= */
#clippy-container {
    position: relative; margin-right: 80px; margin-bottom: 50px;
    display: flex; align-items: flex-end; z-index: 10;
}

#clippy-img {
    width: 150px; height: auto; position: absolute;
    bottom: 0; right: -50px; transform: translateY(150%);
    animation: clippyEntrance 1s steps(12, end) forwards;
    z-index: 2;
    transition: width 0.1s steps(2, end), right 0.1s steps(2, end), bottom 0.1s steps(2, end);
}

#clippy-img.pensare-size {
    width: 115px; 
    right: -25px; 
    bottom: -5px; 
}

@keyframes clippyEntrance { to { transform: translateY(0); } }

.bubble {
    background: #FFFFCC; border: 1px solid #000; border-radius: 8px;
    padding: 15px; width: 280px; color: #000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5); position: relative;
    margin-bottom: 120px; margin-right: 15px; font-size: 14px;
    line-height: 1.4; opacity: 0; 
    transition: opacity 0.5s steps(5, end); z-index: 1;
}

.bubble.visible { opacity: 1; }

.bubble::after {
    content: ''; position: absolute; bottom: -20px; right: 30px;
    border-width: 20px 0 0 20px; border-style: solid;
    border-color: #FFFFCC transparent transparent transparent;
}
.bubble::before {
    content: ''; position: absolute; bottom: -22px; right: 29px;
    border-width: 22px 0 0 22px; border-style: solid;
    border-color: #000 transparent transparent transparent;
}

#bubble-content { transition: opacity 0.3s steps(3, end); opacity: 1; }
#bubble-content.fade-out { opacity: 0; }
.word { opacity: 0; animation: fadeInWord 0.01s forwards; }
@keyframes fadeInWord { to { opacity: 1; } }

.btn {
    background: #e3e3e3; border: 2px solid;
    border-top-color: #fff; border-left-color: #fff;
    border-right-color: #888; border-bottom-color: #888;
    padding: 4px 15px; margin-top: 15px; margin-right: 8px;
    font-family: Tahoma, sans-serif; font-size: 13px; color: black;
    appearance: none; -webkit-appearance: none;
}
.btn:active {
    border-top-color: #888; border-left-color: #888;
    border-right-color: #fff; border-bottom-color: #fff; background: #d4d4d4;
}

.file-list { display: none; margin-top: 15px; padding: 0; list-style: none; }
.file-list li { margin-bottom: 8px; }
.file-list a {
    color: #0000EE; text-decoration: underline; font-size: 14px;
    font-weight: bold; display: inline-block; padding: 5px 0;
}
.file-list a:hover { color: #ff0000; }

/* =========================================
   WINDOWS XP NOTIFICATION BALLOON
   ========================================= */
#xp-balloon {
    display: none; position: fixed; bottom: 25px; right: 25px;
    width: 280px; background-color: #FFFFE1; border: 1px solid #000;
    border-radius: 8px; padding: 12px; box-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    color: black; z-index: 500;
    animation: balloonPop 0.3s steps(4, end) forwards;
}
@keyframes balloonPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#xp-balloon::before {
    content: ''; position: absolute; bottom: -20px; right: 25px;
    border-width: 20px 20px 0 0; border-style: solid; border-color: #000 transparent transparent transparent;
}
#xp-balloon::after {
    content: ''; position: absolute; bottom: -18px; right: 26px;
    border-width: 18px 18px 0 0; border-style: solid; border-color: #FFFFE1 transparent transparent transparent;
}

.balloon-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 5px; }
.balloon-title-area { display: flex; align-items: center; gap: 8px; }
.balloon-icon {
    background-color: #0054E3; color: white; width: 16px; height: 16px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-family: serif; font-size: 12px; font-style: italic;
}
.balloon-title { font-weight: bold; font-size: 13px; }
.balloon-close {
    color: #555; background: #e3e3e3; border: 1px solid #999;
    width: 16px; height: 16px; font-size: 10px; display: flex;
    align-items: center; justify-content: center; border-radius: 3px;
}
.balloon-close:active { background: #ccc; }
.balloon-body { font-size: 12px; margin-left: 24px; pointer-events: none; }

/* =========================================
   CARTELLA WINDOWS XP
   ========================================= */
#folder-window {
    display: none; 
    position: fixed; 
    top: 15%; 
    left: 10%; 
    width: 700px; 
    max-width: 95vw;
    height: 480px;
    background: #ECE9D8; 
    border: 3px solid #0054E3; 
    border-radius: 8px 8px 0 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6); 
    z-index: 2001;
    flex-direction: column;
}

.folder-titlebar {
    background: linear-gradient(to bottom, #0058EE 0%, #3593FF 10%, #0054E3 40%, #0055EB 60%, #00138C 100%);
    padding: 4px 6px; display: flex; justify-content: space-between; align-items: center;
    border-radius: 4px 4px 0 0; color: white; font-weight: bold; font-size: 13px; text-shadow: 1px 1px 2px black;
    cursor: move;
    flex-shrink: 0;
}

.folder-title-text { display: flex; align-items: center; gap: 5px; }
.folder-title-text img { width: 16px; height: 16px; }

.folder-menu {
    background: #ECE9D8;
    padding: 3px 8px;
    font-size: 12px;
    border-bottom: 1px solid #ACA899;
    display: flex;
    gap: 12px;
    color: black;
}

.folder-addressbar {
    background: #ECE9D8;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #ACA899;
    font-size: 12px;
    color: black;
}

.folder-addressbar input {
    flex-grow: 1;
    padding: 3px 5px;
    border: 1px inset #ACA899;
    font-family: Tahoma;
    font-size: 12px;
}

.folder-body {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    background: white;
}

.folder-sidebar {
    width: 220px;
    background: linear-gradient(to bottom, #7ba2e7, #637fdc);
    padding: 12px;
    overflow-y: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

.sidebar-panel {
    background: white;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.sidebar-panel-header {
    background: linear-gradient(to right, white, #c6d3f7);
    color: #215dc6;
    font-weight: bold;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
}

.sidebar-panel-content {
    padding: 10px;
    font-size: 11px;
    color: #0c327d;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-panel-content span { cursor: pointer; }
.sidebar-panel-content span:hover { text-decoration: underline; color: #2b72ff; }

.folder-content {
    flex-grow: 1;
    background: white;
    padding: 15px;
    display: flex;
    align-content: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    overflow-y: auto;
}

.file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90px;
    text-align: center;
    font-size: 11px;
    color: black;
    gap: 5px;
    padding: 8px;
    border-radius: 3px;
}

.file-icon:hover { background-color: rgba(0, 84, 227, 0.1); }
.file-icon img { width: 56px; height: 56px; }
.file-icon span { word-wrap: break-word; }

/* =========================================
   INTERNET EXPLORER FINESTRA FLUTTUANTE
   ========================================= */
#ie-window {
    display: none; 
    position: fixed; 
    top: 100px; 
    left: 40px; 
    width: 480px; 
    max-width: 90vw;
    background: #ECE9D8; 
    border: 3px solid #0054E3; 
    border-radius: 8px 8px 0 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6); 
    z-index: 2000;
}

.ie-titlebar {
    background: linear-gradient(to bottom, #0058EE 0%, #3593FF 10%, #0054E3 40%, #0055EB 60%, #00138C 100%);
    padding: 4px 6px; display: flex; justify-content: space-between; align-items: center;
    border-radius: 4px 4px 0 0; color: white; font-weight: bold; font-size: 13px; text-shadow: 1px 1px 2px black;
    cursor: move;
}
.ie-title-text { display: flex; align-items: center; gap: 5px; }
.ie-ieicon img { width: 16px; height: 16px; display: block; }
.ie-close {
    background: #E81123; color: white; border: 1px solid #FFF; border-radius: 3px;
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; text-shadow: none; box-shadow: inset -1px -1px 2px rgba(0,0,0,0.3);
    cursor: pointer;
}
.ie-close:active { background: #B00D1A; box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5); }
.ie-content { padding: 4px; background: #ECE9D8; }
.ie-iframe-wrapper {
    background: white; border: 2px inset #999; width: 100%; height: 280px; box-sizing: border-box;
}

/* =========================================
   BARRA DELLA LINGUA XP FLUTTUANTE
   ========================================= */
.xp-lang-bar {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: #ECE9D8;
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    border-right: 1px solid #ACA899;
    border-bottom: 1px solid #ACA899;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 2005;
}

.xp-lang-handle {
    width: 8px;
    height: 22px;
    background: repeating-linear-gradient(
        to bottom,
        #ACA899,
        #ACA899 2px,
        transparent 2px,
        transparent 4px
    );
    margin: 0 4px;
    cursor: move;
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 4px 8px;
    font-family: Tahoma, sans-serif;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    outline: none;
}

.lang-btn:hover {
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    border-right: 1px solid #ACA899;
    border-bottom: 1px solid #ACA899;
}

.lang-btn.active {
    background: #fff;
    border-top: 1px solid #ACA899;
    border-left: 1px solid #ACA899;
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    font-weight: bold;
}

/* =========================================
   MOBILE
   ========================================= */
@media (max-width: 768px) {
    .navbar { padding: 20px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent); }
    .logo img { width: 60px; }
    .nav-links { gap: 14px; }
    .nav-links a img { width: 28px; }
    .nav-links a[href="/fanzine"] img { width: 40px; }
    
    #clippy-container { margin-right: 25px; margin-bottom: 25px; }
    .bubble { width: calc(100vw - 70px); max-width: 280px; margin-bottom: 110px; margin-right: 5px; font-size: 14px; }
    #clippy-img { width: 120px; right: -15px; }
    .bubble::after { right: 20px; } .bubble::before { right: 19px; }
    .btn { padding: 10px 20px; font-size: 14px; margin-right: 12px; }

    #xp-balloon { bottom: 10px; right: 10px; width: calc(100vw - 40px); }
    
    #folder-window { width: 95vw; left: 2.5vw; top: 10%; height: 75vh; }
    .folder-sidebar { display: none; }
    .folder-content { justify-content: space-around; gap: 15px; padding: 10px; }
    .file-icon { width: 105px; }
    
    #ie-window { top: 75px; left: 4vw; width: 92vw; }
    .ie-iframe-wrapper { height: 230px; }

    .xp-lang-bar { bottom: 20px; left: 20px; }
}