/* Windows XP Window Chrome */

.xp-window {
    position: absolute;
    min-width: 300px;
    min-height: 200px;
    background: var(--xp-button-face);
    border: 3px solid;
    border-color: #4E8CD8 #0D47A1 #0D47A1 #4E8CD8;
    border-radius: 8px 8px 0 0;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.xp-window.minimized {
    display: none;
}

.xp-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: calc(100% - 6px) !important;
    height: calc(100% - 36px) !important;
    border-radius: 0;
}

/* Title Bar */
.xp-titlebar {
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 4px;
    background: linear-gradient(180deg,
        #0A246A 0%,
        #0F3989 3%,
        #2B71C2 6%,
        #3C8DE5 10%,
        #4191E7 14%,
        #3C8DE5 18%,
        #2E7CD6 22%,
        #2065BF 28%,
        #1655AA 35%,
        #0F4696 48%,
        #0B3D86 58%,
        #08357A 68%,
        #072F6E 80%,
        #052962 88%,
        #042456 95%,
        #031F4A 100%
    );
    cursor: move;
    border-radius: 6px 6px 0 0;
}

.xp-window.inactive .xp-titlebar {
    background: linear-gradient(180deg,
        #7F9DB9 0%,
        #8EB1D0 10%,
        #9BC4E0 20%,
        #A8D2EA 30%,
        #9BC4E0 50%,
        #8EB1D0 70%,
        #7F9DB9 90%,
        #6B8DAB 100%
    );
}

.xp-titlebar-icon {
    width: 18px;
    height: 18px;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.xp-titlebar-title {
    flex: 1;
    color: white;
    font-family: var(--xp-font-ui);
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.xp-window.inactive .xp-titlebar-title {
    color: #DBEAF9;
}

.xp-titlebar-buttons {
    display: flex;
    gap: 2px;
    margin-left: 4px;
}

.xp-titlebar-btn {
    width: 21px;
    height: 21px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

.xp-titlebar-btn.minimize,
.xp-titlebar-btn.maximize {
    background: linear-gradient(180deg,
        #3C7CC8 0%,
        #2E6BBD 20%,
        #245BAD 50%,
        #1A4A9C 80%,
        #103A8C 100%
    );
    border: 1px solid;
    border-color: #89B4E0 #0E3A7D #0E3A7D #89B4E0;
}

.xp-titlebar-btn.minimize:hover,
.xp-titlebar-btn.maximize:hover {
    background: linear-gradient(180deg,
        #4C8CD8 0%,
        #3E7BCD 20%,
        #346BBD 50%,
        #2A5AAC 80%,
        #204A9C 100%
    );
}

.xp-titlebar-btn.close {
    background: linear-gradient(180deg,
        #C75050 0%,
        #BD4545 20%,
        #B23535 50%,
        #A72525 80%,
        #9C1515 100%
    );
    border: 1px solid;
    border-color: #E4A0A0 #7D0E0E #7D0E0E #E4A0A0;
}

.xp-titlebar-btn.close:hover {
    background: linear-gradient(180deg,
        #E76060 0%,
        #DD5555 20%,
        #D24545 50%,
        #C73535 80%,
        #BC2525 100%
    );
}

.xp-titlebar-btn:active {
    transform: translateY(1px);
}

/* Window Content */
.xp-window-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--xp-button-face);
}

/* Menu Bar */
.xp-menubar {
    display: flex;
    background: var(--xp-button-face);
    border-bottom: 1px solid var(--xp-button-shadow);
    padding: 2px 4px;
}

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

.xp-menu-item:hover {
    background: var(--xp-selection-bg);
    color: white;
}

/* Address Bar (for Explorer) */
.xp-addressbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--xp-button-face);
    border-bottom: 1px solid var(--xp-button-shadow);
}

.xp-addressbar-label {
    font-size: 11px;
    white-space: nowrap;
}

.xp-addressbar-input {
    flex: 1;
    padding: 2px 4px;
    border: 1px solid;
    border-color: var(--xp-button-shadow) var(--xp-button-highlight) var(--xp-button-highlight) var(--xp-button-shadow);
    background: white;
    font-size: 11px;
    font-family: var(--xp-font-ui);
}

.xp-addressbar-go {
    padding: 2px 8px;
    font-size: 11px;
}

/* Resize Handle */
.xp-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: linear-gradient(135deg,
        transparent 0%,
        transparent 30%,
        var(--xp-button-shadow) 30%,
        var(--xp-button-shadow) 40%,
        transparent 40%,
        transparent 50%,
        var(--xp-button-shadow) 50%,
        var(--xp-button-shadow) 60%,
        transparent 60%,
        transparent 70%,
        var(--xp-button-shadow) 70%,
        var(--xp-button-shadow) 80%,
        transparent 80%
    );
}

/* Split Pane Layout (for Explorer) */
.xp-split-pane {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.xp-split-left {
    width: 200px;
    min-width: 100px;
    background: white;
    border-right: 1px solid var(--xp-button-shadow);
    overflow: auto;
}

.xp-split-right {
    flex: 1;
    background: white;
    overflow: auto;
}

.xp-split-resizer {
    width: 4px;
    cursor: ew-resize;
    background: var(--xp-button-face);
}

/* Tree View (for folder navigation) */
.xp-treeview {
    padding: 4px;
    font-size: 11px;
}

.xp-tree-item {
    display: flex;
    align-items: center;
    padding: 2px 4px;
    cursor: pointer;
    white-space: nowrap;
}

.xp-tree-item:hover {
    background: var(--xp-selection-bg);
    color: white;
}

.xp-tree-item.selected {
    background: var(--xp-selection-bg);
    color: white;
}

.xp-tree-expander {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
}

.xp-tree-icon {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    font-size: 12px;
}

/* Icon View (for file listing) */
.xp-iconview {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    padding: 8px;
    gap: 8px;
}

.xp-iconview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 4px;
    cursor: pointer;
    border-radius: 3px;
}

.xp-iconview-item:hover {
    background: rgba(49, 106, 197, 0.2);
}

.xp-iconview-item.selected {
    background: var(--xp-selection-bg);
    color: white;
}

.xp-iconview-item .icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 4px;
}

.xp-iconview-item .label {
    font-size: 11px;
    text-align: center;
    word-wrap: break-word;
    max-width: 100%;
}

/* Details View */
.xp-details-panel {
    padding: 12px;
    background: linear-gradient(180deg, #F5F4ED 0%, #ECEADF 100%);
    border-left: 1px solid var(--xp-button-shadow);
    width: 180px;
    min-width: 150px;
}

.xp-details-title {
    font-size: 12px;
    font-weight: bold;
    color: #1E4E8A;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #C6D3E7;
}

.xp-details-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
}

.xp-details-label {
    color: #666;
}

.xp-details-value {
    font-weight: 500;
}
