
/* JobTM AI Assistant - Professional UI */

#jobtm-ai-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 62px;
  height: 62px;
  border: 2px solid var(--jd-accent);
  border-radius: 50%;
  background: var(--jd-primary);
  color: var(--jd-white);
  font-size: 28px;
  cursor: pointer;
  z-index: 2147483000;
  box-shadow: 0 6px 22px rgba(16,42,67,.28);
  transition: transform .2s ease;
}

#jobtm-ai-launcher:hover {
  transform: scale(1.06);
}

#jobtm-ai-panel {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 390px;
  height: 550px;
  max-height: calc(100dvh - 115px);
  background: var(--jd-white);
  border: 1px solid var(--jd-border);
  border-radius: 18px;
  box-shadow: 0 12px 45px rgba(0,0,0,.18);
  z-index: 2147483000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}

#jobtm-ai-panel.open {
  display: flex;
}

#jobtm-ai-header {
  background: var(--jd-primary);
  color: var(--jd-white);
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--jd-accent);
}

#jobtm-ai-header strong {
  font-size: 16px;
}

#jobtm-ai-close {
  background: transparent;
  color: var(--jd-white);
  border: none;
  font-size: 26px;
  cursor: pointer;
}

#jobtm-ai-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--jd-bg);
}

.jobtm-ai-message {
  padding: 12px 14px;
  border-radius: 14px;
  max-width: 88%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}

.jobtm-ai-bot {
  background: var(--jd-white);
  color: var(--jd-text);
  align-self: flex-start;
  border: 1px solid var(--jd-border);
  border-bottom-left-radius: 4px;
}

.jobtm-ai-user {
  background: var(--jd-primary);
  color: var(--jd-white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.jobtm-ai-bot a {
  color: #0b62a3;
  text-decoration: underline;
}

#jobtm-ai-form {
  display: flex;
  padding: 14px;
  gap: 9px;
  border-top: 1px solid var(--jd-border);
  background: var(--jd-white);
}

#jobtm-ai-input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

#jobtm-ai-input:focus {
  border-color: var(--jd-accent);
}

#jobtm-ai-send {
  background: var(--jd-accent);
  color: var(--jd-primary);
  border: none;
  border-radius: 10px;
  padding: 0 17px;
  cursor: pointer;
  font-weight: 700;
}

#jobtm-ai-send:disabled {
  opacity: .6;
  cursor: wait;
}

@media (max-width: 480px) {
  #jobtm-ai-launcher {
    right: 16px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    width: 54px;
    height: 54px;
    font-size: 25px;
  }

  #jobtm-ai-panel {
    right: 10px;
    bottom: calc(164px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 20px);
    height: min(540px, calc(100dvh - 185px - env(safe-area-inset-bottom, 0px)));
    max-height: none;
  }
}

@media (max-width: 480px) and (max-height: 600px) {
  #jobtm-ai-panel {
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - 105px - env(safe-area-inset-bottom, 0px));
  }
}

/* JobTM AI Assistant compact desktop layout */
@media (min-width: 481px) {
  #jobtm-ai-panel {
    height: 480px;
  }
}


/* JobTM AI voice input button */
#jobtm-ai-mic {
  flex: 0 0 42px;
  min-width: 42px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: var(--jd-bg);
  color: var(--jd-primary);
  font-size: 19px;
  cursor: pointer;
}

#jobtm-ai-mic:hover {
  background: var(--jd-accent-light);
}

#jobtm-ai-mic:focus-visible {
  outline: 2px solid var(--jd-accent);
  outline-offset: 2px;
}

#jobtm-ai-mic[hidden] {
  display: none !important;
}


/* JobTM microphone inside input box */
#jobtm-ai-form {
  position: relative;
}

#jobtm-ai-input {
  padding-right: 53px;
}

#jobtm-ai-mic {
  position: absolute;
  right: 120px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  z-index: 2;
}

#jobtm-ai-mic:hover {
  background: var(--jd-primary-light);
}


/* JobTM AI quick actions - website root design */
#jobtm-ai-quick-actions {
  display: flex;
  gap: 9px;
  padding: 12px 14px;
  overflow-x: auto;
  background: var(--jd-white);
  border-top: 1px solid var(--jd-border);
  scrollbar-width: thin;
}

#jobtm-ai-quick-actions button {
  flex: 0 0 auto;
  padding: 9px 14px;
  background: var(--jd-bg);
  color: var(--jd-primary);
  border: 1px solid var(--jd-border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#jobtm-ai-quick-actions button:hover {
  background: var(--jd-accent-light);
  border-color: var(--jd-accent);
}
