/* ============================================
   GoneViral Animated Post Component
   Reusable across builder + shareable pages
   ============================================ */

/* === Container === */
.gv-post {
    --gv-post-width: 420px;
    width: var(--gv-post-width);
    max-width: 100%;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #262626;
    box-shadow: 0 4px 32px rgba(0,0,0,0.35);
    position: relative;
    transform: translateZ(0); /* GPU layer */
}

/* === Header === */
.gv-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
}

.gv-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    background: #E91E63;
    overflow: hidden;
}

.gv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gv-user-info {
    flex: 1;
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.gv-username {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Verified Badge === */
.gv-verified {
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gv-verified.visible {
    opacity: 1;
    transform: scale(1);
}

.gv-more {
    padding: 4px;
    flex-shrink: 0;
}

/* === Image === */
.gv-image-container {
    width: 100%;
    aspect-ratio: 1;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

.gv-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.gv-image-container img.visible {
    display: block;
}

.gv-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

/* === Trending Badge === */
.gv-trending {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #FF6B00 0%, #FF2D55 100%);
    color: white;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    z-index: 2;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease;
}

.gv-trending.visible {
    transform: translateY(0);
    opacity: 1;
}

.gv-trending svg {
    animation: gvTrendPulse 2s ease-in-out infinite;
}

@keyframes gvTrendPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* === Featured Badge === */
.gv-featured {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
    color: white;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    z-index: 2;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease;
}

.gv-featured.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Offset trending/featured from each other if both visible */
.gv-featured.visible ~ .gv-trending,
.gv-trending.visible ~ .gv-featured {
    top: 31px;
}

/* === @mention / #hashtag spans === */
.gv-mention {
    font-weight: 500;
}

/* === Dark Theme (Instagram dark mode) === */
.gv-post.gv-theme-dark {
    background: #121212;
    color: #f5f5f5;
}
.gv-post.gv-theme-dark .gv-header {
    border-bottom: none;
}
.gv-post.gv-theme-dark .gv-username {
    color: #f5f5f5;
}
.gv-post.gv-theme-dark .gv-more path,
.gv-post.gv-theme-dark .gv-more circle {
    fill: #f5f5f5;
}
.gv-post.gv-theme-dark .gv-actions-left svg,
.gv-post.gv-theme-dark .gv-actions-right svg {
    stroke: #f5f5f5;
}
.gv-post.gv-theme-dark .gv-counter,
.gv-post.gv-theme-dark .gv-caption,
.gv-post.gv-theme-dark .gv-caption-user {
    color: #f5f5f5;
}
.gv-post.gv-theme-dark .gv-comment-user {
    color: #f5f5f5;
}
.gv-post.gv-theme-dark .gv-comment {
    color: #d0d0d0;
}
.gv-post.gv-theme-dark .gv-timestamp {
    color: #888;
}
.gv-post.gv-theme-dark .gv-comments-expander {
    color: #888;
}
.gv-post.gv-theme-dark .gv-comments-expander:hover {
    color: #f5f5f5;
}

/* === Actions === */
.gv-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 0;
}

.gv-actions-left {
    display: flex;
    gap: 16px;
}

.gv-actions-left svg,
.gv-actions-right svg {
    cursor: pointer;
    transition: transform 0.15s ease;
}

.gv-actions-left svg:hover,
.gv-actions-right svg:hover {
    transform: scale(1.1);
}

/* === Counters === */
.gv-counters {
    padding: 6px 14px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.gv-counter {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.gv-counter-value {
    font-variant-numeric: tabular-nums;
}

.gv-counter-label {
    font-weight: 400;
    margin-left: 2px;
}

/* === Caption === */
.gv-caption {
    padding: 4px 14px 0;
    font-size: 14px;
    line-height: 1.4;
}

.gv-caption-user {
    font-weight: 600;
    margin-right: 4px;
}

/* === Comments === */
.gv-comments {
    padding: 2px 14px;
    overflow: hidden;
}

.gv-comment {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 1px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gv-comment.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Static mode - no animation needed */
.gv-comment.static {
    opacity: 1;
    transform: none;
    transition: none;
}

.gv-comment-user {
    font-weight: 600;
    margin-right: 4px;
}

/* Overflow comments (hidden until expander clicked) */
.gv-comment-overflow {
    display: none;
}

/* "View all X comments" expander link */
.gv-comments-expander {
    font-size: 13px;
    color: #8e8e8e;
    cursor: pointer;
    padding: 4px 0 2px;
    display: block;
    user-select: none;
    transition: color 0.15s;
}
.gv-comments-expander:hover {
    color: #262626;
}

/* Liked by creator heart on comments */
.gv-comment-heart {
    font-size: 11px;
    margin-left: 6px;
    vertical-align: middle;
}

/* === Timestamp === */
.gv-timestamp {
    padding: 8px 14px 14px;
    font-size: 10px;
    color: #8e8e8e;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

/* === Views Counter (below actions) === */
.gv-views {
    padding: 4px 14px 0;
    font-size: 14px;
    font-weight: 600;
}

/* === Branding Overlay === */
.gv-branding {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 3;
    pointer-events: none;
}

.gv-branding.visible {
    opacity: 1;
    transform: translateY(0);
}

.gv-branding-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.5px;
}

.gv-branding-text span {
    color: #BFFF00;
}

/* === Heart Animation (on like) === */
.gv-heart-burst {
    position: absolute;
    pointer-events: none;
    z-index: 10;
}

@keyframes gvHeartFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.4);
    }
}

.gv-heart-particle {
    position: absolute;
    font-size: 20px;
    animation: gvHeartFloat 1.2s ease-out forwards;
}

/* === Counter Tick Animation === */
@keyframes gvCounterBump {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.gv-counter-bump {
    animation: gvCounterBump 0.3s ease-out;
}

/* === Shimmer effect for loading state === */
@keyframes gvShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.gv-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: gvShimmer 1.5s infinite;
}

/* === Dark theme wrapper (for display page) === */
.gv-display-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #0A0A0A;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.gv-display-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(191,255,0,0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* === Engagement pulse ring === */
@keyframes gvPulseRing {
    0% {
        box-shadow: 0 0 0 0 rgba(191,255,0,0.3);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(191,255,0,0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(191,255,0,0);
    }
}

.gv-post.pulsing {
    animation: gvPulseRing 2s ease-out;
}

/* === Responsive === */
@media (max-width: 480px) {
    .gv-post {
        --gv-post-width: 100%;
        border-radius: 0;
    }

    .gv-display-wrapper {
        padding: 0;
    }

    .gv-trending {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* ============================================
   Twitter/X Platform Mockup
   ============================================ */
.gv-platform-twitter {
    background: #15202B;
    color: #e7e9ea;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    padding: 16px;
    position: relative;
    overflow: visible;
    box-shadow: 0 4px 32px rgba(0,0,0,0.5);
}

.gv-tw-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.gv-tw-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    flex-shrink: 0;
}

.gv-tw-userblock {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.gv-tw-toprow {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gv-tw-displayname {
    font-weight: 700;
    font-size: 15px;
    color: #e7e9ea;
}

.gv-tw-verified {
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0);
}

.gv-tw-verified.visible {
    opacity: 1;
    transform: scale(1);
}

.gv-tw-handle {
    font-size: 14px;
    color: #71767b;
}

.gv-tw-xlogo {
    flex-shrink: 0;
}

.gv-tw-body {
    margin-bottom: 10px;
}

.gv-tw-text {
    font-size: 15px;
    line-height: 1.5;
    color: #e7e9ea;
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.gv-tw-media {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #2f3336;
    margin-bottom: 4px;
}

.gv-tw-media img {
    width: 100%;
    display: block;
    max-height: 280px;
    object-fit: cover;
}

.gv-tw-stats-bar {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-top: 1px solid #2f3336;
    border-bottom: 1px solid #2f3336;
    margin-bottom: 6px;
}

.gv-tw-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #71767b;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    padding: 6px 0;
    border-radius: 8px;
    transition: background 0.15s;
}

.gv-tw-stat:hover {
    background: rgba(255,255,255,0.06);
}

.gv-tw-stat-likes:hover {
    color: #F91880;
}

.gv-tw-timestamp {
    font-size: 12px;
    color: #71767b;
    margin-top: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.gv-platform-twitter .gv-branding {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    padding: 8px 0 0;
    background: none;
    opacity: 0;
    transform: none;
    transition: opacity 0.5s ease;
    justify-content: flex-end;
    pointer-events: none;
    display: flex;
}

.gv-platform-twitter .gv-branding.visible {
    opacity: 1;
    transform: none;
}

/* === Twitter Light Mode === */
.gv-platform-twitter-light {
    background: #ffffff !important;
    color: #0f1419 !important;
    border: 1px solid #eff3f4;
}
.gv-platform-twitter-light .gv-tw-displayname {
    color: #0f1419;
}
.gv-platform-twitter-light .gv-tw-handle {
    color: #536471;
}
.gv-platform-twitter-light .gv-tw-text {
    color: #0f1419;
}
.gv-platform-twitter-light .gv-tw-stats-bar {
    border-color: #eff3f4;
}
.gv-platform-twitter-light .gv-tw-stat svg {
    stroke: #536471;
}
.gv-platform-twitter-light .gv-tw-timestamp {
    color: #536471;
}
.gv-platform-twitter-light .gv-tw-xlogo svg {
    fill: #0f1419;
}
.gv-platform-twitter-light .gv-tw-media {
    border-color: #eff3f4;
}

/* ============================================
   TikTok Platform Mockup
   ============================================ */
.gv-platform-tiktok {
    background: #010101;
    color: #ffffff;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(0,0,0,0.7);
    position: relative;
}

.gv-tk-media {
    position: relative;
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 560px;
    background: #161823;
    overflow: hidden;
}

.gv-tk-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.gv-tk-bg-img.visible {
    display: block;
}

.gv-tk-bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
}

.gv-tk-overlay-dark {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 30%,
        rgba(0,0,0,0.8) 100%
    );
}

.gv-tk-sidebar {
    position: absolute;
    right: 8px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 3;
}

.gv-tk-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    border: 2px solid #fff !important;
    font-size: 18px !important;
    position: relative;
}

.gv-tk-avatar-plus {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: #ff2d55;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    border: 1.5px solid #010101;
}

.gv-tk-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.gv-tk-bottom {
    position: absolute;
    bottom: 48px;
    left: 12px;
    right: 72px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gv-tk-username {
    font-weight: 700;
    font-size: 15px;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.gv-tk-caption {
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gv-tk-music {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.gv-tk-branding {
    position: absolute;
    top: 10px;
    left: 10px;
    right: auto;
    bottom: auto;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    padding: 4px 10px !important;
    opacity: 0;
    transform: none !important;
    transition: opacity 0.5s ease;
    z-index: 4;
}

.gv-tk-branding.visible {
    opacity: 1;
}

.gv-tk-footer {
    background: #010101;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 12px;
}

.gv-tk-footer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #aaa;
    font-size: 10px;
    cursor: pointer;
    min-width: 50px;
}

.gv-tk-footer-btn.active {
    color: #fff;
}

.gv-tk-footer-add {
    color: #fff;
}

.gv-tk-add-icon {
    width: 36px;
    height: 28px;
    background: linear-gradient(135deg, #69C9D0, #EE1D52);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

/* ============================================
   Discord Platform Mockup
   ============================================ */
.gv-platform-discord {
    background: #313338;
    color: #dcddde;
    border-radius: 12px;
    font-family: 'gg sans', 'Noto Sans', Whitney, 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(0,0,0,0.6);
    position: relative;
}

.gv-dc-titlebar {
    background: #2b2d31;
    border-bottom: 1px solid #1e1f22;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gv-dc-server-icon {
    font-size: 18px;
}

.gv-dc-server-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.gv-dc-server-name {
    font-size: 13px;
    font-weight: 700;
    color: #f2f3f5;
}

.gv-dc-channel-name {
    font-size: 11px;
    color: #949ba4;
}

.gv-dc-messages {
    padding: 12px 16px;
    background: #313338;
}

.gv-dc-message {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.gv-dc-avatar {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    flex-shrink: 0;
    margin-top: 2px;
}

.gv-dc-body {
    flex: 1;
    min-width: 0;
}

.gv-dc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.gv-dc-username {
    font-weight: 600;
    font-size: 15px;
    color: #c9cdfb;
    cursor: pointer;
}

.gv-dc-username:hover {
    text-decoration: underline;
}

.gv-dc-verified {
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0);
}

.gv-dc-verified.visible {
    opacity: 1;
    transform: scale(1);
}

.gv-dc-timestamp {
    font-size: 11px;
    color: #87898c;
}

.gv-dc-text {
    font-size: 14px;
    line-height: 1.5;
    color: #dcddde;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 8px;
}

.gv-dc-embed-img {
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    max-width: 400px;
    border-left: 4px solid #5865F2;
}

.gv-dc-embed-img img {
    width: 100%;
    display: block;
    max-height: 240px;
    object-fit: cover;
}

.gv-dc-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.gv-dc-reaction {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #373a40;
    border: 1px solid #4e5058;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 13px;
    color: #b5bac1;
    cursor: pointer;
    transition: background 0.15s;
}

.gv-dc-reaction:hover {
    background: #4e5058;
}

.gv-platform-discord .gv-branding {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    padding: 6px 16px 10px;
    background: none;
    opacity: 0;
    transform: none;
    transition: opacity 0.5s ease;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
    border-top: 1px solid #2b2d31;
}

.gv-platform-discord .gv-branding.visible {
    opacity: 1;
    transform: none;
}

/* Platform-specific trending badge overrides */
.gv-platform-twitter .gv-trending,
.gv-platform-tiktok .gv-trending,
.gv-platform-discord .gv-trending {
    border-radius: 8px 8px 0 0;
}
