/* ==========================================================================
   Property Reels -- hand-written CSS (Tailwind isn't used on this project;
   Bootstrap utility classes don't cover the 9:16 reel/carousel/feed layouts
   below, so this mirrors the existing mrt-custom.css convention of a small
   dedicated stylesheet loaded only on the pages that need it).
   ========================================================================== */

/* ---------- Homepage AutoPlay Reels carousel ---------- */
.home-reels-section {
    padding: 50px 0;
}

.home-reels-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 6px 4px 14px;
    -webkit-overflow-scrolling: touch;
}

.home-reel-card {
    flex: 0 0 auto;
    width: 160px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
}

.home-reel-media {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.home-reel-media video,
.home-reel-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-reel-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    opacity: .95;
    pointer-events: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
    transition: opacity .2s ease;
}

.home-reel-card:hover .home-reel-play,
.home-reel-media.is-playing .home-reel-play {
    opacity: 0;
}

.home-reel-meta {
    padding: 8px 2px 0;
}

.home-reel-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #222;
}

.home-reel-price {
    font-size: 12px;
    color: #26ae61;
    font-weight: 700;
}

@media (max-width: 576px) {
    .home-reel-card {
        width: 130px;
    }
}

/* ---------- /reels grid page ---------- */
.reels-grid-section {
    padding: 40px 0 60px;
}

.reels-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 991px) {
    .reels-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.reels-grid-card {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    text-decoration: none;
}

.reels-grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reels-grid-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    background: rgba(0, 0, 0, .18);
}

.reels-grid-views {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reels-grid-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
    color: #fff;
}

.reels-grid-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reels-grid-price {
    font-size: 12px;
    color: #8be28b;
    font-weight: 700;
}

/* ---------- /reels/{slug} fullscreen feed ---------- */
.reels-feed-page {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: #000;
    z-index: 20000;
    overflow: hidden;
}

.reels-feed-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none;
}

.reels-feed-scroller {
    height: 100%;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
}

.reels-slide {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Everything for a slide -- video, overlays, action rail -- lives inside this
   centered, phone-width column so desktop browsers don't stretch it full width. */
.reels-media-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: 100%;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
}

.reels-video,
.reels-youtube,
.reels-youtube iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.reels-video::-webkit-media-controls,
.reels-video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none;
}

.reels-center-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.8);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
    z-index: 3;
}

.reels-center-icon.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.reels-action-rail {
    position: absolute;
    right: 10px;
    bottom: 132px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.reels-action-btn {
    background: none;
    border: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 22px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
    cursor: pointer;
    padding: 0;
}

.reels-action-count {
    font-size: 12px;
    font-weight: 600;
}

.reels-like-btn i {
    transition: transform .15s ease, color .15s ease;
}

.reels-like-btn.is-liked i {
    color: #ff3b5c;
}

.reels-like-btn.is-animating i {
    transform: scale(1.35);
}

.reels-bottom-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    padding: 16px 70px 22px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, .85), rgba(0, 0, 0, .35) 65%, transparent);
    color: #fff;
}

.reels-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 2px;
    color: #fff;
}

.reels-price {
    font-size: 14px;
    font-weight: 700;
    color: #8be28b;
    margin-bottom: 12px;
}

.reels-cta-row {
    display: flex;
    gap: 10px;
}

/* flex: 1 1 0 (not 1 1 auto) so the two buttons split the row exactly 50/50
   regardless of label length. */
.reels-btn {
    flex: 1 1 0;
    text-align: center;
    padding: 10px 6px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reels-btn-secondary {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}

.reels-btn-primary {
    background: #26ae61;
    color: #fff;
}

.reels-btn-primary:hover,
.reels-btn-secondary:hover {
    color: #fff;
    opacity: .92;
}

@media (max-width: 480px) {
    .reels-bottom-overlay {
        padding-right: 58px;
    }

    .reels-action-rail {
        right: 8px;
        bottom: 118px;
        gap: 16px;
    }
}

/* ---------- Floating video bubble (property details page) ---------- */
/* Left side on purpose -- the right side is already occupied by the
   LeadConnectorHQ chat widget's own video popup (loaded in app.blade.php),
   so the bubble would otherwise sit on top of it. */
.reel-video-bubble {
    position: fixed;
    left: 20px;
    bottom: 100px;
    z-index: 9500;
}

.reel-video-bubble-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
    background: #000;
    position: relative;
    padding: 0;
    cursor: pointer;
    display: block;
}

.reel-video-bubble-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.reel-video-bubble-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: rgba(0, 0, 0, .25);
}

.reel-video-bubble-panel {
    display: none;
    position: absolute;
    left: 0;
    bottom: 72px;
    width: 220px;
    max-width: 60vw;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    background: #000;
}

.reel-video-bubble-panel.is-open {
    display: block;
}

.reel-video-bubble-media {
    width: 100%;
    height: 100%;
}

.reel-video-bubble-media video,
.reel-video-bubble-youtube,
.reel-video-bubble-youtube iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}

.reel-video-bubble-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

@media (max-width: 576px) {
    .reel-video-bubble {
        left: 14px;
        bottom: 86px;
    }

    .reel-video-bubble-toggle {
        width: 52px;
        height: 52px;
    }

    .reel-video-bubble-panel {
        width: 180px;
    }
}
