/* Grid + cards */

.ttf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
}

.ttf-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.55);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.ttf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.7);
}

.ttf-thumb {
    position: relative;
    width: 100%;
    height: var(--ttf-card-height, 240px); /* driven by PHP */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ttf-play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
}

.ttf-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #4ade80); /* green gradient */
    color: #ffffff;
    z-index: 2;
}

.ttf-info {
    padding: 10px 12px 12px;
}

.ttf-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #e5e7eb;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ttf-feed-empty {
    font-size: 14px;
    color: #6b7280;
}

/* Modal player */

.ttf-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.ttf-modal.ttf-show {
    display: flex;
}

.ttf-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

/* Smaller popup for desktop */
.ttf-modal-box {
    position: relative;
    width: min(480px, 90vw); /* not huge anymore */
    aspect-ratio: 9/16;
    background: #000000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.85);
}

#ttf-player {
    width: 100%;
    height: 100%;
    border: 0;
}

/* Close button */

.ttf-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(0,0,0,0.7);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Responsive tweaks */

@media (max-width: 640px) {
    .ttf-grid {
        gap: 12px;
    }
    .ttf-card {
        border-radius: 16px;
    }
}
