/*
 * Amiga‑style window manager theme for Pawel Piela's personal site.
 * This stylesheet defines the look of draggable windows that emulate a
 * retro desktop environment. Each window can be moved around the
 * viewport and contains its own content.
 */

/* Basic resets */
* {
  box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=El+Messiri&display=swap');

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  font-family: 'El Messiri', sans-serif;
  background: linear-gradient(to bottom, #ff7e5f, #feb47b);
  color: #000;
}

/* Window container style */
.window {
  position: absolute;
  width: 420px;
  min-height: 200px;
  border: 2px solid #ffffff;
  border-radius: 3px;
  background: #c0c0c0;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 1;
  /* Allow users to resize the window on both axes */
  resize: both;
  overflow: auto;
}

/* Window header bar */
.window-header {
  background: #0078f0;
  color: #ffffff;
  padding: 5px 8px;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.window-header .title {
  font-weight: 600;
  font-size: 0.9rem;
}

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

.window-header .controls button {
  width: 20px;
  height: 20px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: linear-gradient(to bottom, #ff7e5f, #feb47b);
  cursor: pointer;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  text-indent: -9999px;
}

.window-header .controls button:hover {
  background: linear-gradient(to bottom, #feb47b, #ff7e5f);
}

/* Window content area */
.window-content {
  padding: 10px;
  background: #ffffff;
  flex: 1;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.5;
}

.window-content img {
  max-width: 100%;
  height: auto;
}

/* Dock or launcher for opening windows */
#dock {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

#dock button {
  background: #0078f0;
  border: 2px solid #ffffff;
  border-radius: 3px;
  color: #ffffff;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}

#dock button:hover {
  background: #005fb3;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 600px) {
  .window {
    width: 90vw !important;
    max-width: 90vw;
    left: 5vw !important;
    right: 5vw;
  }
  #dock {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* Login form styles */
#loginWindow input[type="password"] {
  width: 100%;
  padding: 6px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

#loginWindow button {
  background: #0078f0;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
}

#loginWindow button:hover {
  background: #005fb3;
}

/* Admin panel styles */
#adminWindow ul {
  padding-left: 20px;
}

#adminWindow li {
  margin-bottom: 8px;
}

/* Blog list styles */
#blogWindow .post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#blogWindow .post-list li {
  margin-bottom: 10px;
}

#blogWindow .post-list a {
  color: #0078f0;
  text-decoration: none;
}

#blogWindow .post-list a:hover {
  text-decoration: underline;
}

/* Resize handle used for manual resizing. Placed in the bottom right
 * corner of each window. The size is small but visible and uses a
 * diagonal cursor to indicate resizing.
 */
.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
  cursor: se-resize;
  z-index: 2;
}

.resize-handle:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* Post window styles */
#postWindow .window-content {
  font-size: 1rem;
  line-height: 1.6;
}

#postWindow h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

#postWindow p {
  margin-bottom: 1rem;
}



.window-closing {
  animation: close-animation 0.5s forwards;
}

@keyframes close-animation {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.5) rotate(90deg);
    border-radius: 50%;
    opacity: 0.5;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

/* Hide windows by default */
#homeWindow, #aboutWindow, #blogWindow, #postWindow, #loginWindow, #adminWindow {
  display: none;
}