/**
 * Phoenix AI & Hızlı Destek Hub Stilleri
 * Phoenix Sunucum Resmi Renk & Tasarım Paleti
 * Sol Orta Belirgin, Modern ve Şık Açılır-Kapanır 3'lü Kare Hub
 * İkon: phoenix-vds.png
 */

:root {
  --pai-brand: #ff6b35;
  --pai-brand-accent: #f7931e;
  --pai-brand-glow: rgba(255, 107, 53, 0.45);
  --pai-brand-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  --pai-bg-panel: #121215;
  --pai-bg-card: #18191f;
  --pai-bg-hover: #22232b;
  --pai-border: rgba(255, 255, 255, 0.08);
  --pai-border-brand: rgba(255, 107, 53, 0.4);
  --pai-text-primary: #ffffff;
  --pai-text-secondary: #cbd5e1;
  --pai-text-muted: #8892b0;
  --pai-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 107, 53, 0.22);
  --pai-radius: 18px;
  --pai-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hide legacy bottom-left floating wizard button to eliminate clutter */
.ps-floating-wizard {
  display: none !important;
}

/* ==========================================================================
   1. SOL ORTA SABİT BLOK DOCK (LEFT-MIDDLE SOLID BLOCK DOCK)
   ========================================================================== */
.phoenix-left-hub {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99998;
  display: flex;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

/* Solid Dock Container Attached to Left Border */
.plh-dock {
  background: rgba(16, 17, 23, 0.96);
  backdrop-filter: blur(18px) saturate(190%);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  border: 1.5px solid var(--pai-border-brand);
  border-left: none;
  border-radius: 0 16px 16px 0;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 25px rgba(255, 107, 53, 0.22);
  transition: var(--pai-transition);
}

.plh-dock:hover {
  border-color: rgba(255, 107, 53, 0.65);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 32px rgba(255, 107, 53, 0.32);
}

/* The 3 Action Items Group */
.plh-items-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plh-item {
  position: relative;
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* Modern Square Buttons (52px x 56px with icon + label) */
.plh-square-btn {
  width: 54px;
  height: 56px;
  border-radius: 13px;
  background: linear-gradient(145deg, #20222a 0%, #14151b 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 5px 2px 4px 2px;
  color: #ffffff;
  outline: none;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.plh-square-btn:hover {
  transform: scale(1.08) translateX(3px);
  border-color: var(--pai-brand);
  background: linear-gradient(145deg, #2a2c36 0%, #191b22 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 22px var(--pai-brand-glow);
}

.plh-square-btn:active {
  transform: scale(0.96);
}

/* Active State (e.g. when Phoenix AI panel is open) */
.plh-square-btn.active {
  border-color: #ff9166;
  background: linear-gradient(145deg, #38251e 0%, #1c1411 100%);
  box-shadow: 0 0 26px rgba(255, 107, 53, 0.65);
}

/* Phoenix AI Breathing Glow */
.plh-square-btn.ai-pulse {
  animation: plhAiBreathing 2.8s infinite ease-in-out;
}

@keyframes plhAiBreathing {
  0%, 100% {
    border-color: rgba(255, 107, 53, 0.4);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(255, 107, 53, 0.25);
  }
  50% {
    border-color: var(--pai-brand);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 22px rgba(255, 107, 53, 0.55);
  }
}

/* Mascot Icon (phoenix-vds.png) */
.plh-icon-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(255, 107, 53, 0.5));
  transition: transform 0.22s ease;
}

.plh-square-btn:hover .plh-icon-img {
  transform: scale(1.14);
}

/* SVG Icons for Wizard & Support */
.plh-square-btn svg {
  width: 24px;
  height: 24px;
  color: #ff8555;
  transition: transform 0.22s ease, color 0.22s ease;
}

.plh-square-btn:hover svg {
  transform: scale(1.14);
  color: #ff9d76;
}

.plh-square-btn.support svg {
  color: #ffffff;
}

.plh-square-btn.support:hover svg {
  color: #34d399;
}

/* Crisp Text Label Under Icon */
.plh-btn-label {
  font-size: 9px;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

.plh-square-btn:hover .plh-btn-label {
  color: #ffffff;
}

/* Micro Status Dots */
.plh-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #14151b;
}

.plh-dot.green {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: plhDotPulse 2s infinite ease-in-out;
}

.plh-dot.orange {
  background-color: var(--pai-brand);
  box-shadow: 0 0 8px var(--pai-brand);
}

@keyframes plhDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==========================================================================
   2. SHARP & MODERN FLYOUT TOOLTIPS
   ========================================================================== */
.plh-tooltip {
  position: absolute;
  left: calc(100% + 14px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(16, 17, 23, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--pai-border-brand);
  border-radius: 12px;
  padding: 8px 14px;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 22px rgba(255, 107, 53, 0.15);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plh-tooltip::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(16, 17, 23, 0.96);
  border-left: 1.5px solid var(--pai-border-brand);
  border-bottom: 1.5px solid var(--pai-border-brand);
}

.plh-item:hover .plh-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

.plh-tooltip-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.plh-tooltip-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.plh-tooltip-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--pai-brand-gradient);
  color: #ffffff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.plh-tooltip-badge.green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.plh-tooltip-desc {
  font-size: 11px;
  color: var(--pai-text-muted);
}

/* ==========================================================================
   3. CHAT PANEL (ANCHORED NEXT TO LEFT DOCK)
   ========================================================================== */
.phoenix-ai-panel {
  position: fixed;
  left: 84px;
  bottom: 24px;
  width: 410px;
  height: 610px;
  max-height: calc(100vh - 70px);
  background: var(--pai-bg-panel);
  border: 1.5px solid var(--pai-border-brand);
  border-radius: var(--pai-radius);
  box-shadow: var(--pai-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-16px) scale(0.97);
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.phoenix-ai-panel.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

/* Header */
.pai-header {
  background: linear-gradient(180deg, #191a22 0%, #121215 100%);
  border-bottom: 1px solid var(--pai-border);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.pai-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--pai-brand), transparent);
  opacity: 0.6;
}

.pai-header-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.pai-header-logo-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  background: #1c1d25;
  border: 1.5px solid var(--pai-border-brand);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.pai-header-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.pai-header-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #10b981;
  border: 2px solid var(--pai-bg-panel);
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.pai-header-title-box {
  display: flex;
  flex-direction: column;
}

.pai-header-title {
  color: var(--pai-text-primary);
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pai-badge-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--pai-brand-gradient);
  color: #ffffff;
  text-transform: uppercase;
}

.pai-header-subtitle {
  color: var(--pai-text-secondary);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.pai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pai-btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--pai-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pai-btn-icon:hover {
  background: var(--pai-bg-hover);
  color: #ffffff;
  border-color: var(--pai-border);
}

/* Chat Body (Messages Area) */
.pai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  scroll-behavior: smooth;
}

.pai-body::-webkit-scrollbar {
  width: 5px;
}
.pai-body::-webkit-scrollbar-track {
  background: transparent;
}
.pai-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.pai-body::-webkit-scrollbar-thumb:hover {
  background: var(--pai-brand);
}

/* Welcome Card */
.pai-welcome-card {
  background: linear-gradient(145deg, #181920 0%, #131418 100%);
  border: 1.5px solid var(--pai-border-brand);
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.pai-welcome-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pai-welcome-badge {
  background: rgba(255, 107, 53, 0.14);
  color: var(--pai-brand);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.pai-welcome-text {
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.pai-welcome-text strong {
  color: #ffffff;
}

/* Quick Question Chips */
.pai-chips-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--pai-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pai-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pai-chip {
  background: #1c1d25;
  border: 1px solid var(--pai-border);
  color: #e4e4e7;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.pai-chip:hover {
  background: var(--pai-brand-gradient);
  border-color: transparent;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.35);
}

/* Message Rows */
.pai-message-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  animation: phoenixAIMsgFade 0.22s ease-out;
}

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

.pai-message-row.user { justify-content: flex-end; }
.pai-message-row.bot { justify-content: flex-start; }

.pai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #191920;
  border: 1px solid var(--pai-border-brand);
}

.pai-avatar img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.pai-bubble-wrap {
  max-width: 82%;
  display: flex;
  flex-direction: column;
}

.pai-message-row.user .pai-bubble-wrap { align-items: flex-end; }

/* User Bubble */
.pai-message-row.user .pai-bubble {
  background: var(--pai-brand-gradient);
  color: #ffffff;
  padding: 9px 14px;
  border-radius: 15px 15px 3px 15px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.28);
  word-break: break-word;
}

/* Bot Bubble */
.pai-message-row.bot .pai-bubble {
  background: var(--pai-bg-card);
  color: #f1f2f6;
  padding: 12px 15px;
  border-radius: 15px 15px 15px 3px;
  border: 1px solid var(--pai-border);
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  word-break: break-word;
}

.pai-bubble strong { color: #ffffff; font-weight: 700; }
.pai-bubble ul, .pai-bubble ol { margin: 6px 0; padding-left: 16px; }
.pai-bubble li { margin-bottom: 3px; }
.pai-bubble p { margin: 0 0 6px 0; }
.pai-bubble p:last-child { margin-bottom: 0; }

.pai-bubble a {
  color: var(--pai-brand);
  text-decoration: underline;
  font-weight: 600;
}
.pai-bubble a:hover { color: var(--pai-brand-accent); }

.pai-bubble code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11.5px;
  color: #ff9d76;
}

.pai-msg-category {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--pai-brand);
  background: rgba(255, 107, 53, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Action Buttons attached to Bot Answers */
.pai-actions-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.pai-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  background: #22232a;
  border: 1px solid var(--pai-border-brand);
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.pai-action-btn:hover {
  background: var(--pai-brand);
  border-color: var(--pai-brand);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 107, 53, 0.35);
}

.pai-action-btn.live-chat {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
}

.pai-action-btn.live-chat:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

/* Feedback Row */
.pai-feedback-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 10.5px;
  color: var(--pai-text-muted);
}

.pai-feedback-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: var(--pai-text-secondary);
  font-size: 11px;
  padding: 2px 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.2s;
}

.pai-feedback-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.pai-feedback-btn.active {
  background: rgba(255, 107, 53, 0.18);
  border-color: var(--pai-brand);
  color: var(--pai-brand);
}

.pai-time {
  font-size: 10px;
  color: var(--pai-text-muted);
  margin-top: 3px;
  padding: 0 3px;
}

/* Typing Indicator */
.pai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--pai-bg-card);
  border: 1px solid var(--pai-border);
  border-radius: 14px 14px 14px 3px;
  width: fit-content;
}

.pai-typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--pai-brand);
  border-radius: 50%;
  animation: phoenixAITyping 1.4s infinite ease-in-out both;
}

.pai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.pai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes phoenixAITyping {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Footer / Input */
.pai-footer {
  background: #141418;
  border-top: 1px solid var(--pai-border);
  padding: 10px 13px 8px 13px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pai-input-wrap {
  display: flex;
  align-items: center;
  background: #1a1a20;
  border: 1px solid var(--pai-border);
  border-radius: 10px;
  padding: 2px 4px 2px 12px;
  transition: all 0.2s;
}

.pai-input-wrap:focus-within {
  border-color: var(--pai-brand);
  box-shadow: 0 0 10px var(--pai-brand-glow);
  background: #1f1f26;
}

.pai-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  padding: 7px 0;
}

.pai-input::placeholder {
  color: #64748b;
  font-size: 12.5px;
}

.pai-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--pai-brand-gradient);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 3px 8px rgba(255, 107, 53, 0.4);
}

.pai-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.55);
}

.pai-footer-note {
  font-size: 10px;
  color: var(--pai-text-muted);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.pai-footer-note a {
  color: var(--pai-brand);
  text-decoration: none;
  font-weight: 600;
}
.pai-footer-note a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   4. MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .phoenix-left-hub {
    top: auto;
    bottom: 18px;
    transform: none;
    left: 0;
  }

  .plh-dock {
    padding: 6px;
    border-radius: 0 14px 14px 0;
    gap: 6px;
  }

  .plh-square-btn {
    width: 46px;
    height: 48px;
    border-radius: 11px;
  }

  .plh-icon-img {
    width: 26px;
    height: 26px;
  }

  .plh-square-btn svg {
    width: 20px;
    height: 20px;
  }

  .plh-btn-label {
    font-size: 8px;
  }

  .plh-tooltip {
    display: none !important;
  }

  .phoenix-ai-panel {
    left: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .pai-bubble-wrap {
    max-width: 88%;
  }
}
