/* ===========================================================================
 * Offer detail page — single-column v2 layout (mobile-first, same on desktop).
 * Replaces the old 3-column sidebar layout.
 * ========================================================================= */

.detail-v2-root {
    max-width: 599px;
    margin: 0 auto 30px;
    width: 100%;
    padding: 0;
    background: #fff;
    border-radius: 22px;
}

/* Position-only overrides — visual styling is inherited from .entry-header
   / .entry-title / .entry-header-nickname / .entry-header-date so the detail
   page matches the similar-offers cards by default. */
.detail-v2-identity-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.detail-v2-identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.detail-v2-identity-row > .detail-v2-action,
.detail-v2-identity-row > .detail-v2-napisz-btn {
    flex: 0 0 auto;
}

/* Keep nickname and location inline when there's room; let flex-wrap drop
   the location to a new line only when the row genuinely runs out of width.
   No hardcoded breakpoints — the layout responds to actual content fit. */
.detail-v2-identity .entry-header-nickname {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.detail-v2-identity .entry-header-date {
    margin: 0;
    min-width: 0;
}

.detail-v2-nickname-link,
.detail-v2-nickname-link:hover,
.detail-v2-nickname-link:focus,
.detail-v2-nickname-link:visited,
.detail-v2-nickname-link:active {
    color: inherit;
    text-decoration: none;
}

.detail-v2-nickname-link:hover {
    text-decoration: underline;
}

.detail-v2-napisz-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 18px;
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.detail-v2-napisz-btn:hover,
.detail-v2-napisz-btn:focus {
    background: #222;
    color: #fff;
    text-decoration: none;
}

/* Photo fills the card edge-to-edge. On mobile the card is viewport-wide so
   the photo is too; on desktop the card (and the photo) caps at 599px, same
   as similar-offers entries. Overflow lives here (not on .detail-v2-root)
   so the emoji picker popup further down can escape the card bounds. */
.detail-v2-photo-fullwidth {
    width: 100%;
    margin: 5px 0 18px;
    overflow: hidden;
}

.detail-v2-photo-fullwidth .post-image,
.detail-v2-photo-fullwidth .entry-list-item-image,
.detail-v2-photo-fullwidth .grid,
.detail-v2-photo-fullwidth .grid img,
.detail-v2-photo-fullwidth .entry-image {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
}

.detail-v2-description {
    padding: 0 16px 18px;
    font-size: 15px;
    line-height: 1.55;
    color: #222;
    overflow-wrap: break-word;
}

.detail-v2-description p {
    margin-bottom: 0;
}

/* ---- Refund notice --------------------------------------------------- */
.detail-v2-refund-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 16px 12px;
    padding: 10px 12px;
    background: #f6f3ff;
    border: 1px solid #e0d7ff;
    border-radius: 6px;
    font-size: 13px;
    color: #34207d;
    line-height: 1.4;
}

.detail-v2-refund-notice i {
    color: #34207d;
    margin-top: 2px;
}

/* ---- Composer -------------------------------------------------------- */

.entry-detail-main::after {
    display: none !important;
}

.detail-v2-composer {
    margin: 0 16px 20px;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    /* Leave headroom so the Write-button's scrollIntoView doesn't tuck the
       composer under the sticky navbar. */
    scroll-margin-top: 90px;
}

/* The tall rounded card that holds the textarea + attachment icons. */
.detail-v2-input-card {
    background: #fff;
    border: 1px solid #e4e1eb;
    border-radius: 14px;
    padding: 10px 12px 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.detail-v2-textarea-wrapper {
    position: relative;
}

textarea.detail-v2-textarea {
    display: block;
    width: 100%;
    min-height: 84px;
    resize: none;
    border: none;
    outline: none;
    padding: 6px 40px 6px 4px;
    font-size: 15px;
    line-height: 1.4;
    background: transparent;
    color: #222;
}

textarea.detail-v2-textarea::placeholder {
    color: #9a95a6;
}

textarea.detail-v2-textarea.blocked {
    background: #f6f4fa;
    cursor: not-allowed;
}

/* Emoji picker lives inside the wrapper; position it top-right of the textarea. */
.detail-v2-textarea-wrapper .emoji-picker-icon {
    top: 6px;
    right: 6px;
}

/* The picker popup's inline style sets `bottom: 55px; right: 0;` for the
   legacy chat layout. On the detail composer the textarea is taller and
   the picker should drop down from the icon, not float far above it. */
.detail-v2-textarea-wrapper .emoji-picker {
    top: -55px!important;
    right: 0 !important;
    bottom: auto !important;
    left: auto !important;
    position: absolute !important;
}

.detail-v2-attach-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #efeaf3;
}

.detail-v2-attach-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-v2-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    color: #8d88a0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s ease, color 0.15s ease;
}

.detail-v2-attach-btn:hover {
    background: #f3eff7;
    color: #34207d;
}

.detail-v2-attach-btn.stop-recording,
.detail-v2-attach-btn.stop-recording:hover {
    background: #ffe4e8;
    color: #e04a5f;
}

.detail-v2-attach-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.detail-v2-recording-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: #fff5f6;
    border: 1px solid #ffd0d6;
    border-radius: 8px;
}

.detail-v2-recording-bar.is-active {
    display: flex;
}

.detail-v2-recording-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #e04a5f;
    white-space: nowrap;
}

.detail-v2-recording-label .fa-circle {
    font-size: 9px;
    animation: detail-v2-recording-pulse 1.1s infinite ease-in-out;
}

@keyframes detail-v2-recording-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.detail-v2-voice-visualizer {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1 1 auto;
    min-height: 28px;
}

.detail-v2-voice-visualizer div {
    width: 4px;
    height: 22px;
    background: #e04a5f;
    border-radius: 2px;
    transform: scaleY(0.25);
    transform-origin: center;
    opacity: 0.5;
    transition: transform 0.05s linear, opacity 0.05s linear;
}

.audio-input {
    display: none;
    margin-bottom: 8px;
}

.audio-input .audio-recorded {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    position: relative;
    max-width: 100%;
}

.audio-input .audio-recorded audio-player {
    flex: 0 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 320px;
}

.audio-input .audio-recorded .remove-audio-file {
    cursor: pointer;
    color: #8d88a0;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 1px solid #d8d4e2;
    border-radius: 50%;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.15s ease, color 0.15s ease;
}

.audio-input .audio-recorded .remove-audio-file:hover {
    background: #f3eff7;
    color: #34207d;
}

/* The spec chat-message-submit stays in the DOM so base.js's click handler
   fires — but it's not part of the visual layout on this page. */
.detail-v2-hidden-submit {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
}

/* ---- Action row (2×2 grid: Get media / Send / Date / Tip) ------------ */
.detail-v2-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.detail-v2-action,
.detail-v2-action:hover,
.detail-v2-action:focus,
.detail-v2-action:visited,
.detail-v2-action:active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 28px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fde4e8;
    color: #e04a5f;
    text-decoration: none;
    transition: filter 0.15s ease;
    min-height: 44px;
}

.detail-v2-action:hover {
    filter: brightness(0.96);
    text-decoration: none;
}

.detail-v2-action i {
    font-size: 15px;
}

.detail-v2-action-primary,
.detail-v2-action-primary:hover,
.detail-v2-action-primary:focus,
.detail-v2-action-primary:visited,
.detail-v2-action-primary:active {
    background: #3ec16b;
    color: #fff;
}

.detail-v2-action-primary:hover {
    background: #36ae5f;
    color: #fff;
    filter: none;
}

/* ---- Composer CTAs (anonymous / limit / blocked) --------------------- */
.detail-v2-composer-cta {
    margin: 0 16px 20px;
    padding: 18px;
    background: #f7f6fb;
    border: 1px dashed #d5cfe4;
    border-radius: 8px;
    text-align: center;
    color: #444;
}

.detail-v2-composer-cta p {
    margin-bottom: 12px;
    font-size: 14px;
}

.detail-v2-napisz-btn-cta {
    min-width: 140px;
}

/* ---- Photo / video preview overrides --------------------------------- */
.detail-v2-input-card .approved-files {
    margin: 0;
    width: 100%;
}

.detail-v2-input-card .approved-files:has(.preview-div) {
    margin-bottom: 4px;
}

.detail-v2-input-card .preview-div {
    margin: 0 8px 0 0;
    width: 96px;
    height: 96px;
}

.detail-v2-input-card .preview-element {
    position: relative;
    height: 96px;
    width: 96px;
    margin: 0;
}

.detail-v2-input-card .preview-element .file-input-preview-image {
    border-radius: 10px;
}

.detail-v2-input-card .remove-file:not(.remove-audio-file) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #444;
    border: 1px solid #d8d4e2;
    border-radius: 50%;
    font-size: 11px;
    z-index: 5;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.detail-v2-input-card .remove-file:not(.remove-audio-file):hover {
    background: #f6f3ff;
}

.detail-v2-input-card .image-preview-checkboxes {
    display: none !important;
}

/* ---- Detail composer video preview --------------------------------- */
.detail-v2-video-preview {
    position: relative;
    display: inline-block;
    margin-bottom: 8px;
    width: 120px;
    height: 120px;
}

.detail-v2-video-thumb {
    position: relative;
    display: block;
    width: 120px;
    height: 120px;
    margin: 0;
    padding: 0;
    border: none;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.detail-v2-video-thumb-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.detail-v2-video-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.detail-v2-video-thumb:hover .detail-v2-video-thumb-play {
    background: rgba(0, 0, 0, 0.78);
    transform: translate(-50%, -50%) scale(1.05);
}

.detail-v2-video-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, 0.94);
    color: #333;
    border: 1px solid #d8d4e2;
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: background 0.15s ease;
}

.detail-v2-video-remove:hover {
    background: #fff;
}

.detail-v2-video-thumb-media:fullscreen,
.detail-v2-video-thumb-media:-webkit-full-screen {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}


/* ---- Success toast (injected by offer_detail_chat.js) ---------------- */
.detail-v2-toast {
    position: relative;
    margin: 12px 0 20px !important;
    padding: 12px 40px 12px 14px !important;
    border-radius: 6px;
    font-size: 14px;
}

.detail-v2-toast-close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.detail-v2-toast-close:hover {
    opacity: 1;
}

/* Keep the textarea visually unchanged while the send-spinner is on
   (base.js's disableSendButton sets `disabled` on the textarea AND adds
   .blocked to its wrapper, and a global `.blocked` rule paints it gray). */
textarea.detail-v2-textarea:disabled,
textarea.detail-v2-textarea[disabled] {
    background: transparent !important;
    color: #222 !important;
    cursor: default !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #222;
}

.detail-v2-input-card .detail-v2-textarea-wrapper.blocked {
    background: transparent !important;
    border-color: transparent !important;
}

/* ---- Similar offers section ----------------------------------------- */
.detail-v2-similar {
    max-width: 599px;
    margin: 0 auto;
    padding: 0;
}

.similar-offers-divider {
    display: flex;
    align-items: center;
    margin: 0 15px 28px;
    gap: 16px;
}

.similar-offers-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d8d4e2, transparent);
}

.similar-offers-divider-icon {
    color: rgb(52, 32, 125);
    font-size: 16px;
    opacity: 0.5;
    line-height: 1;
}

/* ---- Legacy shared classes still used by similar-offers cards -------- */
.tags-padding {
    padding: 0 16px 16px;
    margin: 0 !important;
}

.entry-description {
    padding: 0 15px;
    overflow-wrap: break-word;
}

.entry-description p {
    margin-bottom: 0;
}

.entry {
    margin-bottom: 30px !important;
}

.offer-buttons-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.offer-date {
    min-width: fit-content;
    min-width: -moz-fit-content;
    padding-right: 10px;
}

.entry .offer-detail-button {
    margin: 11px 15px;
}
