/* === Popup-System (Dark Mode) === */

.popup {
  position: absolute;
  min-width: 220px;
  min-height: 120px;
  width: 320px;
  height: 200px;
  background: #1e1e1e;
  border: 1px solid #2c2c2c;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
  transition: opacity 0.15s ease, transform 0.15s ease;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.popup[style*="left"][style*="top"] {
  transform: none;
}

.popup.is-inactive {
  opacity: 0.8;
}

/* Kopfzeile */
.popup-header {
  padding: 8px 12px;
  font-weight: 600;
  background: #252525;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e0e0e0;
  cursor: grab;
}

.popup-title {
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Schließen-Button */
.popup-actions {
  display: flex;
  gap: 6px;
  margin-left: 10px;
}

.popup-btn {
  border: 0;
  background: transparent;
  color: #aaa;
  font: inherit;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.popup-btn:hover {
  background: #2e2e2e;
  color: #fff;
}

/* Inhaltsbereich */
.popup-body {
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
  overflow: auto;
  flex: 1;
  position: relative;
  color: #ccc;
  background: #1b1b1b;
}

/* iframe innerhalb Popup */
.popup-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* Resize-Griff */
.popup-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  cursor: se-resize;
  opacity: 0.6;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.popup-resize:hover {
  border-color: #999;
  opacity: 1;
}

/* Fokus (aktiviertes Popup nach vorne holen) */
.popup:focus-within,
.popup:not(.is-inactive) {
  opacity: 1;
  transform: scale(1.01);
  box-shadow: 0 0 20px rgba(0,0,0,0.7);
}

.popup [hidden] {
  display: none !important;
}

.popup .auth-wrap { display:flex; flex-direction:column; gap:12px; height:100%; }
.popup .auth-tabs { display:flex; gap:8px; }
.popup .auth-tab {
        border:1px solid #333; background:#252525; color:#ddd;
        padding:6px 10px; border-radius:6px; cursor:pointer;
      }
      .popup .auth-tab[aria-selected="true"] { background:#333; border-color:#555; }
      .popup .auth-panels { flex:1; overflow:auto; display:block; }
      .popup .auth-panel { display:grid; gap:10px; }
      .popup .auth-field { display:grid; gap:6px; }
      .popup .auth-field input {
        background:#141414; color:#eee; border:1px solid #333;
        border-radius:6px; padding:8px;
      }
      .popup .auth-field input:focus { outline:none; border-color:#666; }
      .popup .auth-submit {
        margin-top:6px; padding:8px 12px; border-radius:6px;
        background:#2f6fed; border:1px solid #2a5fd0; color:#fff; cursor:pointer;
      }
      .popup .auth-submit:hover { filter:brightness(1.05); }

.popup-body .smiley-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.popup-body .smiley-btn {
  border: 0px;
  padding: 4px 6px;
  cursor: pointer;
  background: transparent;
  border-radius: 3px;
  font-size: 20px;
  line-height: 1;
}

.popup-body .smiley-btn img {
  max-width: 50px;
  max-height: 50px;
  display: block;
}
