/* ============================================================
   RUNOUT FILMS — Ask Runout AI Page Styles
   Dedicated, high-performance responsive layout for the AI Chatbot
   Brutalist aesthetics: square corners, sleek dark glassmorphism,
   flawless mobile scaling and touch ergonomics.
   ============================================================ */

.ask-hero {
  padding-top: calc(var(--nav-height, 90px) + var(--space-8, 2rem));
  padding-bottom: var(--space-4, 1rem);
}

.ask-hero__headline {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text-primary, #F5F3EE);
  line-height: 1.1;
  margin-bottom: var(--space-3, 0.75rem);
}

.ask-hero__sub {
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  color: var(--color-text-secondary, #8a8a8a);
  max-width: 680px;
  line-height: 1.6;
}

.ask-main-section {
  padding-bottom: var(--space-16, 4rem);
}

/* Layout Grid */
.ask-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-10, 2.5rem);
  align-items: start;
  min-width: 0;
}

/* ============================================================
   CHAT WINDOW COMPONENT (Desktop & Default)
   ============================================================ */
.ask-window {
  background: rgba(18, 18, 18, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  height: 640px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 32px rgba(255, 222, 5, 0.03);
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* Window Header */
.ask-window__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: rgba(22, 22, 22, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  gap: 12px;
}

.ask-window__status-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ask-window__pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FFDE05;
  box-shadow: 0 0 10px #FFDE05;
  animation: pulseDot 2s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.ask-window__title {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text-primary, #F5F3EE);
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
}

.ask-window__reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--color-text-secondary, #8a8a8a);
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.74rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.ask-window__reset-btn:hover {
  color: #F5F3EE;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.reset-btn-short {
  display: none;
}

/* Messages Canvas */
.ask-window__messages {
  flex: 1 1 0px;
  min-height: 0;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
  width: 100%;
  box-sizing: border-box;
}

.ask-window__messages::-webkit-scrollbar {
  width: 5px;
}
.ask-window__messages::-webkit-scrollbar-track {
  background: transparent;
}
.ask-window__messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0;
}
.ask-window__messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 222, 5, 0.3);
}

/* Chat Message Bubbles */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: askMsgFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  word-break: break-word;
}

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

.chat-msg--bot {
  align-self: flex-start;
}

.chat-msg--bot .chat-msg__bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  color: var(--color-text-primary, #F5F3EE);
  padding: 14px 18px;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  word-break: break-word;
}

.chat-msg--bot .chat-msg__bubble p {
  margin: 0 0 10px 0;
}
.chat-msg--bot .chat-msg__bubble p:last-child {
  margin-bottom: 0;
}

.chat-msg--user {
  align-self: flex-end;
}

.chat-msg--user .chat-msg__bubble {
  background: rgba(255, 222, 5, 0.12);
  border: 1px solid rgba(255, 222, 5, 0.35);
  border-radius: 0;
  color: #FFFFFF;
  padding: 12px 18px;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

/* Prompt Chips Inside Bot Intro */
.chatbot-chips-wrap {
  margin-top: 14px;
}

.chatbot-chips__label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #8a8a8a;
  margin-bottom: 8px;
}

.chatbot-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.chatbot-chip {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  padding: 10px 14px;
  color: #d0cfcb;
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1.35;
}

.chatbot-chip:hover {
  background: rgba(255, 222, 5, 0.08);
  border-color: rgba(255, 222, 5, 0.5);
  color: #FFDE05;
}

/* Confirmation Summary Card */
.chat-confirm-card {
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(255, 222, 5, 0.45);
  border-radius: 0;
  padding: 16px 18px;
  margin: 10px 0 6px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(255, 222, 5, 0.08);
  word-break: break-word;
}

.chat-confirm-card__header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFDE05;
  font-weight: 700;
  margin-bottom: 12px;
}

.chat-confirm-card__row {
  font-size: 0.86rem;
  line-height: 1.55;
  margin-bottom: 6px;
  color: #e5e5e5;
  word-break: break-word;
}

.chat-confirm-card__row strong {
  color: #FFDE05;
  font-weight: 600;
  display: inline-block;
  min-width: 75px;
}

.chat-confirm-card__msg {
  font-style: italic;
  color: #c0c0c0;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-confirm-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.chat-confirm-card__btn {
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body, 'Montserrat', sans-serif);
}

.chat-confirm-card__btn--send {
  background: #FFDE05;
  color: #0a0a0a;
  border: 1px solid #FFDE05;
}

.chat-confirm-card__btn--send:hover {
  background: #FFE84D;
  box-shadow: 0 0 14px rgba(255, 222, 5, 0.4);
}

.chat-confirm-card__btn--cancel {
  background: transparent;
  color: var(--color-text-secondary, #8a8a8a);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.chat-confirm-card__btn--cancel:hover {
  color: #F5F3EE;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Typing Indicator (3 Pulsing Dots) */
.chat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  margin-top: 4px;
}

.chat-typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FFDE05;
  opacity: 0.4;
  animation: typingPulse 1.4s infinite ease-in-out;
}

.chat-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing__dot:nth-child(3) { animation-delay: 0.4s; }

/* Input Bar */
.ask-window__input-area {
  padding: 16px 20px;
  background: rgba(14, 14, 14, 0.98);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 100%;
}

.ask-window__input {
  flex: 1 1 auto;
  min-width: 0; /* CRITICAL: prevents flex item expanding beyond container */
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding: 12px 20px;
  color: var(--color-text-primary, #F5F3EE);
  font-family: var(--font-body, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s ease;
}

.ask-window__input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.ask-window__input:focus {
  border-color: rgba(255, 222, 5, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 14px rgba(255, 222, 5, 0.12);
}

.ask-window__send-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 0;
  background: #FFDE05;
  border: none;
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.ask-window__send-btn:hover {
  background: #FFE84D;
}

.ask-window__send-btn:active {
  background: #e6c800;
}

.ask-window__send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ask-window__send-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

/* ============================================================
   SIDEBAR (Context, Guidelines & Fast Contact)
   ============================================================ */
.ask-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-8, 2rem);
  min-width: 0;
}

.ask-sidebar__card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0;
  padding: 22px;
  box-sizing: border-box;
  min-width: 0;
}

.ask-sidebar__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFDE05;
  font-weight: 700;
  margin-bottom: 12px;
  display: block;
}

.ask-sidebar__text {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--color-text-secondary, #8a8a8a);
  margin-bottom: 16px;
}

.ask-sidebar__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ask-sidebar__list li {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #c0c0c0;
  padding-left: 14px;
  position: relative;
}

.ask-sidebar__list li::before {
  content: '•';
  color: #FFDE05;
  position: absolute;
  left: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.ask-sidebar__contact-item {
  margin-top: 14px;
  min-width: 0;
}

.ask-sidebar__contact-val {
  font-size: 0.95rem;
  color: var(--color-text-primary, #F5F3EE);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
  word-break: break-all;
}

.ask-sidebar__contact-val:hover {
  color: #FFDE05;
}

.ask-sidebar__btn {
  display: inline-flex !important;
  width: 100% !important;
  max-width: 100% !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 12px 18px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  border-radius: 0 !important;
  white-space: normal !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #F5F3EE !important;
}

.ask-sidebar__btn:hover {
  border-color: #FFDE05 !important;
  color: #FFDE05 !important;
}

/* ============================================================
   RESPONSIVE (Tablet & Mobile: <= 1024px)
   Enforces single-column vertical stack: Chat on top, Direct Inquiries on bottom
   ============================================================ */
@media (max-width: 1024px) {
  .ask-hero {
    padding-top: calc(var(--nav-height, 90px) + 1.25rem);
    padding-bottom: 0.75rem;
  }

  .ask-hero__headline {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
  }

  .ask-hero__sub {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .ask-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: var(--space-6, 1.5rem) !important;
  }

  .ask-window {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .ask-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 1.5rem !important;
    gap: 1.25rem !important;
  }

  .ask-sidebar__card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================
   RESPONSIVE (Mobile Phones & Small Devices: <= 768px)
   Flawless scaling, zero horizontal overflow, thumb-friendly tap targets
   ============================================================ */
@media (max-width: 768px) {
  /* Prevent horizontal layout blowouts */
  body[data-page="ask"] {
    overflow-x: hidden;
  }

  body[data-page="ask"] .container {
    padding-left: 14px;
    padding-right: 14px;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Compact Hero Header: Safe spacing below fixed navbar on mobile */
  .ask-hero {
    padding-top: calc(var(--nav-height, 90px) + 1rem);
    padding-bottom: 0.6rem;
  }

  .ask-hero__headline {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 0.25rem;
  }

  .ask-hero__sub {
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--color-text-secondary, #8a8a8a);
  }

  .ask-main-section {
    padding-bottom: var(--space-8, 2rem);
  }

  /* Single-column, stacked layout: Chat on top, Direct Inquiries at bottom */
  .ask-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 1.25rem !important;
  }

  /* Chat Window on Mobile: Dynamically grows with the conversation so
     main page scrolling is uninterrupted and never trapped by an inner scroller */
  .ask-window {
    height: auto !important;
    min-height: 240px;
    max-height: none !important;
    overflow: visible !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(16, 16, 16, 0.96);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Window Header */
  .ask-window__header {
    padding: 10px 14px;
    background: rgba(22, 22, 22, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .ask-window__status-wrap {
    gap: 8px;
  }

  .ask-window__pulse-dot {
    width: 7px;
    height: 7px;
  }

  .ask-window__title {
    font-size: 0.86rem;
  }

  .ask-window__reset-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.16);
  }

  /* Toggle full vs short reset button label */
  .reset-btn-full {
    display: none;
  }
  .reset-btn-short {
    display: inline;
  }

  /* Messages Canvas: Expands naturally with conversation, zero inner scroll lock */
  .ask-window__messages {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    overscroll-behavior: auto !important;
    touch-action: auto !important;
    flex: none !important;
    padding: 14px 12px;
    gap: 12px;
  }

  /* Message Bubbles */
  .chat-msg {
    max-width: 92%;
  }

  .chat-msg--bot .chat-msg__bubble {
    padding: 11px 13px;
    font-size: 0.86rem;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
  }

  .chat-msg--bot .chat-msg__bubble p {
    margin-bottom: 6px;
  }

  .chat-msg--user .chat-msg__bubble {
    padding: 10px 13px;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  /* Remove suggested prompt queries on mobile per user request */
  .chatbot-chips-wrap,
  .chatbot-chips,
  .chatbot-chips__label,
  .chatbot-chip {
    display: none !important;
  }

  /* Confirmation Card */
  .chat-confirm-card {
    padding: 12px 14px;
    margin: 8px 0 4px;
    border: 1px solid rgba(255, 222, 5, 0.5);
  }

  .chat-confirm-card__header {
    font-size: 0.72rem;
    margin-bottom: 8px;
  }

  .chat-confirm-card__row {
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 4px;
  }

  .chat-confirm-card__row strong {
    min-width: 62px;
    font-size: 0.78rem;
  }

  .chat-confirm-card__msg {
    font-size: 0.82rem;
    margin-top: 8px;
    padding-top: 8px;
  }

  .chat-confirm-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }

  .chat-confirm-card__btn {
    flex: 1;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    font-size: 0.78rem;
    font-weight: 700;
  }

  /* Typing Indicator */
  .chat-typing {
    padding: 8px 14px;
    gap: 5px;
  }

  .chat-typing__dot {
    width: 6px;
    height: 6px;
  }

  /* Input Bar */
  .ask-window__input-area {
    padding: 10px 12px;
    gap: 8px;
    background: #0e0e0e;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .ask-window__input {
    min-width: 0 !important;
    width: 100% !important;
    padding: 10px 14px;
    font-size: 16px !important; /* 16px font-size prevents unwanted iOS Safari viewport auto-zoom */
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-sizing: border-box !important;
  }

  .ask-window__input::placeholder {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.4);
  }

  .ask-window__send-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
  }

  .ask-window__send-btn svg {
    width: 17px;
    height: 17px;
  }

  /* Sidebar Cards - Positioned cleanly below the chat on mobile */
  .ask-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 1.5rem !important;
    gap: 1rem !important;
  }

  .ask-sidebar__card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px 14px;
  }

  .ask-sidebar__label {
    font-size: 0.72rem;
    margin-bottom: 8px;
  }

  .ask-sidebar__text {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 12px;
  }

  .ask-sidebar__contact-item {
    margin-top: 10px;
  }

  .ask-sidebar__contact-val {
    font-size: 0.88rem;
  }

  .ask-sidebar__list {
    gap: 8px;
  }

  .ask-sidebar__list li {
    font-size: 0.78rem;
    line-height: 1.35;
    padding-left: 12px;
  }
}

/* ============================================================
   RESPONSIVE (Compact Mobile: <= 380px)
   ============================================================ */
@media (max-width: 380px) {
  body[data-page="ask"] .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .ask-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .ask-window {
    height: auto !important;
    min-height: 200px;
    max-height: none !important;
    width: 100% !important;
  }

  .ask-window__header {
    padding: 9px 10px;
  }

  .ask-window__messages {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
    flex: none !important;
    padding: 12px 8px;
  }

  .chat-msg--bot .chat-msg__bubble,
  .chat-msg--user .chat-msg__bubble {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .ask-window__input-area {
    padding: 8px 10px;
    gap: 6px;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .ask-window__input {
    padding: 8px 10px;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .ask-window__input::placeholder {
    font-size: 0.8rem;
  }

  .ask-window__send-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }

  .ask-window__send-btn svg {
    width: 15px;
    height: 15px;
  }

  .ask-sidebar {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }

  .ask-sidebar__card {
    width: 100% !important;
  }
}