/* src/index.css */
/* RTL: never apply to html/body - only to inner components */
/* This prevents browser from moving scrollbar to left side in Arabic */
html, body {
  direction: ltr !important;
  unicode-bidi: embed;
}

html {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  display: none;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}
/* src/App.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Global viewport tokens.
   --app-vh / --kb-inset are kept in sync with window.visualViewport by
   src/utils/viewportFix.js so iOS Safari's collapsing toolbars and the
   on-screen keyboard never hide the composer. The fallbacks below keep
   the layout correct before the first JS tick and on browsers without
   visualViewport. */
:root {
  --app-vh: 100dvh;
  --kb-inset: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --mobile-nav-h: 60px;
}

html {
  overflow: hidden !important;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #1a0b2e;
  scrollbar-width: none;
  -ms-overflow-style: none;
  direction: ltr !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#root::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
}

html, body, #root {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  overflow: hidden !important;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #1a0b2e;
}

/* Prevent horizontal scroll on all screen sizes */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

@media (max-width: 375px) {
  html {
    font-size: 14px;
  }
}

@media (max-width: 320px) {
  html {
    font-size: 13px;
  }
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #1a0b2e;
  min-height: 100%;
  overflow: hidden !important;
  color: #fff;
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  height: var(--app-vh);
  margin: 0;
  padding: 0;
  position: relative;
  direction: ltr !important;
}

/* Safari specific fixes */
@supports (-webkit-appearance: none) {
  input, textarea, button:not(.pricing-cta-btn):not(.cta-main-btn) {
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }
  
  input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
  }
  
  .message-bubble {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }
  
  .message.user .message-bubble {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
  }
  
  .message.assistant .message-bubble {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
  }
  
  .pricing-card {
    background: rgba(30, 20, 50, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }
  
  .pricing-card.featured {
    background: rgba(80, 70, 140, 0.75) !important;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
    overflow-x: hidden;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 13px;
  }
}

.App {
  min-height: 100dvh;
  min-height: var(--app-vh);
  height: 100%;
  position: relative;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden !important;
  overscroll-behavior-x: none;
  width: 100%;
  background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 50%, #1a0b2e 100%);
}

.app-content {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  width: 100%;
  position: fixed;
  top: 42px;
  left: 0 !important;
  right: 0 !important;
  bottom: 0;
  background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 50%, #1a0b2e 100%);
  z-index: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.app-content::-webkit-scrollbar {
  display: none;
}

/* Full page routes - natural scroll, no fixed positioning */
.app-content-full {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  min-height: var(--app-vh, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 50%, #1a0b2e 100%);
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  direction: ltr;
}

.app-content-full::-webkit-scrollbar {
  display: none;
}

/* RTL inner wrapper - applied per-component, not on body */
[dir="rtl"] {
  direction: rtl;
}

/* Full page routes - natural scroll, no fixed positioning */
.app-content-full {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  min-height: var(--app-vh, 100dvh);
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(135deg, #1a0b2e 0%, #2d1b4e 50%, #1a0b2e 100%);
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
}

.app-content-full::-webkit-scrollbar {
  display: none;
}

/* Mobile app-shell offsets live in src/styles/mobile.css so the fixed
   header height and the visual-viewport insets are computed in one place. */

@media (max-width: 768px) {
  .App {
    padding: 0;
  }
}

.App::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* Disable animation on iOS devices to prevent white flashing */
@media (hover: hover) and (pointer: fine) {
  .App::before {
    animation: backgroundShift 20s ease-in-out infinite;
  }
}

@keyframes backgroundShift {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  33% {
    transform: translateX(-20px) translateY(20px);
  }
  66% {
    transform: translateX(20px) translateY(-20px);
  }
}
/* src/styles/mobile.css
   ---------------------------------------------------------------
   Single source of truth for mobile / PWA layout behaviour.

   Loaded from App.js. Component stylesheets ship inside lazy-loaded
   chunks whose <style> tags are appended to <head> at runtime, so they
   would otherwise win at equal specificity — the overrides below are
   therefore intentionally marked !important. Everything here is scoped
   to a media query or a touch/standalone condition so desktop is
   untouched.

   Depends on the custom properties declared in App.css and kept in sync
   by src/utils/viewportFix.js:
     --app-vh, --kb-inset, --safe-top, --safe-bottom, --mobile-nav-h
   --------------------------------------------------------------- */

/* ===============================================================
   1. Never scroll sideways. Anything wider than the screen is a bug.
   =============================================================== */
html,
body,
#root,
.App {
  max-width: 100%;
  overflow-x: hidden;
}

/* 100vw ignores the scrollbar and overflows on desktop; on mobile it is
   simply never what these full-bleed elements want. */
@media (max-width: 900px) {
  .sidebar-overlay,
  .model-modal,
  .modal-overlay,
  .mobile-menu,
  .mobile-nav {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ===============================================================
   2. App shell: one fixed header, one scrolling body.
   =============================================================== */
@media (max-width: 768px) {
  /* The header is fixed and already pads itself for the notch, so the
     content pane starts below it — offset once, via `top`, never with a
     second padding-top. */
  .app-content {
    position: fixed !important;
    top: calc(var(--mobile-nav-h) + var(--safe-top)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: var(--kb-inset) !important;
    padding-top: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .app-content-full {
    min-height: var(--app-vh);
    padding-top: calc(var(--mobile-nav-h) + var(--safe-top));
    padding-bottom: var(--safe-bottom);
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .layout-container,
  .layout-content {
    height: 100% !important;
    max-height: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Keep the shell offset in step with the header heights Navigation.css
   declares at these breakpoints, otherwise the content pane starts a few
   pixels too low and leaves a seam under the header. */
@media (max-width: 375px) {
  :root {
    --mobile-nav-h: 55px;
  }
}

@media (max-width: 320px) {
  :root {
    --mobile-nav-h: 50px;
  }
}

/* Landscape phones: the header eats too much of a 400px-tall viewport. */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  :root {
    --mobile-nav-h: 48px;
  }

  .mobile-nav-header {
    height: 48px !important;
    padding: 6px 12px !important;
  }
}

/* ===============================================================
   3. Header — clear of the notch / Dynamic Island, nothing clipped.
   =============================================================== */
@media (max-width: 768px) {
  .mobile-nav {
    padding-top: var(--safe-top) !important;
    padding-left: var(--safe-left) !important;
    padding-right: var(--safe-right) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .mobile-nav-header {
    height: var(--mobile-nav-h);
    min-width: 0;
    gap: 8px;
  }

  /* Long product names must truncate rather than shove the menu button
     off the right edge. */
  .mobile-nav-header .brand,
  .mobile-nav-header .brand-link {
    min-width: 0;
    overflow: hidden;
  }

  .mobile-nav-header .brand span,
  .mobile-nav-header .brand-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-toggle {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* The drawer hangs off the fixed header, which is already offset by the
     safe area — so it starts below both. */
  .mobile-menu-overlay {
    top: calc(var(--mobile-nav-h) + var(--safe-top)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
  }

  .mobile-menu {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(var(--app-vh) - var(--mobile-nav-h) - var(--safe-top)) !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--safe-bottom);
  }

  .mobile-menu-items {
    padding: 16px 16px calc(16px + var(--safe-bottom)) !important;
  }

  .mobile-menu-item {
    min-height: 48px;
  }
}

/* ===============================================================
   4. Chat: full-height flex column, composer always reachable.
   =============================================================== */
.ai-chat-layout {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0;
}

@media (max-width: 768px) {
  /* Sits above the keyboard and above Safari's collapsing toolbar. */
  .bottom-navigation {
    bottom: var(--kb-inset) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 45vh !important;
    padding-bottom: calc(var(--safe-bottom) + 6px) !important;
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
  }

  /* When the keyboard is up the home-indicator inset no longer applies —
     the keyboard itself occupies that space. */
  :root[data-keyboard='open'] .bottom-navigation {
    padding-bottom: 6px !important;
  }

  .bottom-navigation.sidebar-open {
    left: 0 !important;
  }

  .input-area {
    padding: 8px 10px 8px !important;
    width: 100%;
    max-width: 100%;
  }

  .input-row {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
  }

  /* Keep the composer usable on a 320px-wide screen: the text field
     absorbs the shrinking, the controls keep their tap targets. */
  .input-row .message-input {
    min-width: 0;
    flex: 1 1 auto;
  }

  .input-row .attachment-btn,
  .input-row .send-btn,
  .input-row .skills-gear-btn {
    flex-shrink: 0;
  }

  .skills-checkbox-wrap {
    flex-shrink: 0;
  }

  .model-selector-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .model-selector-section > * {
    max-width: 100%;
  }
}

/* Very narrow phones (iPhone SE, 320–360px): drop the "Skills" wordmark,
   the icon and the gear still carry the meaning. */
@media (max-width: 360px) {
  .skills-checkbox-label {
    display: none;
  }

  .input-row {
    gap: 4px !important;
    padding: 6px 8px !important;
  }
}

/* The message list is padded by the composer's *measured* height (see the
   ResizeObserver in AIChat.js) instead of the stack of hardcoded 120px /
   180px / 220px guesses in ChatContainer.css, which either hid the last
   message behind the composer or left a large dead gap. */
@media (max-width: 768px) {
  .messages-area {
    padding-top: 12px !important;
    /* The composer floats at `bottom: var(--kb-inset)`, so the space the
       conversation must leave free is the keyboard/toolbar inset PLUS the
       composer itself. Without the inset the newest message (and the model's
       reply) end up underneath the keyboard the moment it opens. */
    padding-bottom: calc(190px + 0px + 20px) !important;
    padding-bottom: calc(var(--composer-h, 190px) + var(--kb-inset, 0px) + 20px) !important;
    scroll-padding-bottom: calc(190px + 0px + 20px);
    scroll-padding-bottom: calc(var(--composer-h, 190px) + var(--kb-inset, 0px) + 20px);
  }

  /* Keyboard up: the visible slice of the chat is small, so reclaim the
     decorative top padding and keep the composer compact — the user is
     writing, not browsing history. */
  :root[data-keyboard='open'] .messages-area {
    padding-top: 8px !important;
  }

  :root[data-keyboard='open'] .bottom-navigation {
    max-height: 60vh !important;
  }
}

/* ===============================================================
   5. Chat history drawer.
   =============================================================== */
@media (max-width: 768px) {
  .chat-sidebar {
    height: var(--app-vh) !important;
    max-height: var(--app-vh) !important;
    width: min(85%, 320px) !important;
    max-width: min(85%, 320px) !important;
    left: calc(-1 * min(85%, 320px)) !important;
    padding-top: calc(var(--mobile-nav-h) + var(--safe-top) + 12px) !important;
    padding-bottom: var(--safe-bottom) !important;
    overscroll-behavior: contain;
  }

  .chat-sidebar.open {
    left: 0 !important;
  }

  .sidebar-overlay {
    height: var(--app-vh) !important;
  }

  /* The pull tab must not sit under the composer or the home indicator. */
  .history-toggle-btn {
    top: 45% !important;
    min-height: 56px;
  }
}

/* ===============================================================
   6. Modals & sheets — bottom-sheet behaviour on phones.
   =============================================================== */
@media (max-width: 768px) {
  .model-modal-overlay,
  .modal-overlay,
  .pricing-modal-overlay,
  .feedback-popup-overlay,
  .cost-confirmation-overlay,
  .chat-sharing-overlay,
  .bank-transfer-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .model-modal,
  .modal-content,
  .pricing-modal,
  .feedback-popup,
  .cost-confirmation-modal,
  .chat-sharing-modal,
  .bank-transfer-modal {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    max-height: calc(var(--app-vh) - var(--safe-top) - 8px) !important;
    border-radius: 18px 18px 0 0 !important;
    padding-bottom: var(--safe-bottom) !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Scrollable body inside a sheet, header/footer pinned. */
  .models-grid,
  .pricing-modal-body,
  .modal-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* ===============================================================
   7. Content pages — profile, referrals, notifications, skills, install.
   =============================================================== */
@media (max-width: 768px) {
  .profile-page,
  .referral-dashboard,
  .notifications-page,
  .skills-manager,
  .install-page,
  .login-page {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    padding-left: max(14px, var(--safe-left)) !important;
    padding-right: max(14px, var(--safe-right)) !important;
    padding-bottom: calc(28px + var(--safe-bottom)) !important;
    overflow-x: hidden;
  }

  /* Multi-column card grids collapse to a single column rather than
     overflowing. */
  .profile-grid,
  .referral-stats,
  .stats-grid,
  .cards-grid,
  .skills-grid,
  .plans-grid {
    grid-template-columns: 1fr !important;
    display: grid !important;
    grid-gap: 12px !important;
    gap: 12px !important;
  }

  /* Wide tables scroll inside their own box, never the page. */
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Long unbroken strings (referral links, model ids, API keys). */
  .referral-link,
  .model-id,
  .copy-field,
  code,
  pre {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  pre {
    overflow-x: auto;
  }
}

/* ===============================================================
   8. Chat message bubbles: text wraps, code scrolls.
   =============================================================== */
@media (max-width: 768px) {
  .message,
  .message-bubble,
  .message-content {
    max-width: 100% !important;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .message-content pre,
  .message-content table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .message-content img,
  .message-content video {
    max-width: 100%;
    height: auto;
  }
}

/* ===============================================================
   9. Touch ergonomics.
   =============================================================== */
/* iOS zooms the whole page when a focused field renders under 16px, and
   that zoom never resets — which is what leaves the header clipped and
   the composer half off-screen afterwards. Keyed on width (not just
   pointer type) so it applies on every phone regardless of how the
   browser reports its pointer. */
@media (max-width: 820px) {
  input:not([type='checkbox']):not([type='radio']):not([type='range']),
  textarea,
  select {
    font-size: max(16px, 1rem) !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  /* Hover transforms stick on touch and leave elements visibly offset. */
  a:hover,
  button:hover,
  .nav-item:hover,
  .mobile-menu-item:hover,
  .footer-social-link:hover,
  .layout-btn:hover {
    transform: none !important;
  }

  /* Apple's 44pt minimum for anything tappable. */
  button,
  .nav-item,
  .mobile-menu-item,
  [role='button'] {
    min-height: 44px;
  }

  /* …except icon-only controls that already size themselves and dense
     inline chips, which would otherwise blow up the layout. */
  .skills-gear-btn,
  .skills-checkbox-ui,
  .remove-attachment,
  .filter-chip,
  .close-btn {
    min-height: 0;
  }
}

/* ===============================================================
   10. Installed PWA (standalone) specifics.
   =============================================================== */
@media (display-mode: standalone) {
  /* No browser chrome to absorb overscroll — stop the rubber band from
     revealing the page background behind the app. */
  body {
    overscroll-behavior: none;
  }

  /* The status bar is transparent in standalone mode
     (apple-mobile-web-app-status-bar-style: black-translucent), so every
     top-anchored surface has to pad for it itself. */
  .mobile-nav,
  .desktop-nav {
    padding-top: var(--safe-top) !important;
  }
}

/* src/components/LoadingScreen.css */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-logo {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.loading-screen h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 10px 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-screen p {
  font-size: 14px;
  opacity: 0.7;
  margin: 0;
}

/*# sourceMappingURL=main.3ad9b734.css.map*/