/* TikTok Feed - Correct Design: Likes on Image, Profile Below */

.custom-tt-feed .tt-post {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 500px;
    width: 380px;
    display: flex;
    flex-direction: column;
    margin: 10px 0;
}

/* Video Link - Wraps the video thumbnail */
.custom-tt-feed .tt-video-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    min-height: 0;
    text-decoration: none;
    color: inherit;
}

/* Profile Link - Wraps the profile bar */
.custom-tt-feed .tt-profile-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

/* No hover effect on profile link */

/* Image Section - Takes most of the card with padding */
.custom-tt-feed .tt-media-wrapper {
    width: 100%;
    flex: 1;
    position: relative;
    padding: 12px;
    background: #fff;
    /* White background so padding area is white */
}

.custom-tt-feed .tt-media-wrapper-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

/* Dark Overlay (Same as Instagram) - Only on image area, not padding */
.custom-tt-feed .tt-media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 3;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    pointer-events: none;
    /* Don't block clicks */
}

.custom-tt-feed .tt-media-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background-color: #f0f0f0;
    position: absolute;
    left: 0;
    top: 0;
}

/* Like Count - Simple White Text on Image (No Background) */
.custom-tt-feed .tt-likes-overlay {
    position: absolute;
    bottom: 15px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 1;
}

.custom-tt-feed .tt-likes-overlay .tt-heart-icon {
    font-size: 16px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.custom-tt-feed .tt-likes-overlay .tt-like-count {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Bottom White Bar - Profile Info BELOW Image */
.custom-tt-feed .tt-bottom-bar {
    background: #fff;
    padding: 0px 12px 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

.custom-tt-feed .tt-profile-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-tt-feed .tt-profile-img {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    overflow: hidden;
    background: #0066ff;
    flex-shrink: 0;
}

.custom-tt-feed .tt-profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.custom-tt-feed .tt-profile-name {
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

/* Hover Effects - Overlay Fade Only (Same as Instagram) */
@media (min-width: 992px) {

    /* Fade overlay on hover (same as Instagram) */
    .custom-tt-feed .tt-video-link:hover .tt-media-overlay {
        opacity: 0;
    }
}

/* Focus States - Removed to prevent red/blue border on click */
.custom-tt-feed .tt-video-link:focus {
    outline: none;
}

.custom-tt-feed .tt-profile-link:focus {
    outline: none;
}

/* Mobile/Tablet - Active (Touch) Effects */
@media (max-width: 991px) {

    /* Fade overlay on active/touch (same as desktop hover) */
    .custom-tt-feed .tt-video-link:active .tt-media-overlay {
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 991px) {
    .custom-tt-feed .tt-post {
        width: 355px;
        min-height: 500px;
    }

    .custom-tt-feed .tt-bottom-bar {
        padding: 0px 12px 12px;
    }

    .custom-tt-feed .tt-likes-overlay {
        bottom: 12px;
        left: 12px;
        padding: 5px 10px;
    }
}

@media (max-width: 499px) {
    .custom-tt-feed .tt-post {
        width: 345px;
        min-height: 480px;
    }

    .custom-tt-feed .tt-bottom-bar {
        padding: 0px 12px 12px;
        gap: 8px;
    }

    .custom-tt-feed .tt-likes-overlay {
        bottom: 8px;
        left: 10px;
        padding: 4px 8px;
    }

    .custom-tt-feed .tt-profile-img {
        width: 25px;
        height: 25px;
    }

    .custom-tt-feed .tt-profile-name {
        /* font-size: 13px; */
    }

    .custom-tt-feed .tt-likes-overlay .tt-like-count {
        font-size: 13px;
    }

    .custom-tt-feed .tt-likes-overlay .tt-heart-icon {
        font-size: 14px;
    }
}

/* ============================================
   TikTok Authorization Notice
   ============================================ */

.tiktok-authorize-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.tiktok-authorize-notice {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.tiktok-authorize-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.tiktok-authorize-notice h3 {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin: 0 0 16px 0;
}

.tiktok-authorize-notice p {
    font-size: 16px;
    color: #6c757d;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.tiktok-authorize-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fe2c55 0%, #ff0050 100%);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(254, 44, 85, 0.3);
    border: none;
    cursor: pointer;
}

.tiktok-authorize-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(254, 44, 85, 0.4);
    color: white;
    text-decoration: none;
}

.tiktok-authorize-btn .icon {
    font-size: 20px;
}

.tiktok-authorize-note {
    font-size: 13px !important;
    color: #adb5bd !important;
    margin: 16px 0 0 0 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .tiktok-authorize-container {
        min-height: 300px;
        padding: 20px 15px;
    }

    .tiktok-authorize-notice {
        padding: 32px 24px;
    }

    .tiktok-authorize-notice h3 {
        font-size: 22px;
    }

    .tiktok-authorize-btn {
        font-size: 16px;
        padding: 14px 28px;
    }
}

/* ============================================
   Video Hover Effect
   ============================================ */

/* Video element - hidden by default, positioned over thumbnail */
.custom-tt-feed .tt-media-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    z-index: 2;
    border-radius: 8px;
}

/* Thumbnail - always below video */
.custom-tt-feed .tt-thumbnail {
    z-index: 1;
}

/* When video has been loaded, keep it visible (showing paused frame) */
.custom-tt-feed .tt-media-video.video-loaded {
    opacity: 1;
}

/* Hide thumbnail once video loads */
.custom-tt-feed .tt-media-wrapper.video-active .tt-thumbnail {
    opacity: 0;
}

/* Ensure likes overlay stays on top of video */
.custom-tt-feed .tt-likes-overlay {
    z-index: 3;
}

/* Gradient overlay for like count visibility */
.custom-tt-feed .tt-media-wrapper-inner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 10%, rgba(0, 0, 0, 0.5) 40%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    z-index: 2;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}