body {
  margin: 0;
  height: 100vh;
  background: #2f3138;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, Helvetica, sans-serif;
}

/* Old UI placeholder */
#old-ui {
  position: absolute;
  top: 40%;
}

#clickme {
  padding: 10px 20px;
  font-size: 14px;
}

/* ================= POPUP WINDOW ================= */

#window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  min-width: 520px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  display: none;
  z-index: 9999;
  overflow: hidden;
}

/* Title bar - FIXED ALIGNMENT */
#title-bar-width {
  width: 100%;
  background: #f1f1f1;
  border-bottom: 1px solid #d1d1d1;
}

#title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  height: 40px;
  background: #000;
  color: white;
  font-size: 14px;
}

/* FIXED: Title bar content alignment */
#title-bar > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  padding-top: 0;
}

/* Specific fix for the logo image and text container */
#title-bar > div:first-child > div {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
}

/* Fix for logo image vertical alignment */
#title-bar #logo {
  vertical-align: middle;
  display: inline-block;
}

/* Fix for logo description text */
#title-bar #logo-description {
  line-height: 40px; /* Match title bar height */
  vertical-align: middle;
  display: inline-block;
  margin: 0;
  padding: 0;
}

#title-bar span {
  cursor: default;
}

/* Window controls container */
#title-bar > div:last-child {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1px;
}

/* Window control buttons */
#minimize,
#square,
#exit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 100%;
  font-size: 14px;
  line-height: 1;
  background: #000;
  color: white;
  cursor: pointer;
  user-select: none;
  border: none;
  padding: 0;
  transition: background-color 0.2s;
}

#minimize:hover,
#square:hover {
  background: #333;
}

#exit:hover {
  background: #e81123;
}

#exit {
  font-size: 15px;
  border-radius: 0 6px 0 0;
}

#minimize {
  font-size: 18px;
  padding-bottom: 4px; /* Adjust dash position */
}

#square::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 2px solid white;
  display: block;
}

/* URL bar */
#url-bar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #ddd;
  font-size: 12px;
  color: #444;
  background: #f6f6f6;
}

#ssl-padlock {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

#domain-name {
  color: #444;
  font-size: 11px;
  vertical-align: middle;
}

/* iframe */
#content {
  width: 100%;
  height: 520px;
  border: none;
  display: block;
}

/* ================= RESIZE HANDLES ================= */

.resize-handle {
  position: absolute;
  background: transparent;
  z-index: 10000;
}

.resize-right {
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
}

.resize-bottom {
  bottom: 0;
  left: 0;
  height: 6px;
  width: 100%;
  cursor: ns-resize;
}

.resize-corner {
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}

.logo {
  padding: 28px 0 18px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  max-width: 150px; /* ideal for 320px card */
  width: 100%;
  height: auto;
  display: block;
}

/* Additional fixes for proper layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#title-bar img {
  margin: 0;
  padding: 0;
  display: block;
}

/* Ensure all elements in title bar are properly aligned */
#title-bar > div {
  flex-shrink: 0;
}
