/* Tavus.io-inspired draggable windows system */

/* Main desktop area */
.desktop-area {
  position: relative;
  min-height: 1400px;
  width: 100%;
  max-width: 100%;
  padding: 0 !important;
  margin: 0;
  overflow: visible;
  background: #ffffff;
}

[data-theme="dark"] .desktop-area {
  background: #0d0d0d;
}

/* Draggable window styling - retro computer window aesthetic */
.draggable-window {
  position: absolute;
  width: 380px;
  background: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  border: 3px solid #000;
  border-radius: 8px;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s ease, opacity 0.3s ease;
  z-index: 100;
  touch-action: none;
  overflow: hidden;
}

.draggable-window:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .draggable-window {
  background: #2a2a2a;
  border-color: #e0e0e0;
  box-shadow: 6px 6px 0px rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .draggable-window:hover {
  box-shadow: 8px 8px 0px rgba(255, 255, 255, 0.15);
}

.draggable-window.minimized {
  opacity: 0;
  transform: scale(0.7) translateY(50px) !important;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Individual window starting positions - centered grid with slight offsets */
/* Row 1 */
.draggable-window[data-window-id="window-1"] {
  left: 18%;
  top: 40px;
  z-index: 101;
}

.draggable-window[data-window-id="window-2"] {
  left: 52%;
  top: 60px;
  z-index: 102;
}

/* Row 2 */
.draggable-window[data-window-id="window-3"] {
  left: 20%;
  top: 380px;
  z-index: 103;
}

.draggable-window[data-window-id="window-4"] {
  left: 50%;
  top: 400px;
  z-index: 104;
}

/* Row 3 */
.draggable-window[data-window-id="window-5"] {
  left: 16%;
  top: 720px;
  z-index: 105;
}

.draggable-window[data-window-id="window-6"] {
  left: 54%;
  top: 740px;
  z-index: 106;
}

/* Row 4 */
.draggable-window[data-window-id="window-7"] {
  left: 19%;
  top: 1060px;
  z-index: 107;
}

.draggable-window[data-window-id="window-8"] {
  left: 51%;
  top: 1080px;
  z-index: 108;
}

/* Window header - retro title bar */
.window-header {
  padding: 0.75rem 1rem;
  border-bottom: 3px solid #000;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff176;
  user-select: none;
  position: relative;
}

[data-theme="dark"] .window-header {
  border-bottom-color: #e0e0e0;
  background: #1e3a5f;
}

.window-header.blue {
  background: #b3d9ff;
}

[data-theme="dark"] .window-header.blue {
  background: #2d4a6f;
}

.window-header.purple {
  background: #e6ccff;
}

[data-theme="dark"] .window-header.purple {
  background: #3d2a5f;
}

.window-header.green {
  background: #b3f5e6;
}

[data-theme="dark"] .window-header.green {
  background: #2a5f4d;
}

.window-header.orange {
  background: #ffd9b3;
}

[data-theme="dark"] .window-header.orange {
  background: #5f4a2d;
}

.window-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  color: #000;
  text-shadow: none;
  letter-spacing: 0.02em;
  font-family: monospace;
}

[data-theme="dark"] .window-title {
  color: #fff;
}

.window-controls {
  display: flex;
  gap: 0.5rem;
}

.window-btn {
  width: 24px;
  height: 24px;
  border: 2px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  transition: all 0.1s ease;
  line-height: 1;
  padding: 0;
  font-family: monospace;
}

.window-btn:hover {
  background: #000;
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
}

.window-btn:active {
  transform: translate(0, 0);
  box-shadow: none;
}

/* Window content */
.window-content {
  padding: 0;
  max-height: 500px;
  overflow-y: auto;
  background: #ffffff;
}

[data-theme="dark"] .window-content {
  background: #2a2a2a;
}

.window-image {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 3px solid #000;
  margin: 0;
}

[data-theme="dark"] .window-image {
  border-bottom-color: #e0e0e0;
}

.window-content p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  padding: 0 1.5rem;
}

.window-content p:first-of-type {
  margin-top: 1.5rem;
}

.window-content .meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-dim);
  text-transform: uppercase;
  font-family: monospace;
  padding: 0 1.5rem;
}

.window-content a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #FF3366;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 0 1.5rem;
  transition: all 0.2s ease;
}

[data-theme="dark"] .window-content a {
  color: #FF6699;
}

.window-content a:hover {
  gap: 0.5rem;
  color: #FF6183;
}

[data-theme="dark"] .window-content a:hover {
  color: #FFB3CC;
}

/* Dock for minimized windows */
#window-dock {
  position: fixed;
  bottom: 100px;
  right: 20px;
  display: flex;
  gap: 16px;
  z-index: 1000;
  padding: 12px 20px;
  align-items: center;
  background: #ffffff;
  border: none;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

#window-dock:empty {
  display: none;
}

[data-theme="dark"] #window-dock {
  background: #1a1a1a;
}

.dock-icon {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.dock-icon:hover {
  transform: scale(1.05);
}

.win-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FF6183;
}

/* Intro section adjustments for desktop */
.intro-desktop {
  padding-top: 3rem;
  padding-bottom: 3rem;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.intro-desktop p {
  font-size: 1.15rem;
  line-height: 1.75;
  margin: 0;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.intro-desktop strong {
  font-weight: 900;
  color: var(--ink);
}


/* Responsive */
@media (max-width: 900px) {
  .draggable-window {
    width: 90%;
    max-width: 400px;
  }

  .desktop-area {
    min-height: 600px;
  }
}

@media (max-width: 600px) {
  .window-header {
    padding: 0.75rem;
  }

  .window-title {
    font-size: 1rem;
  }

  .window-content {
    padding: 1rem;
    max-height: 300px;
  }

  #window-dock {
    bottom: 10px;
    right: 10px;
    padding: 0.5rem;
  }

  .dock-icon {
    width: 40px;
    height: 40px;
  }

  .win-dot {
    width: 16px;
    height: 16px;
  }
}
