/* content.css */

/* Floating Trigger Button */
#ps-trigger-btn {
  position: fixed;
  bottom: 40%; 
  right: 20px;

  background: rgba(107, 114, 128, 0.25); 
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  color: white;
  border: none;
  border-radius: 50px;

  padding: 12px 12px;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;
  font-size: 14px;

  cursor: pointer;

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.2);

  z-index: 2147483646;

  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  display: flex;
  align-items: center;
  gap: 8px;

  overflow: hidden;
}

#ps-trigger-btn span {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;

  transition:
    max-width 0.35s ease,
    opacity 0.25s ease,
    margin 0.3s ease;
}

#ps-trigger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.5), 0 8px 10px -6px rgba(99, 102, 241, 0.1);
}

#ps-trigger-btn:active {
  transform: translateY(1px);
}

#ps-trigger-btn.ps-loading {
  background: linear-gradient(135deg, #475569, #334155);
  cursor: wait;
}

#ps-summary-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  z-index: 2147483647; /* Max z-index */
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #f8fafc;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ps-summary-panel.ps-show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#ps-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#ps-panel-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(to right, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#ps-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.2s;
}

#ps-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

#ps-panel-content {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

/* Scrollbar styles for the content */
#ps-panel-content::-webkit-scrollbar {
  width: 6px;
}
#ps-panel-content::-webkit-scrollbar-track {
  background: transparent;
}
#ps-panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* Markdown Styles inside content */
#ps-panel-content h1, 
#ps-panel-content h2, 
#ps-panel-content h3 {
  color: #f8fafc;
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 600;
}

#ps-panel-content h1:first-child, 
#ps-panel-content h2:first-child {
  margin-top: 0;
}

#ps-panel-content p {
  margin-bottom: 16px;
}

#ps-panel-content ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

#ps-panel-content li {
  margin-bottom: 8px;
}

#ps-panel-content strong {
  color: #f1f5f9;
  font-weight: 700;
}

.ps-error-msg {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.ps-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  gap: 16px;
}

.ps-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #818cf8;
  animation: ps-spin 1s ease-in-out infinite;
}

@keyframes ps-spin {
  to { transform: rotate(360deg); }
}

#ps-trigger-btn:hover span,
#ps-trigger-btn.ps-active span {
  max-width: 200px;
  opacity: 1;
  margin-left: 4px;
}

#ps-trigger-btn:hover,
#ps-trigger-btn.ps-active {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  transform: translateY(-4px) scale(1.03);

  box-shadow:
    0 15px 30px rgba(34, 197, 94, 0.35);
}

#ps-trigger-btn:active {
  transform: translateY(0px) scale(0.98);
}

#ps-trigger-btn.ps-loading {
  background: linear-gradient(135deg, #475569, #334155);
  cursor: wait;
}

@media (max-width: 768px) {
  #ps-trigger-btn {
    bottom: 30px;
    right: 15px;
    padding: 11px 14px;
  }

  #ps-trigger-btn:hover span,
  #ps-trigger-btn.ps-active span {
    max-width: 140px;
  }
}