/**
 * Path Pilot Main Styles
 */

.path-pilot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.path-pilot-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.path-pilot-button:hover {
  background-color: #45a049;
  transform: scale(1.05);
}

.path-pilot-recommendations {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 300px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  padding: 15px;
  display: none;
}

.path-pilot-recommendations.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.path-pilot-recommendations h3 {
  margin-top: 0;
  color: #333;
  font-size: 16px;
  font-weight: 600;
}

.path-pilot-recommendations ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}

.path-pilot-recommendations li {
  margin-bottom: 10px;
}

.path-pilot-recommendations li a {
  color: #2C7BE5;
  text-decoration: none;
  display: block;
  padding: 5px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.path-pilot-recommendations li a:hover {
  background-color: #f5f5f5;
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.pp-recommendation-skeleton {
  background: #f3f3f3;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
  min-height: 60px;
  position: relative;
  overflow: hidden;
}
.pp-skeleton-title,
.pp-skeleton-synopsis {
  background: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
  width: 80%;
  height: 18px;
  animation: pp-skeleton-loading 1.2s infinite linear;
}
.pp-skeleton-synopsis {
  width: 95%;
  height: 14px;
}
@keyframes pp-skeleton-loading {
  0% { background-color: #303030; }
  50% { background-color: #555555; }
  100% { background-color: #303030; }
}

.pp-drawer-rec-synopsis {
  display: block;
  font-size: 0.8rem;
  color: #999;
  margin-top: 2px;
  margin-bottom: 4px;
  line-height: 1.4;
  white-space: normal;
}

.pp-drawer-rec-badge {
  display: inline-block;
  font-size: 0.5rem;
  line-height: .6rem;
  text-transform: uppercase;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  margin-top: 0; /* Adjust margin */
  vertical-align: middle;
  background: #eee;
  color: #444;
  letter-spacing: 0.02em;
}

.pp-badge-conversion_path {
  background: #1976d2 !important;
  color: #fff !important;
}

.pp-badge-popular {
  background: #c58723 !important;
  color: #fff !important;
}

.pp-badge-related {
  background: #8e24aa !important;
  color: #fff !important;
}

.pp-badge-newest {
  background: #0e7d15 !important;
  color: #fff !important;
}

.pp-chat-input-container {
  align-items: flex-end;
  flex-shrink: 0;
  min-height: 40px;
  max-height: 240px;
  overflow: visible;
  position: relative;
  padding-top: 16px;
}
.pp-drawer-chat-input {
  max-height: 200px;
  overflow-y: hidden;
  resize: none;
}
.pp-drawer-chat-input::-webkit-scrollbar {
  display: none;
}

.pp-drawer-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pp-drawer-recommendations,
.pp-rec-chat-separator,
.pp-drawer-footer {
  flex-shrink: 0;
}

.pp-drawer-chat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
}

.pp-chat-history-container {
  flex: 1 1 0;
  min-height: 120px;
  /* max-height: 50vh; */
  background: transparent;
  border: none;
  margin-bottom: 10px;
  overflow-y: auto;
  padding: 0;
  box-shadow: none;
}

/* Dark scrollbar for chat history container */
.pp-chat-history-container::-webkit-scrollbar {
  width: 8px;
  background: transparent;
}
.pp-chat-history-container::-webkit-scrollbar-thumb {
  background: #232323;
  border-radius: 4px;
}
.pp-chat-history-container::-webkit-scrollbar-thumb:hover {
  background: #444;
}
.pp-chat-history-container {
  scrollbar-width: thin;
  scrollbar-color: #232323 transparent;
}

.pp-chat-history {
  padding: 12px 16px 12px 16px;
}

/* Optional: Make chat input stick to the bottom */
.pp-chat-input-container {
  margin-top: auto;
}

.pp-chat-history {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0.5rem;
  justify-content: flex-end;
}
.pp-chat-history::-webkit-scrollbar {
  width: 6px;
  background: transparent;
}
.pp-chat-history::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}
.pp-chat-history::-webkit-scrollbar-thumb:hover {
  background: #222;
} 

:root {
    --pp-drawer-handle-top: 0.5rem;
  }
  .pp-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 0;
    background: var(--pp-dark, #181818);
    color: var(--pp-white, #fff);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: width 0.3s cubic-bezier(.4,0,.2,1);
    overflow: visible;
  }
  .pp-drawer .pp-drawer-content {
    pointer-events: none;
    width: 320px;
    background: var(--pp-dark, #181818);
    height: 100vh;
    box-sizing: border-box;
    padding: 11px 20px 0 24px;
    display: flex;
    flex-direction: column;
    position: absolute;
    left: -320px;
    top: 0;
    overflow: hidden;
  }
  .pp-drawer.expanded {
    width: 320px;
    left:0;
  }
  .pp-drawer.expanded .pp-drawer-content {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    left: 0;
    transition: left 0.3s cubic-bezier(.4,0,.2,1);
  }

  /* Handle styles with high specificity to override theme styles */
  .pp-drawer .pp-drawer-handle,
  .pp-drawer button.pp-drawer-handle,
  button.pp-drawer-handle {
      position: absolute !important;
      left: 0.5rem !important;
      top: 0.5rem !important;
      width: 24px !important;
      height: 24px !important;
      padding: 0 !important;
      margin: 0 !important;
      background: #232323 !important;
      background-color: #232323 !important;
      border: none !important;
      border-radius: 12px !important;
      color: #fff !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      cursor: pointer !important;
      z-index: 10000 !important;
      transition: all 0.3s cubic-bezier(.4,0,.2,1) !important;
      font-size: 1.2rem !important;
      outline: none !important;
      box-shadow: none !important;
      text-decoration: none !important;
      line-height: 1 !important;
      font-family: inherit !important;
      font-weight: normal !important;
      text-align: center !important;
      vertical-align: baseline !important;
      min-width: auto !important;
      min-height: auto !important;
      max-width: none !important;
      max-height: none !important;
  }

  /* Handle icon styles with high specificity */
  .pp-drawer .pp-drawer-handle i,
  .pp-drawer button.pp-drawer-handle i,
  button.pp-drawer-handle i {
    color: #fff !important;
    font-size: 1.1rem !important;
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-weight: normal !important;
    text-decoration: none !important;
  }

  .pp-drawer-handle::after {
    content: "Need a hand? Click here for recommendations.";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    padding: 8px 12px;
    background: #232323;
    color: #fff;
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: none;
  }

  /* Only show tooltip when drawer is minimized AND not during transitions */
  .pp-drawer.minimized .pp-drawer-handle:hover::after {
    opacity: 1;
    transition: opacity 0.2s ease 0.3s;
  }

  /* Expanded state handle styles with high specificity */
  .pp-drawer.expanded .pp-drawer-handle,
  .pp-drawer.expanded button.pp-drawer-handle {
    left: 290px !important;
    opacity: 1 !important;
    transform: rotate(0deg) !important;
    background: #232323 !important;
    background-color: #232323 !important;
  }

  .pp-drawer.expanded .pp-drawer-handle::after {
    opacity: 0 !important;
    visibility: hidden !important;
  }

  /* Minimized state handle styles with high specificity */
  .pp-drawer.minimized .pp-drawer-handle,
  .pp-drawer.minimized button.pp-drawer-handle {
    left: 0.5rem !important;
    top: 0.5rem !important;
    transform: rotate(-360deg) !important;
    background: #232323 !important;
    background-color: #232323 !important;
  }

  .pp-drawer-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--pp-lighter-text, #646970);
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }
  .pp-drawer-rec-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
  }
  .pp-drawer-rec-list li {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
  }
  .pp-drawer-rec-title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0;
  }
  .pp-drawer-rec-title {
    flex-grow: 1;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    color: #fff;
    margin: 0;
  }
  
  /* New container for badge and percent */
  .pp-rec-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-bottom: 4px;
  }

  .pp-drawer-rec-percent {
    font-size: 0.6rem;
    font-weight: 600;
    color: #888;
    flex-shrink: 0;
  }
  

  .pp-chat-input-container {
    
    background: #323232;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    border: none;
    padding: 0.5rem 3.2rem 2rem 1rem;
    min-height: 40px;
    box-sizing: border-box;
    margin: 0;
  }
  .pp-drawer-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: #fff;
    padding: 0;
    min-height: 24px;
    resize: none;
    line-height: 1.5;
    font-family: inherit;
    background: transparent;
    margin: 0;
    overflow-y: auto;
  }
  .pp-drawer-chat-input::placeholder {
    color: #aaa;
    opacity: 1;
  }
  .pp-drawer-chat-send {
    position: absolute;
    right: 0.3rem;
    bottom: 0.3rem;
    background: #232323;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: background 0.2s, opacity 0.2s;
    padding: 0;
  }
  .pp-drawer-chat-send:disabled {
    opacity: 0.2;
    cursor: not-allowed;
  }
  .pp-drawer-chat-send:not(:disabled):hover, .pp-drawer-chat-send:not(:disabled):focus {
    background: #181818;
    opacity: 1;
  }
  .pp-drawer-chat-send svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: #fff;
  }
  .pp-drawer-footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #aaa;
    opacity: 0.7;
    z-index: 1;
    pointer-events: auto;
    padding: 0;
    margin: 0;
    line-height: 2rem;
  }

  /* Footer link styles with high specificity to override theme styles */
  .pp-drawer .pp-drawer-footer a.pp-footer-link,
  .pp-drawer .pp-drawer-footer a.pp-footer-link:link,
  .pp-drawer .pp-drawer-footer a.pp-footer-link:visited {
    color: #ccc !important;
    text-decoration: none !important;
    font-size: 11px !important;
    opacity: 0.8 !important;
    transition: color 0.2s !important;
  }
  .pp-drawer .pp-drawer-footer a.pp-footer-link:hover, 
  .pp-drawer .pp-drawer-footer a.pp-footer-link:focus,
  .pp-drawer .pp-drawer-footer a.pp-footer-link:active {
    color: #fff !important;
    opacity: 1 !important;
    text-decoration: underline !important;
  }
  .pp-drawer .pp-drawer-content {
    overflow-y: auto;
    padding-bottom: 2rem;
  }
  body.pp-drawer-open {
    transition: margin-left 0.3s cubic-bezier(.4,0,.2,1);
    margin-left: 320px !important;
  }
  .pp-drawer.minimized {
    width: 0 !important;
  }
  .pp-drawer.minimized .pp-drawer-content {
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .pp-drawer.minimized .pp-drawer-handle {
    left: 0.5rem;
    top:0.5rem
  }

  @media (max-width: 600px) {
    .pp-drawer.expanded {
      width: 100vw;
      left: 0;
      background: rgba(24,24,24,0.96); /* semi-transparent dark */
    }

    .pp-drawer.expanded .pp-drawer-handle {
        left:auto;
        right: 0.5rem;
    }

    .pp-drawer.expanded .pp-drawer-content {
      width: 100vw;
      left: 0;
      background: transparent; /* let the drawer background show through */
    }
    body.pp-drawer-open {
      margin-left: 0 !important; /* Don't push content */
    }
  }
  .pp-rec-chat-separator {
    width: 100%;
    height: 1px;
    background: #333; /* semi-transparent dark */
    margin: 10px 0 18px 0;
    opacity: 0.5;
    border-radius: 1px;
  }
  .pp-chat-history {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.5rem;
    justify-content: flex-end;
  }
  /* Minimal modern scrollbar, darker */
  .pp-chat-history::-webkit-scrollbar {
    width: 6px;
    background: transparent;
  }
  .pp-chat-history::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
  }
  .pp-chat-history::-webkit-scrollbar-thumb:hover {
    background: #222;
  }
  .pp-chat-history {
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
  }
  /* To hide the scrollbar completely, uncomment the following: */
  /*
  .pp-chat-history::-webkit-scrollbar { display: none; }
  .pp-chat-history { scrollbar-width: none; }
  */
  .pp-chat-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
  }
  .pp-chat-bubble {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 90%;
    word-break: break-word;
    box-sizing: border-box;
  }
  .pp-chat-user .pp-chat-bubble {
    background: #e6e6e6;
    color: #232323;
    margin-left: auto;
  }
  .pp-chat-assistant .pp-chat-bubble {
    background: #323232;
    color: #fff;
    margin-right: auto;
  }
  .pp-chat-tools {
    width: 100%;
    text-align: right;
    margin-bottom: 0.2rem;
    margin-top: 0.2rem;
  }
  .pp-chat-clear {
    color: #aaa;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.7;
    transition: color 0.2s, opacity 0.2s;
  }
  .pp-chat-clear:hover, .pp-chat-clear:focus {
    color: #fff;
    opacity: 1;
  }

  /* Chat bubble link styles - override theme colors with high specificity */
  .pp-drawer .pp-chat-bubble a,
  .pp-drawer .pp-chat-bubble a:link,
  .pp-drawer .pp-chat-bubble a:visited {
    color: #1976d2 !important;
    text-decoration: underline !important;
    font-weight: 500 !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
  }
  
  .pp-drawer .pp-chat-bubble a:hover,
  .pp-drawer .pp-chat-bubble a:focus,
  .pp-drawer .pp-chat-bubble a:active {
    color: #1565c0 !important;
    text-decoration: underline !important;
    background: none !important;
    opacity: 1 !important;
  }
  
  /* Additional specificity for chat assistant links (white background) */
  .pp-drawer .pp-chat-assistant .pp-chat-bubble a,
  .pp-drawer .pp-chat-assistant .pp-chat-bubble a:link,
  .pp-drawer .pp-chat-assistant .pp-chat-bubble a:visited {
    color: #64b5f6 !important;
  }
  
  .pp-drawer .pp-chat-assistant .pp-chat-bubble a:hover,
  .pp-drawer .pp-chat-assistant .pp-chat-bubble a:focus,
  .pp-drawer .pp-chat-assistant .pp-chat-bubble a:active {
    color: #90caf9 !important;
  }

  /* General drawer link protection - catch any other links */
  .pp-drawer a:not(.pp-footer-link),
  .pp-drawer a:not(.pp-footer-link):link,
  .pp-drawer a:not(.pp-footer-link):visited {
    color: #1976d2 !important;
    text-decoration: underline !important;
    background: none !important;
    border: none !important;
  }
  
  .pp-drawer a:not(.pp-footer-link):hover,
  .pp-drawer a:not(.pp-footer-link):focus,
  .pp-drawer a:not(.pp-footer-link):active {
    color: #1565c0 !important;
    text-decoration: underline !important;
    background: none !important;
  }

@keyframes pp-beacon-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(25, 118, 210, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(25, 118, 210, 0);
  }
}

.pp-drawer-handle.pp-beacon {
  animation: pp-beacon-pulse 1.2s infinite;
}

.pp-drawer-rec-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0;
}

.pp-drawer-rec-synopsis {
  display: block;
  font-size: 0.8rem;
  color: #999;
  margin-top: -2px;
  margin-bottom: 4px;
  line-height: 1.4;
  white-space: normal;
}