/* === UXT PRO PREMIUM WIDGETS & ADS === */

:root {
    --widget-spring: cubic-bezier(0.5, -0.5, 0.1, 1.5);
}

/* Sticky Widget Logic */
.sticky-widget-enabled {
    position: -webkit-sticky !important;
    /* Safari */
    position: sticky !important;
    top: calc(var(--header-offset, 80px) + var(--space-lg)) !important;
    z-index: 100;
    height: fit-content;
    align-self: flex-start;
}

/* Mobile check: disable sticky on small screens */
@media (max-width: 1024px) {
    .sticky-widget-enabled {
        position: static !important;
    }
}

.custom-tabbed-widget {
    z-index: 10;
    /* Glass Effect matching breadcrumbs */
    background: color-mix(in oklab, var(--surface-1) 30%, transparent) !important;
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border: none !important;
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding: 32px;
    margin-top: 0 !important;
    margin-bottom: var(--space-md) !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 40px -15px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
}

/* Sidebar Compact Ads Fix */
.lnb-widget-column .ad-unit-wrap {
    height: auto;
    min-height: 240px !important;
    /* Compact height for 14" laptops */
    padding: 24px !important;
    margin-top: 0 !important;
    /* Spacing handled by widget margin-bottom */
}

.tabs-nav {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
    height: 48px;
    margin-bottom: 24px;
}

.tab-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
}

.tab-btn[data-tab="popular"] svg {
    width: 26px;
    height: 26px;
    margin-top: -5px;
    /* Lift up significantly to align visuals */
}

.tab-btn.active {
    color: var(--accent);
}

.tab-btn:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
}

.tab-btn {
    transition: all 0.3s var(--ease);
}

.indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transition: transform 0.4s var(--widget-spring), width 0.3s ease;
}

/* Tab Panes */
.custom-tabbed-widget .tab-pane {
    display: none;
    opacity: 0;
}

.custom-tabbed-widget .tab-pane.active {
    display: block;
    animation: widgetFadeIn 0.3s ease forwards;
}

@keyframes widgetFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item {
    display: flex;
    gap: 16px;
    margin: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    width: calc(100% - 24px);
    text-decoration: none;
    align-items: center;
    transition: all 0.3s var(--ease);
    box-sizing: border-box; /* Ensure padding doesn't add to width */
}

.news-item:hover {
    background: transparent;
    transform: translateX(5px);
}

/* Title color remains consistent on hover */
.news-item:hover .news-title {
    color: var(--text-primary);
}

.news-thumb {
    width: 82px;
    height: 62px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uxt-text-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
}

.news-info {
    flex: 1;
    min-width: 0; /* Crucial for preventing flex overflow from titles */
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent), #00e5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.news-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.news-item.tab-comment-item {
    align-items: flex-start;
}

.comment-text {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.5;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-thumb .avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.tab-comment-item .news-info {
    flex: 1;
    min-width: 0;
}