/* --- RESET & BASICS --- */
body {
    background: url('bliss.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    overflow: hidden;
}

/* --- ICONS --- */
#desktop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100% - 30px);
    /* Subtract taskbar height */
    z-index: 0;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 10px;
    gap: 10px;
    pointer-events: none;
    /* Let clicks pass through empty areas if needed */
}

.desktop-icon {
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-shadow: 1px 1px 1px black;
    cursor: pointer;
    border: 1px solid transparent;
    /* Reserve space for border */
    text-align: center;
    font-family: 'Tahoma', sans-serif;
    font-size: 13px;
    pointer-events: auto;
    /* Re-enable clicks on icons */
}

.desktop-icon:hover {
    background-color: rgba(49, 106, 197, 0.5);
    /* XP Blue tint */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.desktop-icon:active {
    background-color: rgba(49, 106, 197, 0.7);
}

.desktop-icon img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.desktop-icon img[src="notepad.png"],
.desktop-icon img[src="outlook.png"] {
    transform: scale(1.3);
    margin-top: 5px;
    /* Offset the scale slightly to keep it centered */
}

.desktop-icon span {
    background-color: transparent;
    padding: 2px 4px;
    border-radius: 2px;
}



.icon-notepad {
    width: 16px;
    height: 16px;
    background-image: url('notepad.png');
    background-size: contain;
    background-repeat: no-repeat;
}

.icon-ie {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    background-image: url('ie.png');
    background-size: contain;
    background-repeat: no-repeat;
}

/* --- WINDOW CONTAINER --- */
.window {
    position: absolute;
    width: 800px;
    height: 600px;
    background-color: #ECE9D8;
    border: 1px solid #0055EA;
    border-radius: 8px 8px 0 0;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

/* --- TITLE BAR --- */
.title-bar {
    background: linear-gradient(180deg, #0058EE 0%, #3593FF 4%, #288EFF 18%, #127DFF 100%);
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #003C74;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px #0f1089;
    height: 30px;
    box-sizing: border-box;
    border-radius: 6px 6px 0 0;
    cursor: default;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.control-btn {
    width: 21px;
    height: 21px;
    background: #ECE9D8;
    border: 1px solid #fff;
    border-radius: 3px;
    box-shadow: inset -1px -1px 1px #888, inset 1px 1px 1px #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    color: #000;
    cursor: pointer;
    font-family: sans-serif;
}

.close-btn {
    background: #E05149;
    color: white;
    font-weight: bold;
}

/* --- MENU BAR --- */
.menu-bar {
    background-color: #ECE9D8;
    padding: 2px 0;
    display: flex;
    border-bottom: 1px solid #D4D0C8;
    position: relative;
    z-index: 10;
}

.menu-item {
    position: relative;
    padding: 2px 10px;
    font-size: 13px;
    color: #000;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    display: block;
}

.menu-item:hover {
    background-color: #316AC5;
    color: white;
}

/* --- DROPDOWN --- */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 150px;
    border: 1px solid #999;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    padding: 2px;
    z-index: 999;
    padding-top: 10px;
    margin-top: -5px;
}

.menu-item-container:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: black;
    padding: 4px 15px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    background-color: white;
}

.dropdown-content a:hover {
    background-color: #316AC5;
    color: white;
}

/* --- CONTENT AREA --- */
.content-area {
    background-color: white;
    flex-grow: 1;
    padding: 10px;
    font-family: 'Lucida Console', 'Courier New', monospace;
    font-size: 14px;
    overflow-y: auto;
    border-top: 1px solid #888;
    outline: none;
    line-height: 1.5;
    white-space: pre-wrap;
}

/* --- CLIPPY --- */
#clippy-container {
    position: fixed;
    bottom: -200px;
    right: 20px;
    width: 150px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: clippy-pop 0.5s ease-out forwards;
    animation-delay: 0.5s;
    font-family: 'Tahoma', sans-serif;
}

@keyframes clippy-pop {
    0% {
        bottom: -200px;
    }

    100% {
        bottom: 45px;
    }
}

.clippy-bubble {
    background-color: #FFFFCC;
    border: 1px solid black;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 11px;
    color: black;
    margin-bottom: 10px;
    position: relative;
    text-align: center;
    width: 140px;
}

.clippy-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -6px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
}

.clippy-bubble::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    margin-left: -6px;
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #FFFFCC transparent transparent transparent;
    z-index: 1;
}

.clippy-btn {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 6px;
    border: 1px solid #999;
    background: #ECE9D8;
    cursor: pointer;
    font-size: 10px;
}

.clippy-btn:hover {
    background: #fff;
}

.clippy-img {
    width: 100px;
    height: auto;
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#clippy-container.clippy-shrunk .clippy-bubble,
#clippy-container.clippy-shrunk #clippy-chat {
    display: none !important;
}

#clippy-container.clippy-shrunk .clippy-img {
    transform: scale(0.6);
    transform-origin: bottom right;
    cursor: pointer;
    opacity: 0.7;
}

#clippy-container.clippy-shrunk .clippy-img:hover {
    opacity: 1;
}

/* --- IE6 WINDOW --- */
#ie6-window {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -60%);
    width: 700px;
    height: 500px;
    background-color: #ECE9D8;
    border: 1px solid #0055EA;
    border-radius: 8px 8px 0 0;
    box-shadow: 10px 10px 25px rgba(0, 0, 0, 0.6);
    flex-direction: column;
    z-index: 2000;
}

.ie6-title-bar {
    background: linear-gradient(180deg, #0058EE 0%, #3593FF 4%, #288EFF 18%, #127DFF 100%);
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px #0f1089;
    height: 28px;
    border-radius: 6px 6px 0 0;
    cursor: default;
}

.ie6-menu-bar {
    padding: 2px 5px;
    border-bottom: 1px solid #D4D0C8;
    font-size: 12px;
    display: flex;
    gap: 10px;
}

.ie6-toolbar {
    padding: 5px;
    border-bottom: 1px solid #D4D0C8;
    display: flex;
    gap: 5px;
    align-items: center;
}

.ie6-address-bar {
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    border-bottom: 1px solid #D4D0C8;
    font-size: 12px;
}

.ie6-btn-circle {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    border-radius: 50%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    cursor: pointer;
    color: green;
    font-weight: bold;
}

.ie6-btn-rect {
    padding: 3px 6px;
    border: 1px solid #ccc;
    background: #f0f0f0;
    cursor: pointer;
    font-size: 11px;
}

.ie6-input {
    flex-grow: 1;
    border: 1px solid #7F9DB9;
    padding: 2px 5px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
}

.ie6-viewport {
    flex-grow: 1;
    border: 1px solid #7F9DB9;
    margin: 2px;
    background: white;
}

/* --- OUTLOOK EXPRESS WINDOW --- */
.outlook-menu-bar {
    padding: 2px 5px;
    border-bottom: 1px solid #D4D0C8;
    font-size: 11px;
    display: flex;
    gap: 10px;
    background: #ECE9D8;
}

.outlook-toolbar {
    padding: 2px;
    border-bottom: 1px solid #D4D0C8;
    display: flex;
    gap: 2px;
    align-items: center;
    background: #ECE9D8;
    height: 40px;
}

.outlook-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 2px 5px;
    cursor: pointer;
    border: 1px solid transparent;
}

.outlook-btn:hover {
    border: 1px solid #316AC5;
    background-color: #C1D2EE;
}

.outlook-icon-send {
    font-size: 16px;
    color: #555;
}

.outlook-icon-cut {
    font-size: 14px;
}

.outlook-icon-copy {
    font-size: 14px;
}

.outlook-icon-paste {
    font-size: 14px;
}

.outlook-icon-undo {
    font-size: 14px;
}

.outlook-icon-check {
    font-size: 14px;
    color: green;
}

.outlook-icon-spelling {
    font-size: 14px;
    font-weight: bold;
}

.outlook-separator {
    width: 1px;
    height: 30px;
    background-color: #aaa;
    margin: 0 2px;
}

.outlook-headers {
    background: #ECE9D8;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-bottom: 1px solid #aaa;
}

.outlook-row {
    display: flex;
    align-items: center;
}

.outlook-label {
    width: 60px;
    font-size: 11px;
    color: #444;
}

.outlook-input {
    flex-grow: 1;
    border: 1px solid #7F9DB9;
    padding: 2px;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
}

.outlook-body {
    flex-grow: 1;
    border: none;
    padding: 10px;
    font-family: 'Arial', sans-serif;
    font-size: 13px;
    resize: none;
    outline: none;
}

/* --- TASKBAR & SYSTEM TRAY --- */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(180deg, #245EDC 0%, #3E87EB 8%, #245EDC 100%);
    border-top: 2px solid #3E87EB;
    display: flex;
    align-items: center;
    z-index: 99999;
    font-family: 'Tahoma', sans-serif;
    user-select: none;
}

.start-btn {
    width: 90px;
    height: 30px;
    background: linear-gradient(180deg, #3C8D42 0%, #4FA653 10%, #3C8D42 100%);
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-style: italic;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 1px 1px 1px #000;
    cursor: pointer;
    margin-right: 10px;
}

.start-btn:active {
    box-shadow: inset 2px 2px 2px rgba(0, 0, 0, 0.4);
}

.start-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #FFF 20%, transparent 20%),
        linear-gradient(45deg, transparent 45%, #EA3B28 45%, #EA3B28 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, #3C8D42 45%, #3C8D42 55%, transparent 55%);
    margin-right: 4px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
}

.task-area {
    flex-grow: 1;
    display: flex;
    gap: 3px;
    padding-left: 5px;
}

.task-btn {
    width: 150px;
    height: 24px;
    background: #3E87EB;
    border: 1px solid #1F499B;
    border-radius: 3px;
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    padding: 0 5px;
    cursor: pointer;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.3);
}

.task-btn:hover {
    background-color: #559BF5;
}

.task-btn.active {
    background: #1E52B7;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 2px, rgba(255, 255, 255, 0.1) 2px, rgba(255, 255, 255, 0.1) 4px);
}

.task-icon {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    border: none;
    background: transparent;
}

.system-tray {
    background: #0B79D8;
    border-left: 1px solid #16467B;
    border-top: 1px solid #16467B;
    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.3);
    padding: 0 15px;
    height: 30px;
    display: flex;
    align-items: center;
    color: white;
    font-size: 11px;
    margin-left: 10px;
}

/* --- START MENU STYLING --- */
#start-menu {
    position: fixed;
    bottom: 30px;
    /* Sits right above the taskbar */
    left: 0;
    width: 380px;
    background-color: #ECE9D8;
    border: 1px solid #0055EA;
    border-radius: 5px 5px 0 0;
    box-shadow: 2px -2px 10px rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    font-family: 'Tahoma', sans-serif;
}

.start-header {
    background: linear-gradient(180deg, #127DFF 0%, #288EFF 10%, #0058EE 100%);
    padding: 8px;
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    border-radius: 4px 4px 0 0;
    border-bottom: 2px solid #F3A449;
    /* The classic orange line */
}

.user-pic {
    width: 35px;
    height: 35px;
    border: 2px solid white;
    border-radius: 3px;
    margin-right: 10px;
    background: white;
}

.start-body {
    display: flex;
    height: 350px;
}

.start-left {
    width: 60%;
    background-color: white;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

.start-right {
    width: 40%;
    background-color: #D3E5FA;
    border-left: 1px solid #99B4D1;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

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

.start-item:hover {
    background-color: #2F71CD;
    color: white;
    border: 1px solid #1E52B7;
}

.start-item:hover .start-item-text span {
    color: white;
    /* Make subtitle white on hover */
}

.start-item-icon {
    width: 30px;
    height: 30px;
    margin-right: 10px;
}

.start-item-text {
    display: flex;
    flex-direction: column;
}

.start-item-text strong {
    font-size: 12px;
}

.start-item-text span {
    font-size: 10px;
    color: #888;
}

.start-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #ccc 10%, #ccc 90%, transparent);
    margin: 5px 0;
}

.start-right-item {
    padding: 6px;
    font-size: 11px;
    color: #00136A;
    font-weight: bold;
    cursor: default;
    /* Just decorative for now */
}

.start-right-item:hover {
    color: #2F71CD;
    text-decoration: underline;
}

.start-footer {
    background: linear-gradient(180deg, #127DFF 0%, #288EFF 10%, #0058EE 100%);
    padding: 6px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.footer-btn {
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.footer-btn:hover {
    text-decoration: underline;
}

/* Small orange square for logoff */
.icon-logoff {
    width: 14px;
    height: 14px;
    background: #F3A449;
    margin-right: 5px;
    border-radius: 2px;
}

/* Small red square for turn off */
.icon-turnoff {
    width: 14px;
    height: 14px;
    background: #E05149;
    margin-right: 5px;
    border-radius: 2px;
}

/* --- MOBILE / POCKET PC MODE --- */
@media screen and (max-width: 850px) {
    body {
        background: #ECE9D8;
        padding: 0;
        align-items: flex-start;
    }

    /* Hide desktop icons on mobile */
    #desktop {
        display: none !important;
    }

    #start-menu {
        width: 100% !important;
        left: 0 !important;
        bottom: 34px !important;
        /* Above mobile taskbar */
        border-radius: 0 !important;
        border: none !important;
        border-top: 1px solid #0055EA !important;
    }

    .window,
    #ie6-window {
        width: 100% !important;
        height: calc(100% - 34px) !important;
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        transform: none !important;
        position: fixed !important;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .window-controls {
        display: none;
    }

    .title-bar,
    .ie6-title-bar {
        border-radius: 0;
        padding: 8px;
    }

    .menu-bar,
    .ie6-menu-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 5px 0;
    }

    .menu-item {
        padding: 8px 12px;
        font-size: 14px;
    }

    .content-area {
        font-size: 16px;
        padding: 15px;
    }

    #taskbar {
        height: 34px;
        z-index: 999999;
    }

    .start-btn {
        width: 60px;
    }

    .task-btn {
        flex-grow: 1;
        width: auto;
        max-width: none;
    }

    .system-tray {
        padding: 0 5px;
        font-size: 10px;
    }

    #clippy-container {
        right: 10px;
        width: 250px;
    }

    .clippy-bubble {
        width: 100vw;
        max-width: 280px;
        position: fixed;
        right: 10px;
        bottom: 120px;
        font-size: 14px;
        padding: 15px;
        box-sizing: border-box;
    }

    .clippy-btn {
        font-size: 13px;
        padding: 8px 10px;
        margin: 5px;
        width: calc(100% - 10px);
        box-sizing: border-box;
    }

    .clippy-img {
        width: 80px;
    }

    #clippy-chat {
        bottom: 120px;
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 300px;
        height: 60vh;
    }
}

/* Clippy Chat Styles */
#clippy-chat {
    position: absolute;
    bottom: 140px;
    right: 170px;
    width: 300px;
    height: 350px;
    background: #FFFFE1;
    border: 1px solid #000;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 100001;
    font-family: Tahoma, sans-serif;
    font-size: 12px;
}

@media screen and (max-width: 850px) {
    #clippy-chat {
        right: 10px;
        bottom: 110px;
        width: 250px;
        height: 300px;
        max-width: calc(100vw - 20px);
        max-height: 50vh;
    }
}

/* Speech bubble arrow logic for chat if desired, but simple box is fine for now */
#clippy-chat::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #000 transparent transparent transparent;
}

#clippy-chat::before {
    content: '';
    position: absolute;
    bottom: -9px;
    right: 30px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #FFFFE1 transparent transparent transparent;
    z-index: 1;
}

.clippy-chat-header {
    background: #FFD700;
    /* Gold/Yellow-ish */
    padding: 5px;
    border-bottom: 1px solid #D4D0C8;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px 4px 0 0;
}

.clippy-close {
    cursor: pointer;
    border: 1px solid #999;
    background: #FFF;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    font-size: 10px;
    border-radius: 2px;
}

#clippy-chat-history {
    flex-grow: 1;
    padding: 10px;
    overflow-y: auto;
    background: #FFF;
    border-bottom: 1px solid #D4D0C8;
}

.clippy-message {
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 4px;
    max-width: 80%;
}

.clippy-message.user {
    background: #E8F0FE;
    align-self: flex-end;
    margin-left: auto;
    border: 1px solid #B0C4DE;
}

.clippy-message.bot {
    background: #FFFFE1;
    border: 1px solid #E6DB55;
}

.clippy-typing {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 8px 10px;
}

.typing-dot {
    width: 4px;
    height: 4px;
    background-color: #666;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

.clippy-chat-input-area {
    padding: 5px;
    background: #F0F0F0;
    display: flex;
    gap: 5px;
    border-radius: 0 0 4px 4px;
}

#clippy-input {
    flex-grow: 1;
    border: 1px solid #7F9DB9;
    padding: 4px;
}

#clippy-input:disabled {
    background-color: #EBEBE4;
    cursor: not-allowed;
}

#clippy-send-btn {
    padding: 4px 10px;
    border: 1px solid #003C74;
    background: linear-gradient(to bottom, #FFF, #ECE9D8);
    cursor: pointer;
}

#clippy-send-btn:disabled {
    color: #ACA899;
    background: #ECE9D8;
    border: 1px solid #ACA899;
    cursor: not-allowed;
}

#clippy-send-btn:hover:not(:disabled) {
    background: #E0E0CE;
}