.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  min-height: 160px;
  max-width: 100%;
  max-height: 100%;
  background-color: var(--border-main-color);
  border: 1px solid var(--border-main-color);
  box-shadow: 0 0 10px 0 var(--border-main-color);
  resize: both;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.window[hidden] {
  display: none;
}

.window--opening {
  animation: window-open 0.25s ease-out;
}

.window--closing {
  opacity: 0;
  transform: translateY(10px) scale(0.94);
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

@keyframes window-open {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
}

.reduce-motion .window--opening {
  animation: none;
}

.reduce-motion .window--closing {
  transform: none;
}

.window__titlebar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background-color: var(--border-main-color);
  cursor: move;
  touch-action: none;
  user-select: none;
}

.window__icon {
  width: 16px;
  height: 16px;
}

.window__title {
  flex: 1;
  font-size: 0.8rem;
}

.window__buttons {
  display: flex;
  gap: 0.5rem;
}

.window__buttons button {
  display: flex;
  align-items: center;
  width: 18px;
  height: 18px;
  color: var(--text-color);
}

.window__buttons svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.window__buttons [data-action="close"]:hover { color: var(--color-close); }
.window__buttons [data-action="maximize"]:hover { color: var(--color-maximize); }
.window__buttons [data-action="minimize"]:hover { color: var(--color-minimize); }

.window__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background-color: var(--background-color);
}

@media (max-width: 768px) {
  .window {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    resize: none;
  }

  .window__titlebar {
    cursor: default;
  }
}

.app-view {
  height: 100%;
}
