/* ════════════════════════════════════════════════════════════════════
   TravelZona — Shorts CSS (TikTok-inspired layout)
   Separate from style.css — only loaded on /shorts page
   ════════════════════════════════════════════════════════════════════ */

/* ─── Remove main-content padding for full-screen experience ─── */
.main-content {
    padding: 0 !important;
    max-width: 100% !important;
}

/* ─── Shorts Feed Container ─── */
.shorts-feed {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport — fixes mobile Safari address bar */
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    background: #000;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.shorts-feed::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* ─── Individual Short Item (full-screen) ─── */
.short-item {
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ─── Video ─── */
.short-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* ─── Click layer for play/pause ─── */
.short-click-layer {
    position: absolute;
    top: 6.5rem; /* Below the top overlay (sound/location/report) */
    left: 0;
    right: 5rem;
    bottom: 0;
    z-index: 8;
    cursor: pointer;
}

/* ─── Play/Pause Indicator ─── */
.play-pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 5;
}
.play-pause-indicator.show {
    opacity: 1;
}

/* ─── Top Bar (sound + destination + report) ─── */
.short-overlay-top {
    position: absolute;
    top: 3.5rem; /* Below the fixed header (57px) + gap */
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0,0,0,0.5), transparent);
}
.short-overlay-top > * {
    pointer-events: auto;
}

/* Top buttons — 2.75rem (44px) meets mobile touch-target minimum */
.top-btn {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
    flex-shrink: 0;
}
.top-btn:hover {
    background: rgba(0,0,0,0.5);
    transform: scale(1.05);
}
.top-btn.report {
    background: rgba(239,68,68,0.3);
}
.top-btn.report:hover {
    background: rgba(239,68,68,0.5);
}

/* Destination tag — clickable pill (z-index 10 > click layer 8) */
.short-destination-link {
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.5rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}
.short-destination-link:hover {
    background: rgba(124,58,237,0.6);
    color: white;
}

/* ─── Right Action Bar (TikTok-style vertical stack) ─── */
/* bottom: 6rem clears the ~60px fixed bottom-nav with ~36px breathing room */
.short-actions {
    position: absolute;
    right: 0.5rem;
    bottom: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 10;
    align-items: center;
}

/* Action buttons */
.short-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: white;
}
.short-action-btn .circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.short-action-btn:hover .circle {
    background: rgba(255,255,255,0.2);
    transform: scale(1.08);
}
.short-action-btn.liked .circle {
    background: rgba(239,68,68,0.2);
}
.short-action-btn.liked .circle i {
    color: #ef4444;
}
.short-action-btn.saved .circle {
    background: rgba(245,158,11,0.2);
}
.short-action-btn.saved .circle i {
    color: #f59e0b;
}
.short-action-btn span {
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* Create Short + button (above like) */
/* margin-bottom adds extra separation between Create and Like (on top of .short-actions gap) */
.create-short-plus {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: white;
    text-decoration: none;
    margin-bottom: 0.5rem;
}
.create-short-plus .plus-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(124,58,237,0.5);
    transition: all 0.2s;
}
.create-short-plus:hover .plus-circle {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 16px rgba(124,58,237,0.6);
}
.create-short-plus .plus-circle i {
    font-size: 1.25rem;
    color: white;
}
.create-short-plus span {
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ─── Bottom Creator Info (TikTok-style) ─── */
/* z-index: 10 MUST be > .short-click-layer (z-index: 8) so the Explore
   destination button (and creator link) actually receive taps instead of
   being intercepted by the play/pause click layer.
   bottom: 6rem clears the ~60px fixed bottom-nav with ~36px breathing room.
   Gradient is tall + dark so caption stays readable over bright/light videos. */
.short-overlay-bottom {
    position: absolute;
    bottom: 6rem;
    left: 0;
    right: 5rem;
    padding: 1rem;
    padding-top: 2.5rem; /* taller gradient zone for readability */
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0,0,0,0.35) 35%,
        rgba(0,0,0,0.65) 65%,
        rgba(0,0,0,0.85) 100%);
    color: white;
    pointer-events: none;
    z-index: 10; /* sit ABOVE the click layer so links work */
}
.short-overlay-bottom a {
    pointer-events: auto;
    position: relative; /* ensure stacking context inside the overlay */
}

/* Creator row */
.short-creator-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.short-creator-row img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}
.short-avatar-fallback {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.short-creator-name {
    color: white;
    text-decoration: none;
}
.short-creator-name p {
    font-weight: 700;
    font-size: 0.9375rem;
    margin: 0;
}
.short-creator-name + p {
    font-size: 0.75rem;
    opacity: 0.8;
    margin: 0;
}

/* Caption — stronger text-shadow for readability over bright video frames */
.short-caption {
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0 0 0.625rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.7);
    word-break: break-word;
}

/* Explore destination button — verified clickable (z-index 10 > click layer 8).
   Padding bumped to meet 44px mobile touch target. */
.explore-destination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding: 0.5625rem 1rem;
    background: rgba(124,58,237,0.9);
    backdrop-filter: blur(8px);
    color: white;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 2.75rem;
}
.explore-destination-btn:hover {
    background: rgba(124,58,237,1);
    color: white;
    transform: scale(1.03);
}

/* ─── Empty State ─── */
.short-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    text-align: center;
    padding: 2rem;
    background: var(--background, #f4f4f5);
}

/* ─── Comments Panel ─── */
.comments-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 420px;
    margin: 0 auto;
    background: var(--card, #fff);
    border-radius: 1rem 1rem 0 0;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
}
.comments-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border, #e4e4e7);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}
.comment-item {
    display: flex;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
}
.comment-item img {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-item .comment-avatar-fallback {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
}
.comment-item .comment-body {
    flex: 1;
    min-width: 0;
}
.comment-item .comment-author {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0;
}
.comment-item .comment-text {
    font-size: 0.8125rem;
    margin: 0.125rem 0 0;
    color: var(--foreground, #18181b);
}
.comment-item .comment-time {
    font-size: 0.65rem;
    color: var(--muted-foreground, #71717a);
    margin: 0.125rem 0 0;
}
.comments-input-bar {
    padding: 0.75rem;
    border-top: 1px solid var(--border, #e4e4e7);
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.comments-input-bar input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border, #e4e4e7);
    border-radius: 9999px;
    background: var(--muted, #f4f4f5);
    color: var(--foreground, #18181b);
    font-size: 0.8125rem;
    outline: none;
    font-family: inherit;
}
.comments-input-bar input:focus {
    border-color: #7c3aed;
}
.comments-input-bar button {
    background: #7c3aed;
    color: white;
    border: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comments-input-bar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.comments-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
}
.comments-overlay.show {
    display: block;
}

/* ─── Mobile Adjustments (@media max-width: 767px) ─── */
@media (max-width: 767px) {
    /* Full screen on mobile — override everything */
    .main-content {
        padding: 0 !important;
        max-width: 100% !important;
    }
    .shorts-feed {
        max-width: 100% !important;
        height: 100dvh !important;
        height: 100vh !important; /* fallback */
    }
    .short-item {
        max-width: 100% !important;
        height: 100dvh !important;
        height: 100vh !important; /* fallback */
        border-radius: 0 !important;
    }
    /* Actions positioned above bottom nav with safe clearance (~112px) */
    .short-actions {
        bottom: 7rem !important;
        right: 0.5rem !important;
        gap: 1rem !important;
    }
    .short-overlay-bottom {
        bottom: 7rem !important;
        right: 4.5rem !important;
        padding-top: 2rem !important;
    }
    .short-overlay-top {
        top: 3.5rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    /* Action circles: 2.75rem = 44px (mobile touch minimum) */
    .short-action-btn .circle,
    .create-short-plus .plus-circle {
        width: 2.75rem !important;
        height: 2.75rem !important;
    }
    .short-action-btn .circle i {
        font-size: 1.1rem !important;
    }
    /* Creator avatar — comfortable on mobile */
    .short-creator-row img,
    .short-avatar-fallback {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }
    /* Create button separation from Like */
    .create-short-plus {
        display: flex !important;
        margin-bottom: 0.5rem !important;
    }
    /* Caption slightly smaller on mobile for fit */
    .short-caption {
        font-size: 0.8125rem !important;
    }
}

/* ─── Very small screens (320px – iPhone SE / older Android) ─── */
@media (max-width: 360px) {
    .short-overlay-top {
        padding: 0.375rem 0.5rem !important;
    }
    .top-btn {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 0.9rem !important;
    }
    .short-destination-link {
        font-size: 0.7rem !important;
        padding: 0.375rem 0.625rem !important;
        min-height: 2rem !important;
    }
    .short-actions {
        right: 0.375rem !important;
        gap: 0.875rem !important;
    }
    .short-action-btn .circle,
    .create-short-plus .plus-circle {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    .short-action-btn .circle i {
        font-size: 1rem !important;
    }
    .short-action-btn span,
    .create-short-plus span {
        font-size: 0.65rem !important;
    }
    .short-overlay-bottom {
        right: 3.75rem !important;
        padding: 0.75rem !important;
        padding-top: 1.75rem !important;
    }
    .short-caption {
        font-size: 0.75rem !important;
    }
    .explore-destination-btn {
        font-size: 0.65rem !important;
        padding: 0.5rem 0.875rem !important;
        min-height: 2.5rem !important;
    }
}

/* ─── Desktop: center the feed (like TikTok web) ─── */
@media (min-width: 768px) {
    .shorts-feed {
        max-width: 450px;
        margin: 0 auto;
        border-radius: 0;
    }
    .short-item {
        border-radius: 0;
    }
}

/* ─── S1.4: Short Comment Like Button ──────────────────────────── */
.short-comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--muted-foreground, #71717a);
    transition: color 0.15s, transform 0.15s;
    flex-shrink: 0;
    align-self: flex-start;
}
.short-comment-like-btn i {
    font-size: 0.875rem;
}
.short-comment-like-btn span {
    font-weight: 500;
}
.short-comment-like-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
}
.short-comment-like-btn:hover i {
    color: #ef4444;
}
.short-comment-like-btn.liked {
    color: #ef4444;
}
.short-comment-like-btn.liked i {
    color: #ef4444;
}
.short-comment-like-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Ensure comment items have proper layout for the like button */
.comments-list .comment-item {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
}
.comments-list .comment-body {
    flex: 1;
    min-width: 0;
}
