.tobi-transparentTextEditing,
.flt-text-editing {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

#tobi-container-login {
  position: fixed;
  top: 100px;
  left: 100px;
  width: 80%;
  height: 80%;
  border: 3px solid #ddd;
  background-color: #f2f2f2;
  z-index: 666;
}

#tobi-iframe-login {
  position: fixed;
  width: 100%;
  height: 100%;
  border: 3px solid #ddd;
  background-color: #f2f2f2;
  z-index: 666;
}

#tobi-content-area {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  margin: 0;
  padding: 0;
  pointer-events: none; /* Not clickable */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  touch-action: none;
  overflow: hidden;
}

#tobi-iframe-container {
  position: fixed;
  top: auto;
  left: auto;
  bottom: 20px;
  right: 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 3px solid #ddd;
  background-color: #f2f2f2;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s ease;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  box-sizing: border-box;
  z-index: 100;
  pointer-events: auto;
}

#tobi-iframe-container.visible {
  display: flex;
}

#tobi-iframe-container.minimized {
  /*
  height: 100px !important;
  width: 360px !important;
  */
  transition: all 0.3s ease;
}

#tobi-iframe-container.dragging {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
  opacity: 0.9;
  transition: none;
}

#tobi-drag-area {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 80px);
  height: 26px;
  z-index: 9999;
  background: transparent;
}

#tobi-frame-navbar {
  height: 26px;
  width: 100%;
  background: #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  border-bottom: 1px solid #e0e0e0;
  flex-shrink: 0;
  box-sizing: border-box;
  user-select: none;
  padding-right: 10px;
  overflow: visible; /* Allow badges to extend outside navbar */
}

#tobi-frame-drag-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

#tobi-frame-drag-icon img {
  width: 33px;
  height: 16px;
}

#tobi-frame-buttons {
  display: flex;
  height: 100%;
}

.tobi-frame-button {
  width: 35px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  outline: none;
}

.tobi-frame-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.tobi-frame-button:focus-visible {
  width: 31px;
  height: calc(100% - 4px);
  border: 2px solid #0065d1;
}

/* No focus indicator on browsers without :focus-visible support*/
.tobi-frame-button:focus:not(:focus-visible) {
  width: 35px;
  height: 100%;
  border: 0;
}

.tobi-frame-button img {
  width: 16px;
  height: 16px;
  transition: all 0.2s ease;
  filter: brightness(0.2);
}

#tobi-iframe {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: none;
  background: #f2f2f2;
  position: relative;
  display: none;
  z-index: 1000;
}

#tobi-loading-screen {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border: none;
  background: #fff;
  position: relative;

  padding: 10px 45px 10px 45px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  overflow: hidden; /* Ensure loading content is properly contained */
  transition: none;
}

#tobi-iframe-container.fullscreen #tobi-loading-screen {
  padding: 0 45px 30px 45px;
}

#tobi-loading-center-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  visibility: visible;
  opacity: 1;
  transition:
    visibility 0s,
    opacity 0.6s linear;
}

#tobi-loading-bottom-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

#tobi-loading-avatar {
  margin-bottom: 10px;
}

#tobi-loading-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

#tobi-loading-main-text {
  color: #6e6e6e;
  font-family: "Vodafone", Arial, sans-serif;
  font-size: 17px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.4;
}

#tobi-loading-spinner {
  width: 25px;
  height: 25px;
  border: 2px solid #e60000;
  border-top: 2px solid #f2f2f2;
  border-left: 2px solid #f2f2f2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

#tobi-loading-text {
  color: #6e6e6e;
  font-size: 16px;
  font-weight: 400;
  font-family: "Vodafone", Arial, sans-serif;
}

#tobi-floating-action-button {
  position: fixed;
  width: 56px;
  height: 56px;
  bottom: 35px;
  right: 0;
  border-radius: 5px;
  background-color: #fe000c;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  pointer-events: auto;
  user-select: auto;
  touch-action: auto;
}

#tobi-floating-action-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#tobi-floating-action-button:focus-visible {
  outline: 2px solid #0065d1;
}

/* No focus indicator on browsers without :focus-visible support*/
#tobi-floating-action-button:focus:not(:focus-visible) {
  outline-style: none;
}

#tobi-floating-action-button img {
  width: 56px;
  height: 56px;
  padding: 12px;
  filter: invert(100%);
}

/* Badge styles */
.tobi-badge {
  position: absolute;
  background-color: #e60000;
  color: white;
  border-radius: 50%;
  font-family: "Vodafone", Arial, sans-serif;
  font-weight: bold;
  font-size: 12px;
  text-align: center;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

/* Badge on floating action button */
.tobi-floating-badge {
  top: -6px;
  left: -6px;
}

/* Badge on minimized chat frame - positioned in top-left corner of navbar */
.tobi-minimized-badge {
  top: 1px;
  left: 3px;
}

#tobi-resize-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent !important;
  z-index: 9999;
  display: none;
  pointer-events: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.tobi-resize-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 10px;
}

.tobi-resize-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 10px;
}

.tobi-resize-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
}

.tobi-resize-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 100%;
}

/* Fullscreen mode styles */
#tobi-iframe-container.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 9999 !important;
  transition: none !important;
}

/* Hide UI elements in fullscreen */
#tobi-iframe-container.fullscreen #tobi-frame-navbar,
#tobi-iframe-container.fullscreen #tobi-drag-area,
#tobi-iframe-container.fullscreen .tobi-resize-top,
#tobi-iframe-container.fullscreen .tobi-resize-right,
#tobi-iframe-container.fullscreen .tobi-resize-bottom,
#tobi-iframe-container.fullscreen .tobi-resize-left {
  display: none !important;
  transition: none !important;
}

/* Loading screen adjustments for fullscreen */
#tobi-iframe-container.fullscreen #tobi-loading-screen {
  top: 0 !important;
  height: 100% !important;
}

/* Loading state styles - disable interactions and provide visual feedback */
#tobi-iframe-container.loading #tobi-drag-area,
#tobi-iframe-container.loading .tobi-frame-minmax {
  cursor: not-allowed;
}

#tobi-iframe-container.loading #tobi-frame-drag-icon img,
#tobi-iframe-container.loading .tobi-frame-minmax img,
#tobi-iframe-container.loading .tobi-frame-minmax {
  opacity: 0.4;
}

#tobi-iframe-container.loading .tobi-frame-minmax:hover {
  background-color: transparent;
}

#tobi-iframe-container.loading {
  border-radius: 8px !important;
  border: 1px solid #ddd !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: none !important;
  /*
  width: 420px !important;
  height: 300px !important;
  position: fixed !important;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  */
}

/* Responsive breakpoint - automatically switch to fullscreen below 768px */
@media (max-width: 767px) {
  #tobi-iframe-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }

  /* Fallback for browsers that don't support dvh */
  @supports (not (height: 100dvh)) {
    #tobi-iframe-container.fullscreen {
      height: calc(100vh - env(keyboard-inset-height, 0px)) !important;
    }
  }

  #tobi-iframe-container.fullscreen #tobi-frame-navbar {
    display: none !important;
  }

  /* Mobile loading screen layout - center entire loading content vertically */
  #tobi-loading-screen {
    justify-content: center !important;
    align-items: center !important;
  }

  #tobi-loading-center-content {
    flex: none !important;
    margin-bottom: 45px !important;
  }
}

/* Mobile loading screen - use full width on
small screens when not in fullscreen mode */
@media (max-width: 450px) {
  #tobi-iframe-container.loading:not(.fullscreen) {
    width: 90vw !important;
    left: calc(10vw / 2) !important;
  }
}

.tobi-debug {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 15px;
  border-radius: 5px;
  max-width: 400px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 9999;
  font-family: monospace;
  font-size: 12px;
}
.tobi-debug p {
  margin: 3px 0;
  line-height: 1.4;
  color: #00ff00;
  font-size: 12px;
}
