/* HODL Desktop - Window Chrome */

.xp-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  border: 1px solid #0054e3;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.1);
  overflow: hidden;
  min-width: 200px;
  min-height: 120px;
}

/* Title Bar - Active */
.xp-title-bar {
  background: linear-gradient(180deg,
    #0997ff 0%, #0053ee 3%, #0050ee 8%,
    #0046cc 17%, #0040be 25%,
    #003db8 50%, #003db8 56%,
    #0040be 81%, #0046cc 89%,
    #0050ee 95%, #0053ee 97%, #0997ff 100%
  );
  padding: 3px 5px 3px 8px;
  display: flex;
  align-items: center;
  cursor: default;
  height: 26px;
  flex-shrink: 0;
}

/* Title Bar - Inactive */
.xp-window.inactive .xp-title-bar {
  background: linear-gradient(180deg,
    #c4cad2 0%, #9ca4ad 3%, #97a0a8 8%,
    #8e959e 17%, #8a9199 25%,
    #868e97 50%, #868e97 56%,
    #8a9199 81%, #8e959e 89%,
    #97a0a8 95%, #9ca4ad 97%, #c4cad2 100%
  );
}

.xp-title-bar-text {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-system);
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.xp-window.inactive .xp-title-bar-text {
  color: #d4dae2;
  text-shadow: none;
}

.xp-title-bar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Title Bar Controls */
.xp-title-bar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.xp-title-bar-controls button {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  background-size: 11px 11px;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
}

/* Minimize button */
.xp-btn-minimize {
  background-color: #3169c6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Crect x='1' y='8' width='8' height='2' fill='white'/%3E%3C/svg%3E");
}
.xp-btn-minimize:hover {
  background-color: #4a7fd8;
  border-color: rgba(255,255,255,0.6);
}
.xp-btn-minimize:active {
  background-color: #2a5ab0;
}

/* Maximize button */
.xp-btn-maximize {
  background-color: #3169c6;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Crect x='1' y='1' width='8' height='8' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E");
}
.xp-btn-maximize:hover {
  background-color: #4a7fd8;
  border-color: rgba(255,255,255,0.6);
}
.xp-btn-maximize:active {
  background-color: #2a5ab0;
}

/* Restore button (when maximized) */
.xp-btn-maximize.restore {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Crect x='3' y='0' width='7' height='7' fill='none' stroke='white' stroke-width='1.5'/%3E%3Crect x='0' y='3' width='7' height='7' fill='%233169c6' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E");
}

/* Close button */
.xp-btn-close {
  background-color: #c75050;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 11'%3E%3Cpath d='M2 2L9 9M9 2L2 9' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  border-color: rgba(255,255,255,0.3);
}
.xp-btn-close:hover {
  background-color: #e06060;
  border-color: rgba(255,255,255,0.5);
}
.xp-btn-close:active {
  background-color: #a04040;
}

/* Inactive controls */
.xp-window.inactive .xp-btn-minimize,
.xp-window.inactive .xp-btn-maximize {
  background-color: #a0a7b0;
  border-color: rgba(255,255,255,0.3);
}
.xp-window.inactive .xp-btn-close {
  background-color: #b06060;
  border-color: rgba(255,255,255,0.2);
}

/* Window Body */
.xp-window-body {
  flex: 1;
  overflow: auto;
  background: #fff;
  position: relative;
}

/* Status Bar */
.xp-status-bar {
  display: flex;
  align-items: center;
  padding: 2px 6px;
  background: #ece9d8;
  border-top: 1px solid #d4d0c8;
  font-size: 11px;
  font-family: var(--font-system);
  color: #444;
  flex-shrink: 0;
  min-height: 20px;
}

.xp-status-bar-field {
  padding: 0 6px;
  border-right: 1px solid #c8c4b8;
  flex-shrink: 0;
}

.xp-status-bar-field:last-child {
  border-right: none;
  flex: 1;
}

/* Menu Bar */
.xp-menu-bar {
  display: flex;
  align-items: center;
  padding: 1px 2px;
  background: #ece9d8;
  border-bottom: 1px solid #d4d0c8;
  flex-shrink: 0;
}

.xp-menu-bar-item {
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--font-system);
  cursor: pointer;
  white-space: nowrap;
  color: #000;
}

.xp-menu-bar-item:hover {
  background: #2b71b8;
  color: #fff;
}

/* Toolbar */
.xp-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: #ece9d8;
  border-bottom: 1px solid #d4d0c8;
  flex-shrink: 0;
}

.xp-toolbar-btn {
  padding: 2px 6px;
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 11px;
  font-family: var(--font-system);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #000;
}

.xp-toolbar-btn:hover {
  background: #fff;
  border-color: #c8c4b8;
  box-shadow: inset 0 -1px 0 #c8c4b8;
}

.xp-toolbar-btn:active {
  background: #ddd;
  border-color: #999;
}

.xp-toolbar-separator {
  width: 1px;
  height: 18px;
  background: #c8c4b8;
  margin: 0 2px;
}

/* Resize Handles */
.resize-handle {
  position: absolute;
  z-index: 2;
}
.resize-n { top: -4px; left: 10px; right: 10px; height: 8px; cursor: n-resize; }
.resize-s { bottom: -4px; left: 10px; right: 10px; height: 8px; cursor: s-resize; }
.resize-e { right: -4px; top: 10px; bottom: 10px; width: 8px; cursor: e-resize; }
.resize-w { left: -4px; top: 10px; bottom: 10px; width: 8px; cursor: w-resize; }
.resize-ne { top: -4px; right: -4px; width: 12px; height: 12px; cursor: ne-resize; }
.resize-nw { top: -4px; left: -4px; width: 12px; height: 12px; cursor: nw-resize; }
.resize-se { bottom: -4px; right: -4px; width: 12px; height: 12px; cursor: se-resize; }
.resize-sw { bottom: -4px; left: -4px; width: 12px; height: 12px; cursor: sw-resize; }

/* Mobile: larger touch targets and responsive windows */
@media (max-width: 600px) {
  .xp-window {
    min-width: 160px;
    min-height: 100px;
    max-width: 100vw;
  }

  .xp-title-bar {
    height: 34px;
    padding: 3px 6px 3px 8px;
    touch-action: none;
  }

  .xp-title-bar-controls {
    gap: 4px;
  }

  .xp-title-bar-controls button {
    width: 28px;
    height: 28px;
  }

  /* Bigger resize handles for touch */
  .resize-n { top: -8px; height: 16px; left: 16px; right: 16px; }
  .resize-s { bottom: -8px; height: 16px; left: 16px; right: 16px; }
  .resize-e { right: -8px; width: 16px; top: 16px; bottom: 16px; }
  .resize-w { left: -8px; width: 16px; top: 16px; bottom: 16px; }
  .resize-ne { top: -8px; right: -8px; width: 24px; height: 24px; }
  .resize-nw { top: -8px; left: -8px; width: 24px; height: 24px; }
  .resize-se { bottom: -8px; right: -8px; width: 24px; height: 24px; }
  .resize-sw { bottom: -8px; left: -8px; width: 24px; height: 24px; }
}

/* XP-style tab control */
.xp-tabs {
  display: flex;
  border-bottom: 1px solid #919b9c;
  padding: 0 6px;
  background: #ece9d8;
}

.xp-tab {
  padding: 4px 12px;
  font-size: 11px;
  font-family: var(--font-system);
  cursor: pointer;
  border: 1px solid #919b9c;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: #d6d2c2;
  color: #000;
  margin-right: 2px;
  position: relative;
  top: 1px;
}

.xp-tab:hover {
  background: #e8e4d8;
}

.xp-tab.active {
  background: #fff;
  border-bottom: 1px solid #fff;
  font-weight: 700;
}

.xp-tab-content {
  display: none;
  padding: 10px;
}

.xp-tab-content.active {
  display: block;
}

/* XP info panel (left side panel in explorer-style windows) */
.xp-info-panel {
  width: 200px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #6b9fdf 0%, #507dbe 100%);
  padding: 10px;
  color: #fff;
  font-size: 11px;
  overflow-y: auto;
}

.xp-info-panel h3 {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.3);
}

.xp-info-panel-section {
  margin-bottom: 12px;
}

.xp-info-panel a {
  color: #fff;
  text-decoration: underline;
}

.xp-info-panel a:hover {
  color: var(--hodl-orange-light);
}
