/* Layout Resets */
body {
    background-color: #008080; /* Classic Win98 Teal */
    margin: 0;
    overflow: hidden; /* Prevent page scrolling */
}

.desktop {
    height: calc(100vh - 40px); /* Leave space for taskbar */
    position: relative;
    background-image: url('images/classicWindows.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Shortcuts Grid Layout */
.desktop-shortcuts {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Individual Shortcut */
.shortcut {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

.shortcut-icon {
    margin-bottom: 6px;
    flex: 0 0 auto;
}

.shortcut-image {
    display: block;
    image-rendering: pixelated;
}

/* Retro CSS Folder Icon */
.folder-icon {
    width: 36px;
    height: 26px;
    background-color: #ffd700; /* Windows 95 Folder Yellow */
    position: relative;
    border-radius: 2px;
    border: 1px solid #000;
    margin-bottom: 6px;
}

/* Folder Tab */
.folder-icon::before {
    content: '';
    width: 14px;
    height: 6px;
    background-color: #d4b200;
    position: absolute;
    top: -6px;
    left: 0;
    border: 1px solid #000;
    border-bottom: none;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

/* Shortcut Text Label */
.shortcut-label {
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px #000;
    word-wrap: break-word;
    max-width: 80px;
    user-select: none;
}

/* Focus Outline State */
.shortcut:focus .shortcut-label,
.shortcut:active .shortcut-label {
    background-color: #000080;
    outline: 1px dotted #fff;
}

/* Make the title bar cursor indicate it can be moved */
.title-bar, .window-title-bar {
    cursor: default;
}
.title-bar:active, .window-title-bar:active {
    cursor: move;
}

/* Custom Taskbar Layout */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 4px;
    margin: 0;
    border-radius: 0;
    z-index: 1000;
}

.start-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
}

.taskbar-divider {
    width: 2px;
    height: 100%;
    background: #808080;
    border-right: 1px solid #ffffff;
    margin: 0 5px;
}

/* Force the active app button to look "pressed in" */
.taskbar-right {
    margin: 0;
    padding: 0;
    margin-left: auto;
    height: 100%;
    display: flex;
    align-items: center;
}

.taskbar-right .status-bar-field {
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

/* --- Retro Window Styling (MazeTurtle) --- */
.retro-window {
    background-color: #dfdfdf;
    border: 2px solid;
    border-color: #fff #000 #000 #fff; /* Classic Win95 bevel */
    display: flex;
    flex-direction: column;
    box-shadow: 2px 2px 0px rgba(0,0,0,0.5);
}

/* Window Content Area */
.retro-window .window-content {
    background-color: #fff;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080; /* Sunken effect */
    margin: 4px;
    padding: 10px;
    flex-grow: 1;
    display: flex;
    gap: 20px;
    align-content: flex-start;
    flex-wrap: wrap;
    overflow-y: auto; /* Scroll inside folder if items overflow */
}

/* Files inside the Window */
.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    cursor: pointer;
}

.file-name {
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    margin-top: 4px;
    text-align: center;
    word-break: break-all;
}

.file-item:hover .file-name {
    background-color: #000080;
    color: #fff;
    outline: 1px dotted #000;
}

/* Simple Document Icons */
.file-icon {
    width: 24px;
    height: 32px;
    background-color: #fff;
    border: 1px solid #000;
    position: relative;
}
.file-icon::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: #dfdfdf;
    border-bottom: 1px solid #000;
    border-left: 1px solid #000;
}

/* Folder icon inside window */
.file-folder {
    width: 36px;
    height: 26px;
    background-color: #ffd700;
    border: 1px solid #000;
    border-radius: 2px;
    position: relative;
}
.file-folder::before {
    content: '';
    width: 14px;
    height: 6px;
    background-color: #d4b200;
    position: absolute;
    top: -6px;
    left: 0;
    border: 1px solid #000;
    border-bottom: none;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}
.file-folder::after {
    display: none; /* no dog-ear on folders */
}

/* PDF icon inside window */
.file-pdf {
    background-color: #fff;
    border: 1px solid #000;
}
.file-pdf::before {
    content: 'PDF';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 7px;
    font-weight: bold;
    color: #fff;
    background-color: #c00;
    line-height: 10px;
}

/* Code file icon (Python, etc.) */
.file-code {
    background-color: #fff;
    border: 1px solid #000;
}
.file-code::before {
    content: 'PY';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 7px;
    font-weight: bold;
    color: #fff;
    background-color: #2e7d32; /* Green badge for python/code */
    line-height: 10px;
}

/* Statechart file icon */
.file-statechart {
    background-color: #fff;
    border: 1px solid #000;
}
.file-statechart::before {
    content: 'SCT';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 7px;
    font-weight: bold;
    color: #fff;
    background-color: #1565c0; /* Blue badge for statecharts */
    line-height: 10px;
}

/* Text file icon */
.file-txt {
    background-color: #fff;
    border: 1px solid #000;
}
.file-txt::before {
    content: 'TXT';
    position: absolute;
    bottom: 4px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 7px;
    font-weight: bold;
    color: #fff;
    background-color: #616161; /* Gray badge for text files */
    line-height: 10px;
}

/* --- Biography App Window --- */
.biography-body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100% - 24px);
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.7), transparent 30%),
        linear-gradient(180deg, #d9d5ca 0%, #c9c4b8 100%);
    overflow-y: auto;
}

.biography-hero {
    padding: 28px 36px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 18px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.biography-photo-frame {
    width: min(100%, 440px);
    background: #efefef;
    border: 2px solid;
    border-color: #fff #848484 #848484 #fff;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #b0b0b0;
    padding: 10px;
}

.biography-photo {
    aspect-ratio: 10 / 10;
    width: 100%;
    min-height: 80px;
    justify-content: center; /* Centers horizontally */
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 55%, rgba(255,255,255,0.35), transparent 14%),
        linear-gradient(135deg, #f3e6d8 0%, #e1d8c7 38%, #c8d0d9 38%, #aeb6c4 100%);
}
.biography-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% center;
    display: block;
}
.biography-photo::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.18), transparent 24%),
        radial-gradient(circle at 35% 42%, #0000 0 10%, rgba(0,0,0,0.03) 10% 11%, #0000 11%),
        linear-gradient(90deg, rgba(130, 0, 0, 0.08) 0 2%, transparent 2% 14%, rgba(130, 0, 0, 0.08) 14% 16%, transparent 16% 100%);
    mix-blend-mode: multiply;
}

.biography-photo-head {
    position: absolute;
    top: 20%;
    left: 26%;
    width: 18%;
    aspect-ratio: 1 / 1.1;
    border-radius: 48% 48% 42% 42%;
    background:
        radial-gradient(circle at 40% 38%, rgba(255,255,255,0.45) 0 8%, transparent 8%),
        linear-gradient(180deg, #6b432d 0%, #2a1b14 100%);
    box-shadow: 12px 12px 0 rgba(0,0,0,0.12);
}

.biography-photo-body {
    position: absolute;
    left: 18%;
    bottom: -6%;
    width: 34%;
    height: 54%;
    border-radius: 28% 28% 12% 12%;
    background: linear-gradient(180deg, #0f1620 0%, #1a1f26 100%);
    box-shadow: 20px -6px 0 -10px #00000040;
}

.biography-copy {
    width: min(100%, 640px);
    font-family: Tahoma, Arial, sans-serif;
    color: #1a1a1a;
}

.biography-name {
    margin: 0;
    font-size: 30px;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.biography-role,
.biography-location,
.biography-description {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: #4d5665;
    font-family: Tahoma, Arial, sans-serif;
}

.biography-location {
    margin-top: 8px;
}

.biography-pin {
    font-size: 12px;
}

.biography-description {
    max-width: 62ch;
    font-size: 13px;
    color: #232323;
}

.biography-tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.biography-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #fff;
    font-size: 11px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.tag-swift { background: #f05138; }
.tag-python { background: #306998; }
.tag-js { background: #f7df1e; color: #1a1a1a; }
.tag-sql { background: #8a8a8a; }
.tag-git { background: #f14e32; }
.tag-html { background: #e44d26; }
.tag-swiftui { background: #0a84ff; }
.tag-react { background: #20232a; }
.tag-vue { background: #42b883; }
.tag-flask { background: #4a4a4a; }
.tag-mongo { background: #4db33d; }
.tag-sqlite { background: #3c9bd8; }
.tag-figma { background: #a259ff; }
.tag-cpp { background: #00599C; }
.tag-verilog { background: #d35400; }
.tag-embedded { background: #27ae60; }

.biography-details {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 14px;
    padding-bottom: 4px;
}

.biography-panel {
    background: #eae6dc;
    border: 2px solid;
    border-color: #fff #8b8b8b #8b8b8b #fff;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #bdb7aa;
    padding: 14px 15px;
    min-height: 108px;
}

.biography-panel h2 {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    font-family: Tahoma, Arial, sans-serif;
}

.biography-panel p,
.biography-panel li {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #1a1a1a;
    font-family: Tahoma, Arial, sans-serif;
}

.biography-panel ul {
    margin: 0;
    padding-left: 18px;
}

.biography-panel li + li {
    margin-top: 4px;
}

.biography-panel-wide {
    min-height: 108px;
}

@media (max-width: 900px) {
    .biography-window {
        left: 12px !important;
        top: 12px !important;
        width: calc(100vw - 24px) !important;
        height: calc(100vh - 72px) !important;
    }

    .biography-hero {
        padding: 20px;
    }

    .biography-details {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .biography-name {
        font-size: 24px;
    }
}

/* --- Explorer Navigation Bar --- */
.explorer-nav-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    background-color: #dfdfdf;
    border-bottom: 1px solid #808080;
    user-select: none;
}

.nav-btn-up {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    min-width: 50px;
    height: 22px;
    cursor: pointer;
}

.address-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 6px;
}

.address-container label {
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    color: #000;
}

.address-container input {
    flex-grow: 1;
    height: 20px;
    padding: 2px 6px;
    background-color: #fff;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080; /* Sunken effect */
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    color: #000;
    outline: none;
}

/* Notepad menu styles */
.notepad-menu span, .pdf-menu span {
    padding: 2px 4px;
}
.notepad-menu span:hover, .pdf-menu span:hover {
    background-color: #000080;
    color: #fff;
}

/* Taskbar Application Buttons */
.taskbar-app-btn {
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 2px 6px;
    height: 24px;
    min-width: 100px;
    max-width: 160px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    background-color: #dfdfdf;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    outline: none;
}

.taskbar-app-btn.active {
    background-color: #dfdfdf;
    border-color: #808080 #fff #fff #808080;
    box-shadow: inset 1px 1px 0 #000;
    font-weight: bold;
}

.taskbar-app-btn:hover:not(.active) {
    background-color: #e5e5e5;
}

/* --- Mobile Navigation --- */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #dfdfdf;
    border-top: 2px solid #808080;
    display: none; /* Hidden by default, shown via media query */
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    padding: 0 5px;
    box-sizing: border-box;
}

.nav-btn {
    font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
    font-size: 11px;
    padding: 4px 8px;
    height: 36px;
    cursor: pointer;
    background-color: #dfdfdf;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    flex: 1;
    margin: 0 4px;
    max-width: 80px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-btn.active {
    background-color: #dfdfdf;
    border-color: #808080 #fff #fff #808080;
    box-shadow: inset 1px 1px 0 #000;
    font-weight: bold;
}

/* --- Responsive Layout --- */

@media (max-width: 599px) {
    body {
        overflow: auto; /* Allow scrolling on mobile */
    }

    .desktop {
        height: auto;
        min-height: 100vh;
        background-attachment: scroll;
    }

    .desktop-shortcuts, .taskbar {
        display: none !important;
    }

    .mobile-nav {
        display: flex !important;
    }

    .window {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        min-height: calc(100vh - 60px) !important;
        border: none !important;
        box-shadow: none !important;
        z-index: 100 !important;
    }

    .title-bar {
        cursor: default !important;
        user-select: none;
    }

    .title-bar-controls {
        display: none !important; /* Hide min/max/close on mobile */
    }

    .biography-body {
        height: auto !important;
        overflow-y: visible !important;
    }

    .biography-details {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        padding: 10px !important;
    }

    .biography-panel {
        min-height: auto !important;
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .window {
        width: 90vw !important;
        height: 80vh !important;
        left: 5vw !important;
        top: 10vh !important;
    }

    .biography-details {
        grid-template-columns: 1fr !important;
    }
}
