/* ==========================================================================
   RETRO MODE 1995 — WINDOWS 95 & NETSCAPE NAVIGATOR THEME
   Standalone stylesheet with full 98.css rules, desktop UI, and mobile fixes
   ========================================================================== */

/* --- 1. RESET & SYSTEM DEFAULTS --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-color: #008080; /* Teal classico Windows 95 */
    color: #000000;
    font-family: "MS Sans Serif", "W95FA", Tahoma, Geneva, sans-serif;
    font-size: 12px;
    line-height: 1.25;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

/* --- 2. 98.CSS CORE STYLES (STANDALONE ZERO-DEPENDENCY) --- */
:root {
    --w95-bg: #c0c0c0;
    --w95-light: #ffffff;
    --w95-dark: #808080;
    --w95-black: #000000;
    --w95-blue: #000080;
    --w95-blue-light: #1084d0;
    --w95-teal: #008080;
    --w95-gray-light: #dfdfdf;
}

/* 3D Border Mixins */
.border-raised {
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    box-shadow: inset 1px 1px 0 var(--w95-gray-light), inset -1px -1px 0 var(--w95-dark);
}

.border-sunken {
    border-top: 2px solid var(--w95-dark);
    border-left: 2px solid var(--w95-dark);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    box-shadow: inset 1px 1px 0 var(--w95-black), inset -1px -1px 0 var(--w95-gray-light);
}

/* Win95 Window */
.window {
    position: absolute;
    background: var(--w95-bg);
    padding: 3px;
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    box-shadow: inset 1px 1px 0 var(--w95-gray-light), inset -1px -1px 0 var(--w95-dark), 2px 2px 8px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    min-width: 280px;
    min-height: 200px;
    box-sizing: border-box;
}

.window.is-maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: calc(100vh - 32px) !important;
    height: calc(100dvh - 32px) !important;
    border: none;
    box-shadow: none;
}

/* Title Bar */
.title-bar {
    background: linear-gradient(90deg, var(--w95-blue), var(--w95-blue-light));
    padding: 3px 4px 3px 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 0.02em;
    cursor: default;
    user-select: none;
    height: 22px;
    flex-shrink: 0;
}

.window:not(.active) .title-bar {
    background: linear-gradient(90deg, #808080, #b5b5b5);
    color: #dfdfdf;
}

.title-bar-text {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.title-bar-text img, .title-bar-text svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.title-bar-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.title-bar-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 14px;
    padding: 0;
    background: var(--w95-bg);
    color: #000000;
    font-size: 10px;
    font-weight: bold;
    border-top: 1px solid var(--w95-light);
    border-left: 1px solid var(--w95-light);
    border-right: 1px solid var(--w95-black);
    border-bottom: 1px solid var(--w95-black);
    box-shadow: inset 1px 1px 0 var(--w95-gray-light), inset -1px -1px 0 var(--w95-dark);
    cursor: pointer;
    line-height: 1;
}

.title-bar-controls button:active {
    border-top: 1px solid var(--w95-black);
    border-left: 1px solid var(--w95-black);
    border-right: 1px solid var(--w95-light);
    border-bottom: 1px solid var(--w95-light);
    box-shadow: none;
    padding-top: 1px;
    padding-left: 1px;
}

/* Window Content Body */
.window-body {
    flex: 1;
    margin: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Status Bar */
.status-bar {
    display: flex;
    gap: 3px;
    padding: 2px;
    margin-top: 3px;
    flex-shrink: 0;
}

.status-bar-field {
    border-top: 1px solid var(--w95-dark);
    border-left: 1px solid var(--w95-dark);
    border-right: 1px solid var(--w95-light);
    border-bottom: 1px solid var(--w95-light);
    padding: 2px 6px;
    font-size: 11px;
    color: #333333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Win95 Button */
button.retro-btn, .btn-win95 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 12px;
    min-height: 23px;
    background: var(--w95-bg);
    color: #000000;
    font-family: inherit;
    font-size: 12px;
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    box-shadow: inset 1px 1px 0 var(--w95-gray-light), inset -1px -1px 0 var(--w95-dark);
    cursor: pointer;
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

button.retro-btn:active, .btn-win95:active {
    border-top: 2px solid var(--w95-black);
    border-left: 2px solid var(--w95-black);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    box-shadow: none;
    padding-top: 4px;
    padding-left: 13px;
}

button.retro-btn:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

/* --- 3. DESKTOP WORKSPACE & ICONS --- */
.desktop {
    position: relative;
    width: 100vw;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    overflow: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 16px;
}

.desktop-icon {
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    padding: 6px 4px;
    border: 1px solid transparent;
    user-select: none;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.45);
    border: 1px dotted #ffffff;
}

.desktop-icon-img {
    width: 34px;
    height: 34px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
}

.desktop-icon-label {
    color: #ffffff;
    font-size: 11px;
    text-shadow: 1px 1px 1px #000000, -1px -1px 1px #000000, 1px -1px 1px #000000, -1px 1px 1px #000000;
    word-break: break-word;
    line-height: 1.2;
    padding: 1px 3px;
}

.desktop-icon.selected .desktop-icon-label {
    background: var(--w95-blue);
    text-shadow: none;
}

/* Time Travel Sticky Banner on Desktop */
.desktop-time-travel-card {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 220px;
    z-index: 5;
}

/* --- 4. TASKBAR & START MENU --- */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--w95-bg);
    border-top: 2px solid var(--w95-light);
    box-shadow: inset 0 1px 0 var(--w95-gray-light);
    display: flex;
    align-items: center;
    padding: 2px 4px;
    gap: 4px;
    z-index: 10000;
    user-select: none;
}

.start-button {
    height: 24px;
    padding: 2px 7px 2px 5px;
    background: var(--w95-bg);
    color: #000000;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    box-shadow: inset 1px 1px 0 var(--w95-gray-light), inset -1px -1px 0 var(--w95-dark);
    cursor: pointer;
}

.start-button.active, .start-button:active {
    border-top: 2px solid var(--w95-black);
    border-left: 2px solid var(--w95-black);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    box-shadow: none;
    padding-top: 3px;
    padding-left: 6px;
}

.taskbar-divider {
    width: 2px;
    height: 20px;
    border-left: 1px solid var(--w95-dark);
    border-right: 1px solid var(--w95-light);
    margin: 0 2px;
}

.taskbar-items {
    flex: 1;
    display: flex;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
}

.taskbar-item {
    height: 24px;
    max-width: 160px;
    min-width: 90px;
    flex: 1;
    padding: 2px 6px;
    background: var(--w95-bg);
    color: #000000;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    box-shadow: inset 1px 1px 0 var(--w95-gray-light), inset -1px -1px 0 var(--w95-dark);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.taskbar-item.active {
    background: #e0e0e0;
    border-top: 2px solid var(--w95-black);
    border-left: 2px solid var(--w95-black);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    box-shadow: inset 1px 1px 0 #808080;
    font-weight: bold;
}

.taskbar-item-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.system-tray {
    height: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-top: 1px solid var(--w95-dark);
    border-left: 1px solid var(--w95-dark);
    border-right: 1px solid var(--w95-light);
    border-bottom: 1px solid var(--w95-light);
    font-size: 11px;
    background: var(--w95-bg);
}

/* Start Menu Popup */
.start-menu {
    position: fixed;
    bottom: 32px;
    left: 2px;
    width: 220px;
    background: var(--w95-bg);
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    box-shadow: 2px -2px 6px rgba(0,0,0,0.4);
    display: none;
    z-index: 10001;
}

.start-menu.open {
    display: flex;
}

.start-menu-sidebar {
    width: 28px;
    background: linear-gradient(180deg, #000080 0%, #1084d0 100%);
    color: #ffffff;
    display: flex;
    align-items: flex-end;
    padding-bottom: 10px;
    padding-left: 6px;
}

.start-menu-sidebar span {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.start-menu-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 3px 0;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    color: #000000;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
}

.start-menu-item:hover {
    background: var(--w95-blue);
    color: #ffffff;
}

.start-menu-separator {
    height: 2px;
    border-top: 1px solid var(--w95-dark);
    border-bottom: 1px solid var(--w95-light);
    margin: 4px 2px;
}

/* --- 5. NETSCAPE NAVIGATOR STYLES --- */
.netscape-menubar {
    display: flex;
    gap: 8px;
    padding: 2px 6px;
    border-bottom: 1px solid var(--w95-dark);
    font-size: 11px;
    background: var(--w95-bg);
}

.netscape-menubar span {
    cursor: default;
}
.netscape-menubar span:hover {
    color: var(--w95-blue);
}

.netscape-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    background: var(--w95-bg);
    border-bottom: 1px solid var(--w95-dark);
    gap: 4px;
    overflow-x: auto;
}

.netscape-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
}

.netscape-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    min-width: 48px;
    height: 42px;
    background: var(--w95-bg);
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    border-bottom: 2px solid var(--w95-black);
    font-size: 9.5px;
    color: #000000;
    cursor: pointer;
    line-height: 1.1;
}

.netscape-btn:active {
    border-top: 2px solid var(--w95-black);
    border-left: 2px solid var(--w95-black);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    padding-top: 3px;
    padding-left: 7px;
}

.netscape-btn-icon {
    font-size: 15px;
    margin-bottom: 2px;
}

.netscape-logo-box {
    width: 38px;
    height: 38px;
    background: #000000;
    border-top: 2px solid var(--w95-dark);
    border-left: 2px solid var(--w95-dark);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.netscape-n-logo {
    font-size: 24px;
    font-family: serif;
    font-weight: 900;
    color: #00ffcc;
    text-shadow: 0 0 6px rgba(0,255,204,0.8);
    animation: netscapePulse 2.5s infinite alternate;
}

@keyframes netscapePulse {
    0% { transform: scale(0.9); opacity: 0.8; color: #00bb99; }
    100% { transform: scale(1.1); opacity: 1; color: #33ffff; }
}

.netscape-urlbar {
    display: flex;
    align-items: center;
    padding: 3px 6px;
    background: var(--w95-bg);
    border-bottom: 1px solid var(--w95-dark);
    gap: 8px;
}

.netscape-url-label {
    font-size: 11px;
    font-weight: bold;
    color: #333333;
    white-space: nowrap;
}

.netscape-url-input {
    flex: 1;
    background: #ffffff;
    color: #000000;
    padding: 3px 6px;
    font-family: "Courier New", monospace;
    font-size: 11.5px;
    border-top: 2px solid var(--w95-dark);
    border-left: 2px solid var(--w95-dark);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    outline: none;
}

.netscape-tabs {
    display: flex;
    gap: 2px;
    padding: 3px 4px 0 4px;
    background: var(--w95-bg);
    border-bottom: 2px solid var(--w95-dark);
    overflow-x: auto;
}

.netscape-tab {
    padding: 4px 12px;
    background: #b5b5b5;
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-black);
    font-size: 11px;
    cursor: pointer;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    white-space: nowrap;
}

.netscape-tab.active {
    background: #ffffff;
    border-bottom: 2px solid #ffffff;
    margin-bottom: -2px;
    font-weight: bold;
}

/* Web Page Content View (Inside Netscape) */
.netscape-webpage {
    flex: 1;
    background: #ffffff;
    border-top: 2px solid var(--w95-dark);
    border-left: 2px solid var(--w95-dark);
    border-right: 2px solid var(--w95-light);
    border-bottom: 2px solid var(--w95-light);
    overflow-y: auto;
    padding: 16px 20px;
    color: #000000;
    font-family: "Times New Roman", Times, serif;
    font-size: 14px;
    line-height: 1.45;
}

.netscape-webpage img {
    max-width: 100%;
    height: auto;
    border: 2px inset var(--w95-dark);
    margin: 8px 0;
    display: block;
    background: #ffffff;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.15);
}

.retro-hero-banner {
    text-align: center;
    border: 3px double #000080;
    padding: 12px;
    background: #efefef;
    margin-bottom: 16px;
}

.retro-marquee {
    background: #000080;
    color: #ffff00;
    font-family: monospace;
    font-size: 13px;
    padding: 4px 8px;
    margin: 10px 0;
    white-space: nowrap;
    overflow: hidden;
}

.retro-card {
    border-top: 2px solid var(--w95-light);
    border-left: 2px solid var(--w95-light);
    border-right: 2px solid var(--w95-dark);
    border-bottom: 2px solid var(--w95-dark);
    background: #f7f7f7;
    padding: 12px;
    margin-bottom: 16px;
}

.retro-badge-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.retro-tag {
    background: #e0e0e0;
    border: 1px solid #888888;
    padding: 1px 5px;
    font-family: "MS Sans Serif", Tahoma, sans-serif;
    font-size: 10px;
}

/* --- 6. NOTEPAD / CURRICULUM.TXT --- */
.notepad-menubar {
    display: flex;
    gap: 10px;
    padding: 2px 8px;
    font-size: 11px;
    border-bottom: 1px solid #808080;
    background: var(--w95-bg);
}

.notepad-textarea {
    flex: 1;
    width: 100%;
    background: #ffffff;
    color: #000000;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.35;
    padding: 10px;
    border: none;
    outline: none;
    resize: none;
    overflow-y: scroll;
    white-space: pre;
}

/* --- 7. MS-DOS PROMPT TERMINAL --- */
.dos-terminal {
    flex: 1;
    background: #000000;
    color: #ffffff;
    font-family: "Courier New", Consolas, monospace;
    font-size: 13px;
    line-height: 1.35;
    padding: 10px;
    overflow-y: auto;
    border: 2px inset #555555;
    user-select: text;
    -webkit-user-select: text;
}

.dos-output {
    white-space: pre-wrap;
    word-break: break-all;
}

.dos-input-line {
    display: flex;
    align-items: center;
    margin-top: 4px;
}

.dos-prompt-text {
    color: #33ff33;
    font-weight: bold;
    margin-right: 6px;
}

.dos-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    caret-color: #33ff33;
}

/* --- 8. ESPLORA RISORSE / PROGETTI FOLDER --- */
.folder-explorer {
    flex: 1;
    background: #ffffff;
    border: 2px inset var(--w95-dark);
    padding: 12px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}

.folder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6px;
    cursor: pointer;
    border: 1px solid transparent;
}

.folder-item:hover {
    background: #e6f0fa;
    border: 1px dotted #000080;
}

.folder-item-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.folder-item-label {
    font-size: 11px;
    color: #000000;
    word-break: break-word;
}

/* --- 9. RESPONSIVE DESIGN (MOBILE / TABLET) --- */
@media (max-width: 767px) {
    .window {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100vh - 32px) !important;
        height: calc(100dvh - 32px) !important;
        border-radius: 0;
        box-shadow: none;
    }
    
    .desktop {
        gap: 10px;
        padding: 8px;
    }
    
    .desktop-icon {
        width: 68px;
    }
    
    .taskbar-item {
        min-width: 60px;
        max-width: 110px;
        font-size: 10px;
    }
    
    .netscape-btn {
        min-width: 38px;
        height: 38px;
        font-size: 8.5px;
    }

    .desktop-time-travel-card {
        bottom: 10px;
        right: 10px;
        width: 160px;
    }
}
