/* Carousel Styles */
.tiktok-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.tiktok-carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    width: 100%;
}

.tiktok-video-card {
    min-width: 200px;
    max-width: 200px;
    flex: 0 0 200px;
    margin: 0;
    transition: transform 0.3s, box-shadow 0.3s;
}

.carousel-btn {
    background: #fff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 10;
    transition: background 0.2s, box-shadow 0.2s;
    padding: 0 !important;
}
.carousel-btn svg {
    fill: #222;
}
.carousel-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.carousel-btn-left {
    margin-right: 12px;
    margin-left: 12px;
    left: 0;
}
.carousel-btn-right {
    margin-left: 12px;
    margin-right: 12px;
    right: 0;
}

@media (max-width: 900px) {
    .tiktok-video-card {
        min-width: 190px;
        max-width: 190px;
        flex: 0 0 190px;
    }
}

@media (max-width: 600px) {
    .tiktok-carousel-track {
        gap: 12px;
    }
    .tiktok-video-card {
        min-width: 130px;
        max-width: 130px;
        flex: 0 0 130px;
    }
    .carousel-btn {
        width: 36px;
        height: 36px;
        position: absolute;
    }
}
/* TikTok Video Feed - Frontend Styles */

/* Container */
.tiktok-video-feed {
    width: 100%;
    padding: 20px 0;
}

/* Grid Layout */
.tiktok-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Mobile horizontal scroll */
@media (max-width: 768px) {
    .tiktok-videos-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
        padding: 10px;
        margin: 0 -10px;
    }
    
    .tiktok-videos-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .tiktok-videos-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    .tiktok-videos-grid::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }
    
    .tiktok-video-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }
}

/* Video Card */
.tiktok-video-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tiktok-video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    padding-bottom: 177.78%; /* 9:16 aspect ratio */
    overflow: hidden;
    background: #000;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.video-wrapper video:hover {
    opacity: 0.9;
}

/* Thumbnail */
.video-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

/* Play Overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.tiktok-video-card:hover .play-overlay {
    opacity: 1;
}

.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.play-overlay:hover .play-icon {
    transform: scale(1.1);
}

.play-icon svg {
    width: 30px;
    height: 30px;
    fill: #000;
    margin-left: 4px;
}

/* Video Info Overlay */
.video-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    z-index: 3;
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 5px;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.video-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    opacity: 0.9;
    color: #fff;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Video Button */
.video-button {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    z-index: 10;
    position: relative;
}

.video-button:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Sound Toggle */
.sound-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.3s;
}

.sound-toggle:hover {
    background: rgba(0,0,0,0.8);
}

.sound-toggle svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* Modal Styles */
.tiktok-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.tiktok-modal.active {
    opacity: 1;
    visibility: visible;
}

.tiktok-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
}

.tiktok-modal-content {
    position: relative;
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.tiktok-modal.active .tiktok-modal-content {
    transform: scale(1);
}

.tiktok-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.3s, transform 0.2s;
}

.tiktok-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.tiktok-modal-close svg {
    stroke: #fff;
}

/* Modal Video Wrapper */
.tiktok-modal-video-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
}

.tiktok-modal-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: 100%;
    object-fit: contain;
}

/* Modal Sidebar */
.tiktok-modal-sidebar {
    width: 350px;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.tiktok-modal-info {
    padding: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tiktok-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.4;
}

.tiktok-modal-description {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    line-height: 1.6;
    margin: 0;
}

.tiktok-modal-stats {
    display: flex;
    gap: 20px;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tiktok-modal-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
}

.tiktok-modal-stats .stat-item svg {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* Modal Actions */
.tiktok-modal-actions {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.like-btn.liked {
    background: rgba(255, 68, 68, 0.2);
    border-color: #ff4444;
    color: #ff4444;
}

.video-button-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    margin-top: 8px;
}

.video-button-modal:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Body scroll lock */
body.tiktok-modal-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tiktok-modal-content {
        flex-direction: column;
        height: auto;
        max-height: 90vh;
    }
    
    .tiktok-modal-sidebar {
        width: 100%;
        max-height: 40vh;
    }
    
    .tiktok-modal-video-wrapper {
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .tiktok-videos-grid {
        display: flex !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 15px;
        padding: 10px;
        margin: 0 -10px;
        grid-template-columns: unset !important;
    }
    
    .tiktok-videos-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .tiktok-videos-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 10px;
    }
    
    .tiktok-videos-grid::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }
    
    .tiktok-video-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }
    
    .tiktok-modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .video-info-overlay {
        padding: 15px 12px;
    }
    
    .video-title {
        font-size: 13px;
    }
    
    .play-icon {
        width: 50px;
        height: 50px;
    }
    
    .play-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .tiktok-video-card {
        flex: 0 0 150px;
    }
    
    .tiktok-modal-sidebar {
        max-height: 50vh;
    }
    
    .tiktok-modal-video-wrapper {
        height: 50vh;
    }
    
    .tiktok-modal-info,
    .tiktok-modal-actions {
        padding: 20px;
    }
    
    .tiktok-modal-stats {
        padding: 15px 20px;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.video-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Custom Scrollbar for Modal Sidebar */
.tiktok-modal-sidebar::-webkit-scrollbar {
    width: 8px;
}

.tiktok-modal-sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.tiktok-modal-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.tiktok-modal-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}