/* Setu Intelligence Pet Assistant & Floating Request Modal */

:root {
  --pet-primary: #38bdf8;
  --pet-accent: #6366f1;
  --pet-bg: #0b1120;
  --pet-card-bg: rgba(15, 23, 42, 0.94);
  --pet-border: rgba(56, 189, 248, 0.25);
  --pet-text: #f8fafc;
  --pet-text-muted: #94a3b8;
  --pet-success: #34d399;
  --pet-warning: #fbbf24;
  --pet-danger: #f87171;
}

/* Floating Pet Button */
.setu-pet-floating-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99990;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  animation: petLevitate 3.5s ease-in-out infinite;
  padding: 0;
  overflow: visible;
}

.setu-pet-floating-btn:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6), 0 0 28px rgba(56, 189, 248, 0.55);
  border-color: rgba(56, 189, 248, 0.85);
}

.setu-pet-floating-btn:active {
  transform: scale(0.96);
}

@keyframes petLevitate {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Status Indicator Dot */
.setu-pet-status-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px #34d399;
  z-index: 5;
  pointer-events: none;
}

/* Gearbot Mascot Sprite Styles (page-mascot) */
.gearbot-mascot {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  pointer-events: auto;
}

.gearbot-squash {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 78%;
}

.gearbot-layer {
  position: absolute;
  inset: 0;
  background-size: 300% 300%;
  background-repeat: no-repeat;
  image-rendering: -webkit-optimize-contrast;
  transition: opacity 0.1s ease;
  pointer-events: none;
}

.gearbot-header {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gearbot-header:hover {
  transform: scale(1.08);
}

/* Floating Greeting Bubble */
.setu-pet-speech-bubble {
  position: fixed;
  bottom: 42px;
  right: 106px;
  z-index: 99992;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f1f5f9;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(56, 189, 248, 0.15);
  pointer-events: auto;
  cursor: pointer;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.setu-pet-speech-bubble.visible {
  opacity: 1;
  transform: translateX(0);
}

.setu-pet-speech-bubble:hover {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.3);
}

.setu-pet-speech-bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -5px;
  width: 10px;
  height: 10px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(56, 189, 248, 0.35);
  border-right: 1px solid rgba(56, 189, 248, 0.35);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.setu-pet-bubble-close {
  cursor: pointer;
  color: #64748b;
  font-size: 0.85rem;
  margin-left: 2px;
  line-height: 1;
  padding: 2px;
  border-radius: 50%;
  transition: color 0.15s ease, transform 0.15s ease;
}
.setu-pet-bubble-close:hover {
  color: #f87171;
  transform: scale(1.2);
}

/* Floating Chat Request Modal */
.setu-pet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.setu-pet-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.setu-pet-modal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 460px;
  max-width: calc(100vw - 28px);
  height: 640px;
  max-height: calc(100vh - 48px);
  background: var(--pet-card-bg);
  border: 1px solid var(--pet-border);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.setu-pet-modal.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Modal Header */
.setu-pet-header {
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setu-pet-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.setu-pet-header-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.setu-pet-header-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setu-pet-header-sub {
  font-size: 0.7rem;
  color: var(--pet-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
  white-space: nowrap;
}

.setu-pet-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pet-success);
  box-shadow: 0 0 8px var(--pet-success);
  display: inline-block;
  flex-shrink: 0;
}

.setu-pet-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.setu-pet-nav-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pet-primary);
  text-decoration: none;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.setu-pet-nav-link:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
}


.setu-pet-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.setu-pet-close-btn:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--pet-danger);
  border-color: rgba(248, 113, 113, 0.3);
}

/* Modal Content Area */
.setu-pet-content {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Pet Bot Message Bubble */
.setu-pet-bot-bubble {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 14px 14px 4px;
  padding: 12px 14px;
  margin-bottom: 16px;
  color: #e2e8f0;
  font-size: 0.82rem;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.setu-pet-bot-bubble strong {
  color: #38bdf8;
}

/* Category Pills */
.setu-pet-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.setu-pet-cat-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
}

.setu-pet-cat-pill:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #e2e8f0;
}

.setu-pet-cat-pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--pet-primary);
  color: var(--pet-primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* Form Inputs */
.setu-pet-form-group {
  margin-bottom: 12px;
}

.setu-pet-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.setu-pet-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  color: #f8fafc;
  font-size: 0.82rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.setu-pet-input:focus {
  outline: none;
  border-color: var(--pet-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.setu-pet-textarea {
  width: 100%;
  min-height: 140px;
  max-height: 220px;
  resize: vertical;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f8fafc;
  font-size: 0.82rem;
  line-height: 1.5;
  font-family: inherit;
  transition: border-color 0.2s;
}

.setu-pet-textarea:focus {
  outline: none;
  border-color: var(--pet-primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.setu-pet-textarea.error {
  border-color: var(--pet-danger);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

/* Word Counter & Submission Bar */
.setu-pet-counter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  margin-bottom: 16px;
}

.setu-pet-word-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--pet-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.setu-pet-word-badge.warning {
  color: var(--pet-warning);
}

.setu-pet-word-badge.limit-reached {
  color: #fb923c;
  font-weight: 700;
}

.setu-pet-word-badge.exceeded {
  color: var(--pet-danger);
  font-weight: 700;
}

.setu-pet-submit-btn {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #0b1120;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  font-family: inherit;
}

.setu-pet-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
}

.setu-pet-submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

/* Confirmation View */
.setu-pet-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px;
  animation: fadeInConf 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInConf {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.setu-conf-celebrate-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: var(--pet-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 0 25px rgba(52, 211, 153, 0.25);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0.5); }
  100% { transform: scale(1); }
}

.setu-conf-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.setu-conf-sub {
  font-size: 0.82rem;
  color: var(--pet-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.setu-conf-card {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
}

.setu-conf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.setu-conf-row:last-child {
  margin-bottom: 0;
}

.setu-conf-lbl {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.setu-conf-req-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pet-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.setu-copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.2s;
}

.setu-copy-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
}

.setu-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.setu-status-badge.in-progress {
  background: rgba(251, 191, 36, 0.15);
  color: #fde047;
  border-color: rgba(251, 191, 36, 0.3);
}

.setu-status-badge.resolved {
  background: rgba(52, 211, 153, 0.15);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.3);
}

.setu-conf-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
}

.setu-btn-primary-block {
  width: 100%;
  background: var(--pet-primary);
  color: #0b1120;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.setu-btn-primary-block:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
}

.setu-btn-secondary-block {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.setu-btn-secondary-block:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .setu-pet-floating-btn {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
  .setu-pet-avatar-svg {
    width: 38px;
    height: 38px;
  }
  .setu-pet-speech-bubble {
    bottom: 74px;
    right: 16px;
    font-size: 0.72rem;
    padding: 6px 12px;
    transform: translateY(6px);
  }
  .setu-pet-speech-bubble.visible {
    transform: translateY(0);
  }
  .setu-pet-speech-bubble::after {
    top: auto;
    bottom: -5px;
    right: 20px;
    border-top: none;
    border-right: 1px solid rgba(56, 189, 248, 0.35);
    border-bottom: 1px solid rgba(56, 189, 248, 0.35);
    transform: rotate(45deg);
  }
  .setu-pet-modal {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 24px);
    border-radius: 16px;
  }
}

@media print {
  #setu-pet-root,
  .setu-pet-floating-btn,
  .setu-pet-speech-bubble,
  .setu-pet-modal-overlay,
  .setu-pet-modal {
    display: none !important;
  }
}

