.window {
  position: absolute;
  background: rgba(30, 41, 59, 0.98);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  overflow: hidden;
  will-change: transform;
  contain: layout style paint;
}

.window.active {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 30px 60px rgba(59, 130, 246, 0.2);
}

.window.maximized {
  border-radius: 0;
}

.titleBar {
  height: 40px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  cursor: move;
  user-select: none;
  will-change: transform;
}

.titleLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.windowIcon {
  font-size: 16px;
  flex-shrink: 0;
}

.windowTitle {
  color: #e1e5f2;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titleRight {
  display: flex;
  gap: 2px;
}

.controlButton {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: #e1e5f2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.controlButton:hover {
  background: rgba(255, 255, 255, 0.1);
}

.closeButton:hover {
  background: #e53e3e;
  color: white;
}

.windowContent {
  height: calc(100% - 40px);
  overflow: hidden;
  position: relative;
  will-change: scroll-position;
  /* Enable smooth scrolling with hardware acceleration */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* Optimize scrolling performance */
  contain: layout style paint;
}

/* Custom scrollbar for smooth experience */
.windowContent::-webkit-scrollbar {
  width: 8px;
}

.windowContent::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 4px;
}

.windowContent::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.windowContent::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

.windowContent::-webkit-scrollbar-thumb:active {
  background: rgba(59, 130, 246, 0.8);
}

.defaultContent {
  padding: 30px;
  text-align: center;
  color: #e1e5f2;
}

.defaultContent h2 {
  margin: 0 0 15px 0;
  color: #3b82f6;
}

.defaultContent p {
  margin: 0;
  color: #cbd5e1;
}

.loadingSpinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 20px;
  color: #e1e5f2;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Smooth scrolling optimization for all content */
.smoothScroll {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.4) rgba(15, 23, 42, 0.5);
}

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
  .windowContent {
    scroll-behavior: auto;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .window {
    border-radius: 8px;
  }

  .titleBar {
    height: 44px;
    padding: 0 12px;
  }

  .controlButton {
    width: 36px;
    height: 36px;
  }

  .windowContent {
    height: calc(100% - 44px);
    /* Enhanced touch scrolling for mobile */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}
