/* AI mode (AI_MODE=true) pages: resources/views/dating/ai/*.
   Only additions on top of the design version's own profile-card, profile and
   chat styles; every rule is scoped under .ai-dating. */

/* ---- home grid ---------------------------------------------------------- */
/* the design makes #content-container > div exactly one screen high inside an
   overflow:hidden #root-wrapper, so the page must scroll itself */
.ai-dating.ai-home { padding: 0 16px 24px; box-sizing: border-box; overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* the regular top bar spans the whole width, like on the regular home: it
   undoes the page's side padding */
.ai-dating.ai-home > .ai-navigation { margin: 0 -16px 20px; }
.ai-home__head { display: flex; align-items: center; gap: 12px; padding: 16px 0; }
.ai-home__head h1 { margin: 0; font-size: 20px; font-weight: 600; }

.ai-dating .ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}
.ai-dating .ai-card { position: relative; width: auto !important; margin: 0 !important; cursor: pointer; }
.ai-dating .ai-card .profile-card__data { position: relative; overflow: hidden; }
.ai-dating .ai-card__video {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.ai-dating .ai-card.is-playing .ai-card__video { opacity: 1; }
.ai-dating .ai-card .profile-card__status,
.ai-dating .ai-card .profile-card__details { z-index: 1; }
.ai-dating .ai-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; opacity: .75; list-style: none; }
.ai-dating .ai-empty .btn { display: inline-block; margin-top: 12px; }

@media (max-width: 600px) {
    .ai-dating .ai-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ---- profile ------------------------------------------------------------ */
/* the design centres .profile-image with position:absolute + left:50%: keep
   that, it is already the positioned box the video fills */
.ai-dating .profile-image { overflow: hidden; }
.ai-profile__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ai-profile__facts { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 16px; }
.ai-profile__facts span { display: block; font-size: 12px; opacity: .6; text-transform: uppercase; letter-spacing: .03em; }
.ai-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px; padding: 8px 16px 24px;
}
.ai-gallery__item { aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; cursor: pointer; background: #0001; }
.ai-gallery__item img, .ai-gallery__item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-gallery__item { position: relative; }
.ai-gallery__play {
    position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
    border-radius: 50%; background: rgba(0, 0, 0, .45); pointer-events: none;
}
.ai-gallery__play::after {
    content: ''; position: absolute; left: 17px; top: 13px;
    border-style: solid; border-width: 9px 0 9px 14px; border-color: transparent transparent transparent #fff;
}

/* gallery viewer */
.ai-viewer { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, .9); display: flex; align-items: center; justify-content: center; }
.ai-viewer[hidden] { display: none; }
.ai-viewer__stage { max-width: 92vw; max-height: 88vh; display: flex; align-items: center; justify-content: center; }
.ai-viewer__stage img, .ai-viewer__stage video { max-width: 92vw; max-height: 88vh; border-radius: 8px; display: block; }
.ai-viewer__close, .ai-viewer__nav { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; line-height: 1; opacity: .85; }
.ai-viewer__close { top: 14px; right: 20px; font-size: 40px; }
.ai-viewer__nav { top: 50%; margin-top: -30px; font-size: 60px; padding: 0 14px; }
.ai-viewer__nav--prev { left: 6px; }
.ai-viewer__nav--next { right: 6px; }
.ai-viewer__close:hover, .ai-viewer__nav:hover { opacity: 1; }

/* ---- messages + chat ---------------------------------------------------- */
.ai-messages .messages__wrapp { display: block; }
.ai-messages .ai-messages__title { font-weight: 600; margin-left: 12px; }
.ai-messages .ai-chat { display: grid; }
.ai-messages .ai-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ai-chat .bubble__msg em { opacity: .75; }
.ai-chat .ai-chat__hello { text-align: center; opacity: .6; padding: 24px 16px; }
.ai-chat .ai-chat__attachment { display: block; max-width: 240px; width: 100%; border-radius: 10px; margin-top: 6px; }
.ai-chat .ai-chat__error { font-size: 12px; color: #d9480f; margin-top: 4px; cursor: pointer; }
.ai-chat .ai-chat__cost { font-size: 11px; opacity: .55; text-align: center; padding: 0 0 6px; }
.ai-chat .chat__footer--controls__send-msg.disabled { opacity: .4; pointer-events: none; }

.ai-chat .bubble.ai-chat__typing {
    display: inline-flex !important; align-items: center; gap: 5px;
    min-width: 58px; min-height: 36px; padding: 12px 14px !important;
}
.ai-chat .ai-chat__typing span {
    display: block !important; flex: 0 0 auto;
    width: 8px !important; height: 8px !important; border-radius: 50%; background: #888 !important; opacity: .35;
    animation: ai-typing 1.2s infinite ease-in-out;
}
.ai-chat .ai-chat__typing span:nth-child(2) { animation-delay: .15s; }
.ai-chat .ai-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-typing { 0%, 80%, 100% { opacity: .2; transform: translateY(0); } 40% { opacity: .8; transform: translateY(-3px); } }

/* support thread in the AI inbox */
.ai-messages .ai-support { cursor: pointer; align-items: flex-start; }
.ai-messages .ai-support__body { margin-top: 8px; white-space: normal; }
.ai-messages .ai-support__msg { font-size: 13px; line-height: 1.45; padding: 8px 0; border-top: 1px solid rgba(0, 0, 0, .06); }
.ai-messages .ai-support__msg:first-child { border-top: 0; padding-top: 0; }

/* gifts: her own gifts in the regular gift modal; the user's gift bubble */
.ai-chat .chat__footer--controls__send-gif.disabled { opacity: .4; pointer-events: none; }
.ai-chat .ai-gift__name { display: block; font-size: 12px; text-align: center; margin: 4px 0; }
.ai-chat .ai-gift--given .gifts__gift--title { opacity: .7; }
.ai-chat .ai-gift--given .gifts__gift--img { filter: grayscale(1); opacity: .6; }
.ai-chat .ai-chat__gift { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px 8px; }
.ai-chat .ai-chat__gift img { width: 72px; height: 72px; object-fit: contain; }
.ai-chat .ai-chat__gift span { font-size: 13px; }
[x-cloak] { display: none !important; }

/* AI home search (the regular top bar's box) */
@media screen and (max-width: 740px) {
    .ai-navigation .ai-search { position: absolute; right: 10px; top: 0; bottom: 0; display: flex; align-items: center; }
    .ai-navigation.ai-search-active .ai-search { transform: translateX(0); }
    .ai-navigation.ai-search-active .app-navigation-icons,
    .ai-navigation.ai-search-active .ai-search-open { display: none; }
}

/* gallery items locked for non-VIP: blurred like the regular gallery, with its upgrade button */
.ai-gallery__item--locked { cursor: default; display: flex; align-items: center; justify-content: center; }
.ai-gallery__item--locked img,
.ai-gallery__item--locked video { -webkit-filter: blur(12px); filter: blur(12px); pointer-events: none; }
.ai-gallery__item--locked .ai-gallery__upgrade { position: absolute; z-index: 1; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }

/* AI profile videos always play muted (English voice): no volume / mute button */
video.ai-video--muted::-webkit-media-controls-mute-button,
video.ai-video--muted::-webkit-media-controls-volume-slider,
video.ai-video--muted::-webkit-media-controls-volume-control-container {
    display: none !important;
}

/* ---- AI mode, unregistered visitor (GuestSession): register modal, nav buttons,
   free messages counter. Plain on purpose: the design styles it later. ---- */
.ai-guest-modal[hidden] { display: none !important; }
.ai-guest-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ai-guest-modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); }
.ai-guest-modal__box { position: relative; width: 100%; max-width: 380px; background: #fff; color: #222; border-radius: 12px; padding: 28px 24px 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); text-align: center; }
.ai-guest-modal__close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #888; }
.ai-guest-modal__title { margin: 0 0 8px; font-size: 20px; }
.ai-guest-modal__text { margin: 0 0 16px; font-size: 14px; color: #555; }
.ai-guest-modal__form input { display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px; padding: 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 15px; }
.ai-guest-modal__error { margin: 0 0 10px; color: #e10202; font-size: 13px; }
.ai-guest-modal__submit { display: flex; align-items: center; justify-content: center; width: 100%; padding: 12px; border-radius: 8px; text-align: center; line-height: 1.2; height: auto; }
.ai-guest-modal__submit[disabled] { opacity: .6; }
.ai-guest-modal__login { margin: 14px 0 0; font-size: 14px; }
body.ai-guest-modal-open { overflow: hidden; }
/* the bar's links are full-height blocks for its icons (app_navigation_main.css):
   the guest's two buttons are centred pills instead */
.app-navigation-icons li.ai-guest-nav { display: flex; gap: 8px; align-items: center; height: 100%; }
.app-navigation-icons li.ai-guest-nav a.btn { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 34px; margin: 0; padding: 0 16px; box-sizing: border-box; border-radius: 17px; font-size: 14px; line-height: 1; text-align: center; white-space: nowrap; vertical-align: middle; }
.app-navigation-icons li.ai-guest-nav a.ai-guest-nav__login { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); }
.ai-gallery__item--locked, .video-box.novip .video-box-overly { cursor: pointer; }

/* home grid: "your creation" badge on the profiles the user made ("Create profile", ai/create) */
.ai-dating .ai-card__own {
    position: absolute; top: 40px; left: 10px; z-index: 3; padding: 4px 10px; border-radius: 999px;
    background: var(--ai-pink, #f53b70); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none;
}
.ai-guest-modal__photo { display: block; width: 120px; height: 160px; object-fit: cover; margin: 0 auto 14px; border-radius: 12px; border: 2px solid var(--ai-pink, #f53b70); }
.ai-guest-modal__photo[hidden] { display: none; }
