/* ==============================================================================
   SOUPAFLOW NEUBRUTALISM SCOTTY AI COCKPIT CSS
   Scoped to body.page-id-63
   ============================================================================== */

body.page-id-63,
body.page-template-default.page-id-63,
body.is-scotty-page {
  background-color: #0d0f17;
  color: #f1f5f9;
}

body.page-id-63 #theme-main {
  width: 100%;
  margin: 0;
  padding: 0;
  background-color: #0d0f17;
}

/* HERO */
.scotty-hero {
  background-color: var(--nb-cyan, #00e5ff);
  border-bottom: 4px solid #000000;
  box-shadow: 0 4px 0 var(--nb-cyan, #00e5ff);
  padding: 0 15px;
  overflow: hidden;
  width: 100%;
}

.scotty-hero-inner {
  max-width: var(--nb-max-width, 1080px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 60px;
}

.scotty-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-family: var(--nb-font-display, 'Space Grotesk', sans-serif);
  font-weight: 700;
  line-height: 1.1;
  color: #111;
  margin: 0;
  padding: 0.85rem 0;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.scotty-title-bubble-img {
  height: clamp(38px, 4vw, 50px);
  width: auto;
  display: inline-block;
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.7));
  animation: scottyBubbleFloat 3.5s ease-in-out infinite alternate;
}

@keyframes scottyBubbleFloat {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-4px) rotate(2.5deg); }
}

.scotty-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  padding: 0.35rem 0;
}

/* MAIN STAGE */
.scotty-main-stage {
  padding: 0 15px 3.5rem;
  scroll-margin-top: 105px;
  width: 100%;
}

.scotty-container {
  max-width: var(--nb-max-width, 1080px);
  margin: 0 auto;
  width: 100%;
}

/* WELCOME STARTER CHIPS INSIDE BUBBLE */
.welcome-starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0;
  border-top: none;
}

.starter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--nb-cyan, #00e5ff);
  border: 2px solid #000000;
  border-radius: var(--nb-radius, 4px);
  color: #000000 !important;
  font-family: var(--nb-font-display, 'Space Grotesk', sans-serif);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 2.5px 2.5px 0px #000000;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  white-space: nowrap;
}

.starter-pill:hover {
  background: #ffffff;
  color: #000000 !important;
  border-color: #000000;
  transform: translate(-1px, -1px);
  box-shadow: 3.5px 3.5px 0 #000;
}

/* CHAT COCKPIT */
.scotty-chat-box {
  position: relative;
  background-color: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.cockpit-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--nb-cyan, #00e5ff);
  border: 2px solid #000000;
  box-shadow: 2px 2px 0 #000000;
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #050505;
}

.cockpit-status-pill.thinking {
  background-color: var(--nb-yellow, #ffd23f);
  color: #050505;
}

.cockpit-status-pill.thinking .pulse-dot {
  background-color: #050505;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--nb-yellow, #ffd23f);
  border: 1px solid #000000;
  box-shadow: 0 0 4px rgba(255, 230, 0, 0.8);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* MESSAGE STREAM */
.chat-messages-stream {
  position: relative;
  scroll-behavior: smooth;
  padding: 1.25rem 0;
  min-height: 340px;
  max-height: 600px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background-color: transparent;
  border-radius: 0;
}

.message-bubble {
  border: 2.5px solid #000000;
  border-radius: var(--nb-radius, 4px);
  padding: 1.15rem 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  line-height: 1.6;
  font-size: 1rem;
}

.user-bubble {
  background-color: var(--nb-cyan, #00e5ff) !important;
  color: #050505 !important;
  box-shadow: 3.5px 3.5px 0 #000;
  padding: 0.75rem 1.15rem !important;
}

.user-bubble-inner {
  display: inline;
  line-height: 1.5;
}

.user-badge {
  display: inline;
  color: #111827 !important;
  font-weight: 800;
  font-size: 0.95rem;
  margin-right: 0.45rem;
  white-space: nowrap;
}

.user-text {
  color: #050505 !important;
  font-weight: 600 !important;
  font-size: 1rem;
  line-height: 1.5;
  display: inline;
  word-break: break-word;
}

.bot-bubble {
  background-color: #1f2536 !important;
  color: #ffffff !important;
  box-shadow: 4px 4px 0 #000;
  border-left: 6px solid var(--nb-cyan, #00e5ff) !important;
}

.bot-bubble .message-sender {
  color: var(--nb-cyan, #00e5ff) !important;
  font-weight: 800;
}

.bot-bubble .message-text {
  color: #f3f4f6 !important;
  font-size: 1rem;
  line-height: 1.65;
}

.bot-bubble .message-text p {
  color: #f3f4f6 !important;
  margin: 0 0 0.75rem;
}

.bot-bubble .message-text p:last-child {
  margin-bottom: 0;
}

.bot-bubble .message-text strong {
  color: var(--nb-cyan, #00e5ff) !important;
}

.bot-bubble .message-text a {
  color: #00e5ff !important;
  font-weight: 700;
  text-decoration: underline;
}

.bot-bubble .message-text ul,
.bot-bubble .message-text ol {
  color: #f3f4f6 !important;
  margin: 0.5rem 0 0.75rem 1.25rem;
  padding: 0;
}

.bot-bubble .message-text li {
  color: #f3f4f6 !important;
  margin-bottom: 0.35rem;
}

.message-sender {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scotty-chat-avatar {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: inline-block;
  filter: drop-shadow(0 0 7px rgba(0, 229, 255, 0.75));
  vertical-align: middle;
  flex-shrink: 0;
  animation: avatarFloat 2s ease-in-out infinite alternate;
}

@keyframes avatarFloat {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-2px) scale(1.15); }
}

.sender-avatar {
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.message-text {
  word-break: break-word;
}

.message-text code {
  background-color: rgba(0,0,0,0.4);
  color: #00e5ff;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}

/* LIVE BOT THINKING BUBBLE */
.bot-thinking-bubble {
  background-color: #1a202c !important;
  border-left: 6px solid var(--nb-cyan, #00e5ff) !important;
  animation: thinkingPulse 2s ease-in-out infinite;
}

@keyframes thinkingPulse {
  0%, 100% { border-left-color: var(--nb-cyan, #00e5ff); }
  50% { border-left-color: #8b5cf6; }
}

.pulse-avatar {
  display: inline-block;
  animation: avatarFloat 1.2s ease-in-out infinite alternate;
}

.bot-thinking-payload {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 0.5rem 0;
}

.quantum-loader {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 24px;
  flex-shrink: 0;
}

.quantum-bar {
  width: 4px;
  background: linear-gradient(180deg, #00e5ff, #8b5cf6);
  border-radius: 2px;
  animation: quantumJump 1s ease-in-out infinite alternate;
}

.quantum-bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.quantum-bar:nth-child(2) { height: 20px; animation-delay: 0.2s; }
.quantum-bar:nth-child(3) { height: 14px; animation-delay: 0.4s; }
.quantum-bar:nth-child(4) { height: 22px; animation-delay: 0.1s; }

@keyframes quantumJump {
  0% { height: 6px; opacity: 0.4; }
  100% { height: 24px; opacity: 1; }
}

.thinking-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.thinking-main-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

.thinking-sub-title {
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 500;
}

/* BUTTON SPINNER */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid #000000;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: btnSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.scotty-send-btn.is-loading {
  background-color: #ffd700 !important;
  opacity: 0.95 !important;
  cursor: wait !important;
}

/* INPUT FORM */
.scotty-input-form {
  position: sticky;
  bottom: 0;
  z-index: 25;
  background-color: #0d0f17;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0.75rem 0 0;
}

.scotty-input-wrap {
  display: flex;
  gap: 0.75rem;
}

.scotty-input {
  flex: 1;
  background-color: #fff;
  border: 2.5px solid var(--nb-cyan, #00e5ff);
  border-radius: var(--nb-radius, 4px);
  padding: 0.9rem 1.25rem;
  color: #000 !important;
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
  box-shadow: 4px 4px 0 #000000;
  transition: all 0.15s ease;
}

.scotty-input:focus {
  border-color: #70f0ff;
  background-color: #fff;
  box-shadow: 5px 5px 0 #000000;
}

.scotty-btn-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
}

.clear-chat-btn-new {
  background-color: #ffffff;
  color: #000000;
  border: 2.5px solid #000000;
  box-shadow: 3px 3px 0 #000000;
  border-radius: var(--nb-radius, 4px);
  width: 48px;
  min-width: 48px;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.clear-chat-btn-new:hover {
  background-color: #f1f5f9;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000000;
}

.scotty-send-btn {
  background-color: var(--nb-cyan, #00e5ff);
  color: #000000;
  border: 2.5px solid #000000;
  box-shadow: 4px 4px 0 #000000;
  border-radius: var(--nb-radius, 4px);
  padding: 0 1.75rem;
  font-size: 1.05rem;
  font-weight: 900;
  font-family: var(--nb-font-display, 'Space Grotesk', sans-serif);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.scotty-send-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000000;
  background-color: #ffffff;
}

.scotty-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.scotty-page-disclaimer {
  font-size: 0.78rem;
  color: #6b7280;
  text-align: center;
  margin-top: 0.85rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* SCOTTY SPACELOUNGE SHOWCASE */
.scotty-lounge-showcase {
  margin-top: 3.5rem;
}

.lounge-card {
  background-color: #161a26;
  border: 3px solid #000000;
  border-radius: var(--nb-radius, 4px);
  box-shadow: 6px 6px 0px #000000;
  overflow: hidden;
}

.lounge-img-wrap {
  position: relative;
  width: 100%;
  line-height: 0;
  border-bottom: 3px solid #000000;
  background-color: #0b0d14;
}

.lounge-img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.lounge-card:hover .lounge-img {
  transform: scale(1.015);
}

.lounge-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--nb-cyan, #00e5ff);
  color: #050505;
  font-family: var(--nb-font-display, 'Space Grotesk', sans-serif);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.85rem;
  border: 2px solid #000000;
  border-radius: var(--nb-radius, 4px);
  box-shadow: 2.5px 2.5px 0px #000000;
}

.lounge-caption {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lounge-title {
  font-size: 1.25rem;
  font-family: var(--nb-font-display, 'Space Grotesk', sans-serif);
  font-weight: 900;
  color: var(--nb-cyan, #00e5ff);
  margin: 0;
  letter-spacing: -0.01em;
}

.lounge-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .scotty-hero {
    padding: 0.35rem 15px;
  }
  .scotty-hero-inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    min-height: auto;
  }
  .scotty-title {
    font-size: clamp(1.8rem, 6.2vw, 2.35rem);
    gap: 0.55rem;
    padding: 0.4rem 0;
  }
  .scotty-title-bubble-img {
    height: 38px;
  }
  .scotty-hero-actions {
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
  }
  .cockpit-status-pill {
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .pulse-dot {
    width: 6px;
    height: 6px;
  }
  .scotty-main-stage {
    padding: 0 15px 2.5rem;
    scroll-margin-top: 90px;
  }
  .chat-messages-stream {
    padding: 0.65rem 0;
    min-height: 240px;
    max-height: 70vh;
    gap: 0.85rem;
  }
  .scotty-chat-box {
    box-shadow: none;
  }
  .scotty-input-form {
    padding: 0.65rem 0 0;
  }
  .scotty-input-wrap {
    flex-direction: column;
    gap: 0.5rem;
  }
  .scotty-btn-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }
  .clear-chat-btn-new {
    width: 48px;
    min-width: 48px;
    padding: 0;
    font-size: 1.5rem;
  }
  .scotty-send-btn {
    flex: 1;
    padding: 0.75rem;
    justify-content: center;
  }
  .message-bubble {
    max-width: 100%;
    padding: 0.85rem 0.95rem;
    font-size: 0.95rem;
    line-height: 1.55;
  }
}
