/* ================================================================
   Melanie OS ME Theme — winme.css
   All selectors scoped under #desktop-winme
   ================================================================ */

/* -------- FONTS & BASE -------- */
#desktop-winme {
    font-family: Tahoma, 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    color: #000;
    background: #008080;
    position: relative;
    overflow: hidden;
    user-select: none;
}

#desktop-winme *,
#desktop-winme *::before,
#desktop-winme *::after {
    box-sizing: border-box;
}

/* ================================================================
   DESKTOP ICONS
   ================================================================ */
#desktop-winme .desktop-icons {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1;
    flex-wrap: wrap;
    max-height: calc(100vh - 80px);
}

#desktop-winme .desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    padding: 4px 2px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 0;
    text-align: center;
}

#desktop-winme .desktop-icon:hover,
#desktop-winme .desktop-icon:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 128, 0.25);
    outline: none;
}

#desktop-winme .desktop-icon:focus .icon-label,
#desktop-winme .desktop-icon.selected .icon-label {
    background: #000080;
    color: #fff;
}

#desktop-winme .icon-img {
    width: 32px;
    height: 32px;
    font-size: 28px;
    line-height: 32px;
    text-align: center;
    margin-bottom: 2px;
    pointer-events: none;
}

#desktop-winme .icon-label {
    font-size: 11px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
    padding: 1px 3px;
    word-wrap: break-word;
    line-height: 1.2;
    max-width: 68px;
    pointer-events: none;
}

/* ================================================================
   MELANIE OS — CHROME
   ================================================================ */
#desktop-winme .window {
    position: absolute;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #404040;
    display: flex;
    flex-direction: column;
    min-width: 200px;
    min-height: 120px;
    z-index: 100;
}

/* ---- Title Bar ---- */
#desktop-winme .title-bar {
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #000080, #1084d0);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    padding: 2px 3px;
    height: 22px;
    min-height: 22px;
    flex-shrink: 0;
    cursor: default;
}

#desktop-winme .window.inactive .title-bar {
    background: linear-gradient(to right, #808080, #b0b0b0);
}

#desktop-winme .title-bar-icon {
    width: 16px;
    height: 16px;
    font-size: 14px;
    line-height: 16px;
    margin-right: 4px;
    flex-shrink: 0;
}

#desktop-winme .title-bar-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

#desktop-winme .title-bar-controls {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 4px;
}

#desktop-winme .title-bar-controls button {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 0;
    font-size: 9px;
    font-family: 'Marlett', Tahoma, sans-serif;
    line-height: 12px;
    text-align: center;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

#desktop-winme .title-bar-controls button:active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

#desktop-winme .btn-minimize::after {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: #000;
    position: absolute;
    bottom: 2px;
    left: 3px;
}

#desktop-winme .btn-maximize::after {
    content: '';
    display: block;
    width: 9px;
    height: 9px;
    border: 1px solid #000;
    border-top-width: 2px;
    position: absolute;
    top: 1px;
    left: 2px;
}

#desktop-winme .btn-close::before,
#desktop-winme .btn-close::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: #000;
    top: 50%;
    left: 50%;
}

#desktop-winme .btn-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#desktop-winme .btn-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ---- Window Body ---- */
#desktop-winme .window-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

/* ---- Menu Bar ---- */
#desktop-winme .menu-bar {
    display: flex;
    align-items: center;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 1px 0;
    flex-shrink: 0;
}

#desktop-winme .menu-item {
    padding: 2px 8px;
    cursor: pointer;
    font-size: 11px;
}

#desktop-winme .menu-item:hover {
    background: #000080;
    color: #fff;
}

/* ---- Toolbar ---- */
#desktop-winme .toolbar {
    display: flex;
    align-items: center;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 2px 4px;
    gap: 2px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

#desktop-winme .toolbar-btn {
    background: #c0c0c0;
    border: 1px solid transparent;
    padding: 2px 6px;
    font-size: 11px;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

#desktop-winme .toolbar-btn:hover {
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

#desktop-winme .toolbar-btn:active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* ---- Window Content ---- */
#desktop-winme .window-content {
    flex: 1;
    overflow: auto;
    background: #fff;
    position: relative;
}

/* ---- Status Bar ---- */
#desktop-winme .status-bar {
    display: flex;
    align-items: center;
    background: #c0c0c0;
    border-top: 1px solid #808080;
    padding: 2px 4px;
    min-height: 20px;
    flex-shrink: 0;
}

#desktop-winme .status-field {
    font-size: 11px;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 1px 6px;
    flex: 1;
}

/* ---- Scrollbar (Webkit) ---- */
#desktop-winme ::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

#desktop-winme ::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px solid #808080;
}

#desktop-winme ::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

#desktop-winme ::-webkit-scrollbar-thumb:hover {
    background: #d0d0d0;
}

#desktop-winme ::-webkit-scrollbar-button {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    width: 16px;
    height: 16px;
}

/* ================================================================
   SYSTEM PROPERTIES WINDOW
   ================================================================ */
#desktop-winme #winme-sysinfo .window-content {
    background: #c0c0c0;
    padding: 8px;
}

#desktop-winme .sysprop-tabs {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
    padding-left: 4px;
}

#desktop-winme .tab-btn {
    background: #c0c0c0;
    border: 1px solid;
    border-color: #dfdfdf #808080 #c0c0c0 #dfdfdf;
    padding: 4px 12px;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
    font-size: 11px;
    cursor: pointer;
    position: relative;
    border-radius: 3px 3px 0 0;
    margin-right: 2px;
}

#desktop-winme .tab-btn.active {
    border-bottom-color: #c0c0c0;
    background: #c0c0c0;
    font-weight: bold;
    padding-bottom: 5px;
    margin-bottom: -1px;
    z-index: 3;
}

#desktop-winme .tab-btn:not(.active) {
    background: #b0b0b0;
    top: 2px;
}

#desktop-winme .sysprop-tab-content {
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    background: #c0c0c0;
    padding: 12px;
    position: relative;
    z-index: 1;
}

#desktop-winme .tab-panel {
    display: none;
}

#desktop-winme .tab-panel.active {
    display: block;
}

/* -- General Tab -- */
#desktop-winme .sysprop-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}

#desktop-winme .sysprop-flower {
    width: 48px;
    height: 48px;
    transform: rotate(-8deg);
    flex-shrink: 0;
}

#desktop-winme .sysprop-edition {
    font-size: 12px;
    line-height: 1.4;
}

#desktop-winme .sysprop-ms {
    font-size: 11px;
    color: #444;
}

#desktop-winme .sysprop-me-text {
    color: #0066cc;
    font-style: italic;
    font-size: 16px;
}

#desktop-winme .sysprop-ver {
    font-size: 10px;
    color: #666;
}

#desktop-winme .sysprop-divider {
    border: none;
    border-top: 1px solid #808080;
    border-bottom: 1px solid #dfdfdf;
    margin: 8px 0;
}

#desktop-winme .sysprop-info {
    padding: 0 4px;
}

#desktop-winme .sysprop-section {
    margin-bottom: 10px;
}

#desktop-winme .sysprop-heading {
    font-weight: bold;
    margin-bottom: 2px;
    font-size: 11px;
}

#desktop-winme .sysprop-value {
    padding-left: 12px;
    font-size: 11px;
    line-height: 1.5;
}

/* -- Device Manager Tab -- */
#desktop-winme .devmgr-header {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 11px;
}

#desktop-winme .devmgr-tree {
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #fff;
    padding: 6px;
    max-height: 220px;
    overflow-y: auto;
}

#desktop-winme .tree-node {
    margin-bottom: 2px;
}

#desktop-winme .tree-toggle {
    cursor: pointer;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

#desktop-winme .tree-toggle:hover {
    background: #e0e0e0;
}

#desktop-winme .tree-toggle::before {
    content: '+';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #808080;
    background: #fff;
    text-align: center;
    line-height: 10px;
    font-size: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

#desktop-winme .tree-toggle.expanded::before {
    content: '−';
}

#desktop-winme .tree-toggle.collapsed::before {
    content: '+';
}

#desktop-winme .tree-children {
    padding-left: 20px;
    border-left: 1px dotted #808080;
    margin-left: 6px;
}

#desktop-winme .tree-toggle.collapsed + .tree-children {
    display: none;
}

#desktop-winme .tree-leaf {
    padding: 1px 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

#desktop-winme .tree-icon {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

/* ================================================================
   MELANIE MAIL (MAIL) WINDOW
   ================================================================ */
#desktop-winme .outlook-layout {
    display: flex;
    height: 100%;
}

#desktop-winme .outlook-sidebar {
    width: 160px;
    min-width: 140px;
    background: #c0c0c0;
    border-right: 2px solid;
    border-right-color: #808080;
    padding: 4px;
    flex-shrink: 0;
    overflow-y: auto;
}

#desktop-winme .outlook-folder-heading {
    font-weight: bold;
    font-size: 11px;
    padding: 4px;
    border-bottom: 1px solid #808080;
    margin-bottom: 2px;
}

#desktop-winme .outlook-folder {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 11px;
}

#desktop-winme .outlook-folder:hover {
    background: #000080;
    color: #fff;
}

#desktop-winme .outlook-folder.active {
    font-weight: bold;
}

#desktop-winme .folder-icon {
    font-size: 13px;
    width: 16px;
    text-align: center;
}

#desktop-winme .outlook-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

#desktop-winme .compose-header-label {
    background: #c0c0c0;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px solid #808080;
}

#desktop-winme .contact-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
}

#desktop-winme .compose-field {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #c0c0c0;
    background: #fff;
}

#desktop-winme .compose-label {
    width: 60px;
    min-width: 60px;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 8px;
    background: #c0c0c0;
    text-align: right;
    border-right: 1px solid #808080;
}

#desktop-winme .compose-input {
    flex: 1;
    border: none;
    padding: 4px 6px;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
    font-size: 11px;
    outline: none;
    background: #fff;
}

#desktop-winme .compose-input[readonly] {
    background: #e8e8e8;
    color: #444;
}

#desktop-winme .compose-body {
    flex: 1;
    display: flex;
}

#desktop-winme .compose-textarea {
    flex: 1;
    border: none;
    padding: 6px;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
    font-size: 11px;
    resize: none;
    outline: none;
}

/* ================================================================
   MY DOCUMENTS / EXPLORER WINDOW
   ================================================================ */
#desktop-winme .explorer-address-bar {
    display: flex;
    align-items: center;
    background: #c0c0c0;
    border-bottom: 1px solid #808080;
    padding: 2px 4px;
    gap: 4px;
    flex-shrink: 0;
}

#desktop-winme .address-label {
    font-size: 11px;
    font-weight: bold;
    padding-right: 4px;
}

#desktop-winme .address-field {
    flex: 1;
    background: #fff;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 2px 4px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

#desktop-winme .address-icon {
    font-size: 13px;
}

#desktop-winme .file-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    align-content: flex-start;
}

#desktop-winme .file-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 6px 4px;
    cursor: pointer;
    text-decoration: none;
    color: #000;
    border: 1px solid transparent;
    text-align: center;
}

#desktop-winme .file-icon:hover {
    border-color: #000080;
    background: rgba(0, 0, 128, 0.08);
}

#desktop-winme .file-icon-img {
    font-size: 32px;
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    margin-bottom: 4px;
}

#desktop-winme .file-icon-label {
    font-size: 11px;
    font-weight: bold;
    line-height: 1.3;
    word-wrap: break-word;
}

#desktop-winme .file-icon-desc {
    font-size: 10px;
    color: #666;
    line-height: 1.2;
    margin-top: 2px;
}

/* ================================================================
   TERMINAL WINDOW
   ================================================================ */
#desktop-winme #winme-terminal .window-content {
    background: #000;
    padding: 0;
}

#desktop-winme .terminal-container {
    width: 100%;
    height: 100%;
    background: #000;
    color: #c0c0c0;
    font-family: 'Lucida Console', 'Courier New', monospace;
    font-size: 14px;
}

/* ================================================================
   MINESWEEPER WINDOW
   ================================================================ */
#desktop-winme #winme-minesweeper .window-content {
    background: #c0c0c0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#desktop-winme .minesweeper-container {
    width: 100%;
    height: 100%;
}

/* ================================================================
   START MENU
   ================================================================ */
#desktop-winme .start-menu {
    position: fixed;
    bottom: 30px;
    left: 0;
    z-index: 9001;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: inset 1px 1px 0 #fff;
    display: flex;
    flex-direction: row;
    min-width: 240px;
    max-height: none !important;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* -- Sidebar -- */
#desktop-winme .start-menu-sidebar {
    width: 24px;
    background: linear-gradient(to top, #000080, #005a5a);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    flex-shrink: 0;
}

#desktop-winme .start-menu-sidebar-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

#desktop-winme .start-menu-sidebar-text em {
    font-style: italic;
    color: #aaddff;
}

/* -- Items -- */
#desktop-winme .start-menu-items {
    flex: 1;
    padding: 2px 0;
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    max-height: none !important;
}

#desktop-winme .start-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px 5px 6px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
    position: relative;
}

#desktop-winme .start-menu-item:hover {
    background: #000080;
    color: #fff;
}

#desktop-winme .start-menu-icon {
    width: 20px;
    height: 20px;
    font-size: 16px;
    text-align: center;
    line-height: 20px;
    flex-shrink: 0;
}

#desktop-winme .start-menu-item .submenu-arrow {
    margin-left: auto;
    font-size: 9px;
    opacity: 0.7;
}

#desktop-winme .start-menu-separator {
    height: 1px;
    background: #808080;
    margin: 3px 4px;
    box-shadow: 0 1px 0 #dfdfdf;
}

#desktop-winme .has-submenu {
    padding-right: 24px;
    position: relative;
}

#desktop-winme .start-submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: inset 1px 1px 0 #fff, 2px 2px 10px rgba(0, 0, 0, 0.3);
    min-width: 160px;
    z-index: 99999 !important;
    flex-direction: column;
    padding: 2px 0;
}

#desktop-winme .start-submenu .start-menu-item {
    color: #000 !important;
    background: #c0c0c0 !important;
}

#desktop-winme .start-submenu .start-menu-item:hover {
    background: #000080 !important;
    color: #fff !important;
}

#desktop-winme .start-menu-item.has-submenu:hover > .start-submenu {
    display: flex !important;
}

/* ================================================================
   TASKBAR
   ================================================================ */
#desktop-winme .taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: #c0c0c0;
    border-top: 2px solid #dfdfdf;
    display: flex;
    align-items: center;
    padding: 2px;
    z-index: 9000;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
}

/* -- Start Button -- */
#desktop-winme .start-button {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 2px 8px;
    cursor: pointer;
    height: 24px;
    flex-shrink: 0;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
}

#desktop-winme .start-button:active,
#desktop-winme .start-button.active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

#desktop-winme .start-flower {
    width: 14px;
    height: 14px;
    margin-right: 4px;
    vertical-align: middle;
}

#desktop-winme .start-text {
    font-weight: bold;
    font-size: 11px;
    color: #000;
}

/* -- Quick Launch -- */
#desktop-winme .quick-launch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
    margin-left: 4px;
    border-left: 2px solid;
    border-left-color: #808080;
    border-right: 2px solid;
    border-right-color: #808080;
    height: 22px;
}

#desktop-winme .ql-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    width: 22px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#desktop-winme .ql-btn:hover {
    border: 1px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
}

/* -- Taskbar Programs -- */
#desktop-winme .taskbar-programs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 4px;
    overflow: hidden;
    min-width: 0;
}

#desktop-winme .taskbar-programs .taskbar-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    padding: 1px 8px;
    font-size: 11px;
    font-family: Tahoma, 'MS Sans Serif', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    height: 22px;
    display: flex;
    align-items: center;
    gap: 4px;
}

#desktop-winme .taskbar-programs .taskbar-btn.active {
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    background: #b0b0b0;
    font-weight: bold;
}

/* -- System Tray -- */
#desktop-winme .system-tray {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    padding: 1px 8px;
    height: 22px;
    flex-shrink: 0;
    margin-left: auto;
}

#desktop-winme .tray-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

#desktop-winme .tray-icon {
    font-size: 13px;
    cursor: pointer;
}

#desktop-winme .tray-clock {
    font-size: 11px;
    color: #000;
    white-space: nowrap;
}

#desktop-winme .compose-altcha {
    padding: 6px 8px;
    border-top: 1px solid #808080;
    flex-shrink: 0;
}
