/* ============================================
   Windows 98 Portfolio — Master Stylesheet
   ============================================ */

/* --- Reset & Base --- */
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    /* Windows 98 System Colors */
    --win-bg: #008080;
    --win-silver: #c0c0c0;
    --win-dark-silver: #a0a0a0;
    --win-white: #ffffff;
    --win-black: #000000;
    --win-title-blue: #000080;
    --win-title-blue-light: #1084d0;
    --win-title-inactive: #808080;
    --win-highlight: #dfdfdf;
    --win-shadow: #808080;
    --win-dark-shadow: #404040;
    --win-btn-face: #c0c0c0;
    --win-btn-highlight: #ffffff;
    --win-btn-shadow: #808080;
    --win-btn-dark-shadow: #000000;
    --win-selection: #000080;
    --win-selection-text: #ffffff;
    --win-window-bg: #c0c0c0;
    --win-content-bg: #ffffff;
    --win-taskbar-height: 48px;
    --win-font: 'VT323', 'Press Start 2P', 'MS Sans Serif', 'Tahoma', sans-serif;
    --win-font-pixel: 'Press Start 2P', 'VT323', monospace;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background-color: var(--win-bg);
    font-family: var(--win-font);
    font-size: 16px;
    color: var(--win-black);
    user-select: none;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/icons/Windows%20light%202%2016x9.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    pointer-events: none;
}

body.dark-mode::before {
    background-image: url('../assets/icons/Windows%20Night%2016x9.png');
}

body.dark-mode {
    --win-bg: #1a1a1a;
    --win-silver: #2a2a2a;
    --win-dark-silver: #1a1a1a;
    --win-white: #f5f5f5;
    --win-black: #e0e0e0;
    --win-title-blue: #1c1c1c;
    --win-title-blue-light: #383838;
    --win-highlight: #555555;
    --win-shadow: #1a1a1a;
    --win-dark-shadow: #000000;
    --win-btn-face: #383838;
    --win-btn-highlight: #555555;
    --win-btn-shadow: #1a1a1a;
    --win-btn-dark-shadow: #000000;
    --win-selection: #5c85d6;
    --win-selection-text: #ffffff;
    --win-window-bg: #383838;
    --win-content-bg: #242424;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    z-index: 1000;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    background: var(--win-btn-face);
    border: 3px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 2px 2px 0 var(--win-highlight), inset -2px -2px 0 var(--win-btn-shadow), 4px 4px 8px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.theme-toggle:active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 2px 2px 0 var(--win-btn-shadow), inset -2px -2px 0 var(--win-highlight);
    padding-top: 4px;
    padding-left: 4px;
}

/* --- 3D Border Utilities --- */
.border-outset {
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
}

.border-inset {
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow), inset -1px -1px 0 var(--win-highlight);
}

/* --- Desktop --- */
#desktop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--win-taskbar-height);
    overflow: hidden;
}

/* --- Desktop Icons --- */
.desktop-icons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    position: absolute;
    top: 0;
    left: 0;
}

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

.desktop-icon:hover {
    background: rgba(0, 0, 128, 0.15);
}

.desktop-icon:focus,
.desktop-icon.selected {
    border: 1px dotted var(--win-white);
    background: rgba(0, 0, 128, 0.3);
}

.desktop-icon .icon-image {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 4px;
    image-rendering: pixelated;
}

.desktop-icon .icon-label {
    font-family: var(--win-font);
    font-size: 14px;
    color: var(--win-white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    line-height: 1.3;
    word-wrap: break-word;
    text-align: center;
}

.desktop-icon.selected .icon-label {
    background: var(--win-selection);
    color: var(--win-selection-text);
    text-shadow: none;
}



/* --- Windows --- */
.window {
    position: absolute;
    background: var(--win-window-bg);
    display: none;
    z-index: 10;
    min-width: 320px;
    min-height: 240px;
    /* 3D outset border */
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    animation: win-open 0.15s ease-out;
}

@keyframes win-open {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.window.active {
    display: flex;
    flex-direction: column;
}

.window.minimized {
    display: none !important;
}

/* Fullscreen on mobile */
@media (max-width: 600px) {
    .window {
        min-width: 100vw !important;
        min-height: 100vh !important;
        width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        border: none;
        box-shadow: none;
    }
}

@media (min-width: 601px) {
    .window {
        min-width: 480px;
        min-height: 360px;
    }
}

/* --- Window Title Bar --- */
.window-header {
    background: linear-gradient(90deg, var(--win-title-blue) 0%, var(--win-title-blue-light) 100%);
    color: var(--win-white);
    padding: 3px 4px;
    display: flex;
    align-items: center;
    height: 26px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
    gap: 4px;
}

.window.inactive .window-header {
    background: linear-gradient(90deg, var(--win-title-inactive) 0%, #b0b0b0 100%);
}

.window-icon {
    width: 18px;
    height: 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.window-title {
    flex: 1;
    font-family: var(--win-font);
    font-size: 15px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.5px;
    padding-left: 2px;
}

.window-buttons {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
}

/* Win98-style window buttons */
.win-btn {
    width: 18px;
    height: 18px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    font-family: 'Marlett', Arial, sans-serif;
    color: var(--win-black);
    padding: 0;
    line-height: 1;
}

.win-btn:active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow), inset -1px -1px 0 var(--win-highlight);
    padding: 1px 0 0 1px;
}

.win-btn.close-btn {
    margin-left: 2px;
}

/* --- Window Content --- */
.window-content {
    flex: 1;
    overflow-y: auto;
    background: var(--win-content-bg);
    margin: 3px;
    padding: 12px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--win-black);
    /* Inset border for content area */
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow), inset -1px -1px 0 var(--win-highlight);
}

/* Scrollbar styling */
.window-content::-webkit-scrollbar {
    width: 18px;
}

.window-content::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-left: 1px solid var(--win-btn-shadow);
}

.window-content::-webkit-scrollbar-thumb {
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
}

.window-content::-webkit-scrollbar-button {
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    height: 18px;
}

/* --- Window Resize Handle --- */
.window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(
        135deg,
        transparent 30%,
        var(--win-btn-shadow) 30%,
        var(--win-btn-shadow) 35%,
        transparent 35%,
        transparent 45%,
        var(--win-btn-shadow) 45%,
        var(--win-btn-shadow) 50%,
        transparent 50%,
        transparent 60%,
        var(--win-btn-shadow) 60%,
        var(--win-btn-shadow) 65%,
        transparent 65%
    );
    display: none;
}

@media (min-width: 601px) {
    .window-resize-handle {
        display: block;
    }
}

/* --- Profile Section --- */
.profile-section {
    text-align: center;
    margin-bottom: 16px;
}

.profile-image {
    width: 80px;
    height: 80px;
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    overflow: hidden;
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Typography --- */
h1 {
    font-family: var(--win-font);
    font-size: 20px;
    color: var(--win-title-blue);
    margin-bottom: 8px;
    font-weight: bold;
}

h2 {
    font-family: var(--win-font);
    font-size: 18px;
    color: var(--win-title-blue);
    margin: 12px 0 8px;
    font-weight: bold;
}

h3 {
    font-family: var(--win-font);
    font-size: 16px;
    color: var(--win-dark-shadow);
    margin: 8px 0 6px;
    font-weight: bold;
}

p {
    font-family: var(--win-font);
    font-size: 15px;
    line-height: 1.5;
    margin: 6px 0;
    color: var(--win-black);
}

/* --- Bio Section --- */
.bio {
    margin: 8px 0;
    padding: 8px;
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
}

/* --- Skills List --- */
.skills-list {
    margin: 12px 0;
    padding: 8px;
    background: var(--win-content-bg);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
}

.skills-list h3 {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--win-btn-shadow);
}

.skills-list ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    font-size: 14px;
    font-family: var(--win-font);
}

@media (max-width: 480px) {
    .skills-list ul {
        grid-template-columns: 1fr;
    }
}

.skills-list li {
    padding: 4px 6px;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 6px;
}

.skills-list li::before {
    content: '•';
    color: var(--win-title-blue);
    font-weight: bold;
}

.skills-list li:hover {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

/* --- Contact Section --- */
.contact-section {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--win-btn-shadow);
}

.contact-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.contact-link {
    background: var(--win-btn-face);
    color: var(--win-black);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    padding: 4px 12px;
    cursor: pointer;
    font-family: var(--win-font);
    font-size: 14px;
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 0.3px;
}

.contact-link:active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow), inset -1px -1px 0 var(--win-highlight);
    padding: 5px 11px 3px 13px;
}

.contact-link:hover {
    background: #d4d0c8;
}

/* --- Divider --- */
.divider {
    border: none;
    border-top: 1px solid var(--win-btn-shadow);
    border-bottom: 1px solid var(--win-btn-highlight);
    margin: 10px 0;
}

/* --- Thumbnail Grid --- */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 480px) {
    .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (min-width: 769px) {
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
}

.thumbnail {
    cursor: pointer;
    text-align: center;
}

.thumbnail-image {
    width: 100%;
    height: 110px;
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    overflow: hidden;
    position: relative;
}

@media (min-width: 769px) {
    .thumbnail-image {
        height: 130px;
        font-size: 42px;
    }
}

.thumbnail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-play {
    position: absolute;
    font-size: 28px;
    color: var(--win-white);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
    opacity: 0.6;
    transition: opacity 0.15s;
}

.thumbnail:hover .thumbnail-play {
    opacity: 1;
}

.thumbnail:hover .thumbnail-image {
    border-color: var(--win-title-blue) var(--win-title-blue) var(--win-title-blue) var(--win-title-blue);
}

.thumbnail-label {
    font-family: var(--win-font);
    font-size: 13px;
    color: var(--win-black);
    margin-top: 4px;
    font-weight: bold;
}

/* --- Video Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--win-window-bg);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow),
                4px 4px 0 rgba(0,0,0,0.3);
    width: 90vw;
    max-width: 900px;
    height: 75vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    animation: win-open 0.15s ease-out;
}

@media (max-width: 480px) {
    .modal-content {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border: none;
    }
}

.modal-header {
    background: linear-gradient(90deg, var(--win-title-blue) 0%, var(--win-title-blue-light) 100%);
    color: var(--win-white);
    padding: 3px 4px;
    display: flex;
    align-items: center;
    height: 26px;
    user-select: none;
    flex-shrink: 0;
    gap: 4px;
}

.modal-title {
    flex: 1;
    font-family: var(--win-font);
    font-size: 15px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close {
    width: 18px;
    height: 18px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--win-black);
    padding: 0;
    flex-shrink: 0;
}

.modal-close:active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow);
    padding: 1px 0 0 1px;
}

.modal-body {
    flex: 1;
    margin: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--win-black);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

.video-player {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.video-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Taskbar --- */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--win-taskbar-height);
    background: var(--win-silver);
    border-top: 2px solid;
    border-top-color: var(--win-btn-highlight);
    display: flex;
    align-items: center;
    z-index: 999;
    padding: 2px 4px;
    gap: 4px;
    box-shadow: inset 0 1px 0 var(--win-highlight);
}

/* Start Button */
.start-button {
    height: 38px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 12px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    cursor: pointer;
    font-family: var(--win-font);
    font-size: 18px;
    font-weight: bold;
    color: var(--win-black);
    flex-shrink: 0;
    user-select: none;
}

.start-button:active,
.start-button.active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow), inset -1px -1px 0 var(--win-highlight);
    padding: 3px 7px 1px 9px;
}

.start-button .start-logo {
    font-size: 24px;
    line-height: 1;
}

.start-button .start-text {
    letter-spacing: 0.3px;
}

/* Taskbar divider */
.taskbar-divider {
    width: 2px;
    height: 36px;
    border-left: 1px solid var(--win-btn-shadow);
    border-right: 1px solid var(--win-btn-highlight);
    flex-shrink: 0;
    margin: 0 4px;
}

/* Quick Launch area */
.quick-launch {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    padding-right: 4px;
}

.quick-launch-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 22px;
    border: 1px solid transparent;
}

.quick-launch-btn:hover {
    border: 1px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
}

.quick-launch-btn:active {
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

/* Taskbar window buttons */
.taskbar-windows {
    flex: 1;
    display: flex;
    gap: 2px;
    overflow: hidden;
    min-width: 0;
}

.taskbar-window-btn {
    height: 34px;
    min-width: 140px;
    max-width: 220px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 8px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    cursor: pointer;
    font-family: var(--win-font);
    font-size: 15px;
    color: var(--win-black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.taskbar-window-btn.active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow), inset -1px -1px 0 var(--win-highlight);
    background: #d4d0c8;
    font-weight: bold;
}

.taskbar-window-btn .taskbar-btn-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.taskbar-window-btn .taskbar-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* System Tray */
.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 10px;
    height: 38px;
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
    flex-shrink: 0;
}

.system-tray .tray-icon {
    font-size: 18px;
    cursor: default;
}

.system-tray .music-toggle {
    cursor: pointer;
    padding: 1px 3px;
    border: 1px solid transparent;
    user-select: none;
}

.system-tray .music-toggle:hover {
    border: 1px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-shadow) var(--win-btn-shadow) var(--win-btn-highlight);
}

.system-tray .music-toggle:active {
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

/* Volume control wrapper */
.volume-control {
    position: relative;
    display: flex;
    align-items: center;
}

.volume-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 8px;
    z-index: 1001;
}

.volume-control:hover .volume-popup {
    display: block;
}

.volume-popup-inner {
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow),
                2px 2px 0 rgba(0,0,0,0.2);
    padding: 10px 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Vertical range slider — Win98 style */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 22px;
    height: 100px;
    background: transparent;
    cursor: pointer;
}

.volume-slider::-webkit-slider-runnable-track {
    width: 6px;
    background: var(--win-content-bg);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 10px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight);
    margin-left: -4px;
    cursor: pointer;
}

.volume-slider::-moz-range-track {
    width: 6px;
    background: var(--win-content-bg);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 10px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight);
    cursor: pointer;
    border-radius: 0;
}

.volume-label {
    font-family: var(--win-font);
    font-size: 11px;
    color: var(--win-black);
    text-align: center;
}

.system-tray .tray-clock {
    font-family: var(--win-font);
    font-size: 14px;
    margin-left: 4px;
}

/* Alayan Visuals Brand Text */
.taskbar-brand {
    font-family: var(--win-font);
    font-size: 18px;
    color: var(--win-dark-shadow);
    font-weight: bold;
    padding: 0 10px;
    text-shadow: 1px 1px 0px var(--win-btn-highlight);
    user-select: none;
}

/* --- Start Menu --- */
.start-menu {
    display: none;
    position: fixed;
    bottom: var(--win-taskbar-height);
    left: 0;
    width: 200px;
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow),
                4px 4px 0 rgba(0,0,0,0.25);
    z-index: 1000;
    flex-direction: column;
    animation: win-open 0.1s ease-out;
}

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

.start-menu-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    background: linear-gradient(180deg, var(--win-title-blue) 0%, #000040 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
}

.start-menu-sidebar-text {
    color: var(--win-silver);
    font-family: var(--win-font);
    font-size: 18px;
    font-weight: bold;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
}

.start-menu-items {
    margin-left: 28px;
    display: flex;
    flex-direction: column;
    padding: 3px 0;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--win-font);
    font-size: 14px;
    color: var(--win-black);
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
}

.start-menu-item:hover {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

.start-menu-item .menu-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.start-menu-item .menu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-menu-separator {
    height: 2px;
    margin: 3px 4px 3px 32px;
    border-top: 1px solid var(--win-btn-shadow);
    border-bottom: 1px solid var(--win-btn-highlight);
}

/* --- Mobile Taskbar Adjustments --- */
@media (max-width: 480px) {
    .taskbar {
        height: 32px;
    }

    .start-button {
        height: 24px;
        font-size: 12px;
        padding: 1px 6px;
    }

    .taskbar-windows {
        display: none;
    }

    .quick-launch {
        display: none;
    }

    .system-tray .tray-clock {
        font-size: 11px;
    }

    .start-menu {
        width: 180px;
    }

    #desktop {
        bottom: 32px;
    }
}

/* --- Status Bar for windows --- */
.window-statusbar {
    height: 22px;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 2px;
}

.statusbar-section {
    flex: 1;
    padding: 1px 4px;
    font-family: var(--win-font);
    font-size: 12px;
    color: var(--win-black);
    border: 1px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
}

/* --- Address Bar --- */
.address-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 3px 6px;
    background: var(--win-content-bg);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
    font-family: var(--win-font);
    font-size: 13px;
}

.address-label {
    color: var(--win-black);
    font-weight: bold;
    flex-shrink: 0;
}

.address-path {
    color: var(--win-black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Folder Toolbar --- */
.folder-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.toolbar-btn {
    background: var(--win-btn-face);
    color: var(--win-black);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    padding: 3px 10px;
    cursor: pointer;
    font-family: var(--win-font);
    font-size: 13px;
    font-weight: bold;
}

.toolbar-btn:active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow), inset -1px -1px 0 var(--win-highlight);
    padding: 4px 9px 2px 11px;
}

.toolbar-btn:hover {
    background: #d4d0c8;
}

/* --- Folder Grid --- */
.folder-grid {
    display: flex;
    gap: 24px;
    padding: 20px;
    flex-wrap: wrap;
}

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

.folder-icon:hover {
    background: rgba(0, 0, 128, 0.08);
}

.folder-icon.selected {
    border: 1px dotted var(--win-black);
    background: rgba(0, 0, 128, 0.15);
}

.folder-icon.selected .folder-icon-label {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

.folder-icon-img {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 4px;
}

.folder-icon-label {
    font-family: var(--win-font);
    font-size: 13px;
    color: var(--win-black);
    line-height: 1.3;
    word-wrap: break-word;
    padding: 1px 2px;
}

/* --- Sliding About-Me Panel --- */

/* Dark overlay behind panel */
.about-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 199;
    transition: opacity 0.3s ease;
}

.about-panel-overlay.open {
    display: block;
}

/* Toggle tab on right edge */
.about-panel-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 198;
    background: var(--win-silver);
    border: 2px solid;
    border-right: none;
    border-color: var(--win-btn-highlight) transparent var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset 0 -1px 0 var(--win-btn-shadow),
                -2px 2px 4px rgba(0,0,0,0.15);
    cursor: pointer;
    padding: 12px 6px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    border-radius: 4px 0 0 4px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.about-panel-toggle:hover {
    background: #d4d0c8;
}

.about-panel-toggle:active {
    border-color: var(--win-btn-dark-shadow) transparent var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow);
}

.about-panel-toggle-text {
    font-family: var(--win-font);
    font-size: 13px;
    font-weight: bold;
    color: var(--win-black);
    letter-spacing: 1px;
}

/* The sliding panel */
.about-panel {
    position: fixed;
    top: 0;
    right: -360px;
    width: 340px;
    height: calc(100vh - var(--win-taskbar-height));
    background: var(--win-window-bg);
    border-left: 2px solid;
    border-left-color: var(--win-btn-highlight);
    box-shadow: -4px 0 12px rgba(0,0,0,0.25),
                inset 1px 0 0 var(--win-highlight);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.about-panel.open {
    right: 0;
}

/* Also hide the toggle when panel is open */
.about-panel.open ~ .about-panel-toggle,
.about-panel-toggle.hidden {
    right: -60px;
}

/* Panel header */
.about-panel-header {
    background: linear-gradient(90deg, var(--win-title-blue) 0%, var(--win-title-blue-light) 100%);
    color: var(--win-white);
    padding: 3px 6px;
    display: flex;
    align-items: center;
    height: 26px;
    flex-shrink: 0;
    gap: 4px;
}

.about-panel-title {
    flex: 1;
    font-family: var(--win-font);
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.about-panel-close {
    width: 18px;
    height: 18px;
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: var(--win-black);
    padding: 0;
    flex-shrink: 0;
}

.about-panel-close:active {
    border-color: var(--win-btn-dark-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-dark-shadow);
    box-shadow: inset 1px 1px 0 var(--win-btn-shadow);
    padding: 1px 0 0 1px;
}

/* Panel body */
.about-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    margin: 3px;
    background: var(--win-content-bg);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow), inset -1px -1px 0 var(--win-highlight);
}

/* Scrollbar for panel body */
.about-panel-body::-webkit-scrollbar {
    width: 18px;
}
.about-panel-body::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-left: 1px solid var(--win-btn-shadow);
}
.about-panel-body::-webkit-scrollbar-thumb {
    background: var(--win-btn-face);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
}

/* Photo */
.about-panel-photo {
    width: 200px;
    height: 200px;
    margin: 0 auto 12px;
    background: var(--win-silver);
    border: 3px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 2px 2px 0 var(--win-dark-shadow), inset -2px -2px 0 var(--win-highlight),
                0 4px 8px rgba(0,0,0,0.15);
    overflow: hidden;
}

.about-panel-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    display: block;
}

/* Name & role */
.about-panel-name {
    text-align: center;
    font-family: var(--win-font);
    font-size: 22px;
    color: var(--win-title-blue);
    margin: 4px 0 2px;
    font-weight: bold;
}

.about-panel-role {
    text-align: center;
    font-family: var(--win-font);
    font-size: 14px;
    color: var(--win-shadow);
    margin: 0 0 8px;
    font-style: italic;
}

/* Divider */
.about-panel-divider {
    border: none;
    border-top: 1px solid var(--win-btn-shadow);
    border-bottom: 1px solid var(--win-btn-highlight);
    margin: 10px 0;
}

/* Bio */
.about-panel-bio {
    font-family: var(--win-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--win-black);
    padding: 8px;
    background: var(--win-silver);
    border: 2px solid;
    border-color: var(--win-btn-shadow) var(--win-btn-highlight) var(--win-btn-highlight) var(--win-btn-shadow);
    box-shadow: inset 1px 1px 0 var(--win-dark-shadow);
}

/* Skills */
.about-panel-skills h3 {
    font-family: var(--win-font);
    font-size: 15px;
    color: var(--win-dark-shadow);
    margin-bottom: 8px;
    font-weight: bold;
}

.about-panel-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.skill-tag {
    background: var(--win-btn-face);
    color: var(--win-black);
    border: 2px solid;
    border-color: var(--win-btn-highlight) var(--win-btn-dark-shadow) var(--win-btn-dark-shadow) var(--win-btn-highlight);
    box-shadow: inset 1px 1px 0 var(--win-highlight), inset -1px -1px 0 var(--win-btn-shadow);
    padding: 3px 8px;
    font-family: var(--win-font);
    font-size: 12px;
    cursor: default;
    user-select: none;
}

.skill-tag:hover {
    background: var(--win-selection);
    color: var(--win-selection-text);
}

/* Contact */
.about-panel-contact h3 {
    font-family: var(--win-font);
    font-size: 15px;
    color: var(--win-dark-shadow);
    margin-bottom: 8px;
    font-weight: bold;
}

.about-panel-contact .contact-link {
    display: block;
    margin-bottom: 4px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .about-panel {
        width: 85vw;
        right: -85vw;
    }

    .about-panel-toggle {
        padding: 8px 5px;
    }

    .about-panel-toggle-text {
        font-size: 11px;
    }

    .about-panel-photo {
        width: 100px;
        height: 100px;
    }
}

/* =========================================
   Mobile Responsiveness (Global)
   ========================================= */
@media (max-width: 768px) {
    /* --- Windows (Force Maximized) --- */
    /* Override inline styles for windows to make them full screen on mobile */
    .window {
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: calc(100dvh - 36px) !important; /* Screen minus taskbar, dynamic viewport height */
        transform: none !important;
        border-width: 0 0 3px 0; /* Remove border on sides/top for cleaner look on small screens */
    }

    .window-content {
        height: calc(100% - 30px); /* Adjust for header */
        overflow-y: auto;
    }

    /* Hide maximize and minimize buttons since we force maximize anyway */
    .win-btn.min-btn,
    .win-btn.max-btn {
        display: none;
    }

    /* Keep close button slightly larger for touch */
    .win-btn.close-btn {
        width: 24px;
        height: 20px;
    }

    .window-resize-handle {
        display: none !important; /* Disable manual resizing */
    }

    /* --- Desktop Icons --- */
    .desktop-icons {
        gap: 20px 10px; /* More vertical space */
        align-content: flex-start;
    }

    .desktop-icon {
        width: 70px; /* Slightly wider for labels */
    }

    .icon-image {
        font-size: 36px;
        line-height: 48px;
    }

    /* --- Start Menu --- */
    .start-menu {
        width: 90vw; /* Take up most of the screen */
        max-width: 320px; /* But not too much on tablets */
    }

    .start-menu-item {
        padding: 10px 12px; /* Bigger touch targets */
        font-size: 14px;
    }

    .start-menu-sidebar {
        width: 30px;
        padding-top: 10px;
    }

    .start-menu-sidebar-text {
        font-size: 14px;
        letter-spacing: 1px;
    }

    /* --- Taskbar --- */
    .taskbar {
        padding: 0 4px;
    }

    .start-button {
        padding: 2px 6px;
    }

    .quick-launch-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .taskbar-windows {
        overflow-x: auto; /* Scroll if too many windows open */
        overflow-y: hidden;
        white-space: nowrap;
        padding-bottom: 2px; /* Allow scrollbar if necessary */
    }

    /* Hide scrollbar visually but keep functionality */
    .taskbar-windows::-webkit-scrollbar {
        height: 2px;
    }
    .taskbar-windows::-webkit-scrollbar-thumb {
        background: var(--win-shadow);
    }

    .taskbar-window-btn {
        flex-shrink: 0;
        width: 120px; /* Fixed width on mobile */
        padding: 2px 4px;
        font-size: 11px;
    }

    .system-tray {
        padding: 2px 4px;
    }

    .tray-clock {
        font-size: 11px;
    }

    /* --- About Panel Sliding Overlay (Adjust the existing 480px rule) --- */
    .about-panel {
        width: 90vw; /* Take up most of the screen */
        right: -90vw;
    }
    
    .about-panel.open {
        right: 0;
    }

}

/* --- Global Loading Screen --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
    pointer-events: all;
}

#loader.hidden {
    opacity: 0;
    pointer-events: none;
}

#loader-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
