/* CSS Document */
.sv-tiktok-section {
    max-width: 1040px;
    margin: 0 auto;
    padding: 35px 15px 55px;
    direction: rtl;
    text-align: center;
}

.sv-tiktok-title {
    margin: 0 0 32px;
    font-size: 22px;
    line-height: 1.4;
    font-weight: normal;
    color: #bd1d34;
}

.sv-tiktok-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
}

.sv-tiktok-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 5px;
    background: #f7d6dc;
}

.sv-tiktok-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: 5px;
    background: linear-gradient(135deg, #f4c7d0, #fff0f3);
}

.sv-tiktok-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.sv-tiktok-thumb.is-loaded img {
    opacity: 1;
    visibility: visible;
}

.sv-tiktok-item:hover .sv-tiktok-thumb img {
    transform: scale(1.045);
}

.sv-tiktok-thumb:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
    pointer-events: none;
}

.sv-tiktok-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(189, 29, 52, 0.38);
    border: 2px solid rgba(255, 255, 255, 0.65);
    transform: translate(-50%, -50%) scale(1);
    transition:
        transform 0.28s ease,
        background 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv-tiktok-play:before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    margin-left: 4px; /* דחיפה קטנה ויזואלית כדי שהמשולש ירגיש ממורכז */
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 17px solid rgba(255, 255, 255, 0.9);
    transition: border-left-color 0.28s ease;
}

.sv-tiktok-item:hover .sv-tiktok-play {
    transform: translate(-50%, -50%) scale(1.16);
    background: rgba(189, 29, 52, 0.92);
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 8px rgba(189, 29, 52, 0.18);
}

.sv-tiktok-item:hover .sv-tiktok-play:before {
    border-left-color: #fff;
}

.sv-tiktok-views {
    position: absolute;
    right: 24px;
    bottom: 6px;
    z-index: 2;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,0.45);
    direction: ltr;
}

.sv-tiktok-thumb.is-loading:before {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    transform: translateY(-50%);
    color: #bd1d34;
    font-size: 14px;
    z-index: 1;
}

.sv-tiktok-thumb.is-empty:before {
    content: "TikTok";
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    transform: translateY(-50%);
    color: #bd1d34;
    font-size: 22px;
    font-weight: bold;
    z-index: 1;
}

/* Popup */
.sv-tiktok-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.sv-tiktok-popup.is-open {
    display: flex;
}

.sv-tiktok-popup-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.72);
}

.sv-tiktok-popup-box {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 430px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 70px rgba(0,0,0,0.45);
}

.sv-tiktok-close {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 4;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    color: #bd1d34;
    font-size: 27px;
    line-height: 30px;
    cursor: pointer;
    padding: 0;
}

.sv-tiktok-frame-wrap {
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
}

.sv-tiktok-frame-wrap iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive */
@media (max-width: 1050px) {
    .sv-tiktok-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 820px) {
    .sv-tiktok-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

@media (max-width: 560px) {
    .sv-tiktok-section {
        padding: 25px 12px 40px;
    }

    .sv-tiktok-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sv-tiktok-title {
        font-size: 19px;
        margin-bottom: 22px;
    }

    .sv-tiktok-popup {
        padding: 12px;
    }
}