:root {
    --bg-color: #B2EBF2;
    --window-bg: #FFFFFF;
    --border-color: #000000;
    --accent-color: #E0F7FA;
    --highlight-color: #80DEEA;
    --shadow-offset: 4px;
    --start-menu-bg: #c0c0c0;
    --start-sidebar-bg: #808080;
    --start-highlight: #000080;
    --start-text-highlight: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'VT323', monospace;
    background-color: var(--bg-color);
    overflow: hidden; /* Prevent scrolling */
    font-size: 18px;
    color: var(--border-color);
    user-select: none; /* Prevent selection generally */
}

/* Intro Overlay */
.intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #008080; /* Classic teal background */
    z-index: 30000; /* Above everything */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.intro-title {
    color: #fff;
    font-size: 3rem;
    margin: 0;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.2);
    text-align: center;
    padding: 0 20px;
}

.intro-box {
    background: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.5);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
}

.intro-header {
    background: #000080;
    color: #fff;
    padding: 5px 10px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.intro-content {
    padding: 20px;
    text-align: center;
}

.intro-content h2 {
    margin-top: 0;
    font-size: 2rem;
    margin-bottom: 15px;
}

.intro-steps {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 20px 0;
    background: #fff;
    border: 2px solid #808080;
    padding: 15px;
}

.intro-steps li {
    margin-bottom: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.intro-steps li:last-child {
    margin-bottom: 0;
}

.enter-btn {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    padding: 10px 30px;
    background: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 2px 2px 0 #000;
}

.enter-btn:active {
    border: 2px solid #000;
    border-right-color: #fff;
    border-bottom-color: #fff;
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Desktop Environment */
.desktop {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    padding: 20px;
    padding-bottom: 60px; /* Space for taskbar */
    background-image: 
        linear-gradient(to bottom, #B2EBF2 0%, #E0F7FA 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Pixel Art Clouds (CSS only) */
.clouds {
    position: fixed;
    top: 50px;
    left: -600px;
    width: 100px;
    height: 40px;
    background: #fff;
    box-shadow: 
        40px 0 0 0 #fff,
        -20px 20px 0 0 #fff,
        20px 20px 0 0 #fff,
        60px 20px 0 0 #fff;
    z-index: 0;
    opacity: 0.8;
    --scale: 1;
    animation: float 20s linear infinite;
    pointer-events: none; /* Let clicks pass through */
}

.clouds::after {
    content: '';
    position: absolute;
    top: 100px;
    left: 400px;
    width: 80px;
    height: 30px;
    background: #fff;
    box-shadow: 
        30px 0 0 0 #fff,
        -15px 15px 0 0 #fff,
        15px 15px 0 0 #fff,
        45px 15px 0 0 #fff;
}

/* Additional Clouds */
.clouds.c2 {
    top: 200px;
    --scale: 0.8;
    animation-duration: 25s;
    animation-delay: -5s;
}

.clouds.c3 {
    top: 400px;
    --scale: 1.2;
    animation-duration: 28s;
    animation-delay: -11s;
}

.clouds.c4 {
    top: 150px;
    --scale: 0.6;
    animation-duration: 35s;
    animation-delay: -21s;
}

.clouds.c5 {
    top: 350px;
    --scale: 0.9;
    animation-duration: 22s;
    animation-delay: -17s;
}

.clouds.c6 {
    top: 80px;
    --scale: 0.7;
    animation-duration: 32s;
    animation-delay: -16s;
}

.clouds.c7 {
    top: 500px;
    --scale: 1.1;
    animation-duration: 26s;
    animation-delay: -23s;
}

@keyframes float {
    from { transform: translateX(0) scale(var(--scale)); }
    to { transform: translateX(calc(100vw + 600px)) scale(var(--scale)); }
}

/* Desktop Shortcuts */
.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 0; /* Behind windows but clickable */
}

.shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    cursor: pointer;
    text-align: center;
    padding: 8px;
    border: 1px solid transparent;
}

.shortcut:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.shortcut .icon {
    font-size: 3.2rem;
    margin-bottom: 8px;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.2));
}

.shortcut .label {
    font-size: 1rem;
    color: #000;
    text-shadow: 1px 1px 0 #fff;
    background: rgba(255,255,255,0.5);
    padding: 2px 4px;
}

/* Windows */
.window {
    display: none; /* Hidden by default */
    background: var(--window-bg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--border-color);
    width: min(800px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    min-width: 320px;
    min-height: 200px;
    max-height: calc(100vh - 80px);
    resize: both;
    overflow: hidden; /* Keep title bar visible; body scrolls inside content */
    flex-direction: column;
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
    /* For maximize/restore transition (width/height removed to keep manual resize snappy) */
    transition: top 0.15s ease, left 0.15s ease, transform 0.15s ease;
}

.window.open {
    display: flex;
}

/* Class to apply when maximized */
.window.maximized {
    width: 100vw !important;
    height: calc(100vh - 40px) !important; /* Subtract taskbar height */
    max-width: 100vw !important; /* Override base max-width so it truly fills */
    max-height: calc(100vh - 40px) !important; /* Override base max-height */
    top: 0 !important;
    left: 0 !important;
    z-index: 999 !important;
    margin: 0;
    border: none;
    box-shadow: none;
    resize: none;
}

.title-bar {
    border-bottom: 2px solid var(--border-color);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--window-bg);
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none; /* Prevent selection while dragging */
}

.title-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
}

.control-btn:hover {
    background: var(--border-color);
    color: #fff;
}

.window-content {
    padding: 20px;
    /* Allow text selection inside content */
    user-select: text;
    flex: 1 1 auto;
    overflow: auto;
    min-height: 0; /* Prevent overflow issues when height constrained */
}

/* Hero Window */
.hero-content {
    display: flex;
    align-items: flex-start; /* Align to top so instructions don't push avatar */
    gap: 30px;
}

.avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar-frame {
    width: 120px;
    height: 120px;
    border: 2px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-bubble {
    background: #fff;
    border: 2px solid var(--border-color);
    padding: 10px;
    position: relative;
    box-shadow: 2px 2px 0px var(--border-color);
}

.status-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--border-color);
}

.status-bubble::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
}

.hero-text h1 {
    font-size: 3rem;
    margin: 0;
    line-height: 1;
}

.hero-text h2 {
    font-size: 1.5rem;
    margin: 10px 0;
    font-weight: normal;
    color: #555;
}

/* Instructions Box in Hero */
.instruction-box {
    margin-top: 20px;
    padding: 15px;
    background: #fdfdc9; /* Post-it yellow ish */
    border: 2px solid var(--border-color);
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
    font-size: 1rem;
}

.instruction-box p {
    margin: 0 0 5px 0;
}

.mini-list {
    padding-left: 20px;
    margin: 0;
    list-style: none;
}

.mini-list li {
    margin-bottom: 3px;
}

/* Grid Layout for Specs */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr;
    }
}

.panel {
    border: 2px solid var(--border-color);
    padding: 15px;
    background: var(--accent-color);
    box-shadow: inset 2px 2px 0px rgba(0,0,0,0.05);
}

.panel h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.job-entry {
    margin-bottom: 15px;
}

.job-entry h4 {
    margin: 0;
    font-size: 1.2rem;
}

.company {
    font-style: italic;
    margin: 5px 0;
    font-size: 0.9rem;
}

ul {
    padding-left: 20px;
}

/* Skills & Progress Bars */
.flex-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.flex-layout .panel {
    flex: 1;
    min-width: 250px;
}

.right-column-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-width: 250px;
}

.certs-panel {
    /* background: var(--highlight-color); Removed to match other panels */
}

.retro-list {
    list-style: none;
    padding: 0;
}

.retro-list li {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.progress-bar {
    height: 20px;
    border: 2px solid var(--border-color);
    background: #fff;
    margin-top: 5px;
    position: relative;
}

.progress-bar .fill {
    height: 100%;
    background: var(--highlight-color);
    border-right: 2px solid var(--border-color);
}

/* Contact Window */
.contact-content {
    text-align: center;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.contact-item {
    display: inline-block;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    text-decoration: none;
    color: var(--border-color);
    background: #fff;
    box-shadow: 4px 4px 0px var(--border-color);
    transition: transform 0.1s, box-shadow 0.1s;
}

.contact-item:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--border-color);
    background: var(--highlight-color);
}

/* Taskbar Styles */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #c0c0c0;
    border-top: 2px solid #fff;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 10000; /* Keep on top */
    box-shadow: inset 0 1px 0 #fff;
}

.start-btn {
    height: 100%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    background: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow: 1px 1px 0 #000;
    cursor: pointer;
}

.start-btn:active, .start-btn.active {
    border: 2px solid #000;
    border-right-color: #fff;
    border-bottom-color: #fff;
    box-shadow: none;
    transform: translate(1px, 1px);
    background: #a0a0a0; /* Slightly darker when active */
}

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

.tasks-area {
    flex: 1;
    display: flex;
    gap: 5px;
    padding: 0 5px;
    overflow-x: auto; /* Allow scrolling if too many tasks */
}

/* Taskbar Items (Windows) */
.taskbar-item {
    height: 100%;
    padding: 0 10px;
    min-width: 120px;
    max-width: 200px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'VT323', monospace;
    font-size: 1rem;
    background: #c0c0c0;
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow: 1px 1px 0 #000;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-item.active {
    border: 2px solid #000;
    border-right-color: #fff;
    border-bottom-color: #fff;
    box-shadow: none;
    background: #e0e0e0; /* Highlight active window */
    font-weight: bold;
}

.taskbar-item:active {
    transform: translate(1px, 1px);
}

.system-tray {
    height: 100%;
    padding: 0 10px;
    border: 2px solid #808080;
    border-right-color: #fff;
    border-bottom-color: #fff;
    background: #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: inset 1px 1px 0 #000;
}

/* Start Menu Styles */
.start-menu {
    position: fixed;
    bottom: 42px; /* Just above taskbar */
    left: 2px;
    width: 250px;
    background: var(--start-menu-bg);
    border: 2px solid #fff;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
    z-index: 10001; /* Above taskbar */
    display: flex;
}

.start-menu .sidebar {
    width: 40px;
    background: var(--start-sidebar-bg);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
}

.start-menu .sidebar-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.start-menu .menu-items {
    flex: 1;
    list-style: none;
    padding: 5px;
    margin: 0;
}

.start-menu .menu-item {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #000;
}

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

.start-menu .divider {
    height: 2px;
    background: #808080;
    border-bottom: 1px solid #fff;
    margin: 5px 0;
}

/* Shutdown Overlay */
.shutdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 20000; /* Topmost */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'VT323', monospace;
}

.shutdown-message {
    text-align: center;
}

.shutdown-message p {
    font-size: 2rem;
    color: #ff5555; /* Retro red error color */
    margin-bottom: 20px;
}

.restart-btn {
    padding: 10px 20px;
    font-size: 1.2rem;
    font-family: inherit;
    cursor: pointer;
    background: #c0c0c0;
    border: 2px solid #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .desktop-icons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}