/* ================= LAYOUT ================= */
.aster-layout {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    height: 44px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    text-align: left;
    flex-shrink: 0;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
}
.nav-item.active:hover {
    background: var(--gradient);
    color: #fff;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
    flex-shrink: 0;
}

/* Карточка пользователя */
.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    background: var(--bg-body);
    cursor: pointer;
    transition: background 0.2s;
    margin: 4px 0;
    flex-shrink: 0;
}
.user-card:hover { background: var(--bg-hover); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
    overflow: hidden;
}
.user-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.user-info { min-width: 0; flex: 1; }
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.sidebar-spacer { flex: 1; min-height: 20px; }
.copyright {
    font-size: 11px;
    color: var(--text-muted);
    padding: 8px 12px;
    flex-shrink: 0;
}

/* ================= MAIN ================= */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 28px;
    background: var(--bg-body);
    min-width: 0;
}

/* Чипы */
.chips-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}
.chips-row::-webkit-scrollbar { height: 4px; }
.chips-row::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.chip {
    flex-shrink: 0;
    height: 36px;
    padding: 0 18px;
    border-radius: 30px;
    background: #fff;
    border: 1px solid var(--border);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.chip:hover { background: var(--bg-hover); color: var(--text-primary); }
.chip.active {
    background: var(--gradient);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}

/* Заголовок секции */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-header h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}
.setup-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s;
}
.setup-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.setup-btn i { font-size: 14px; }

/* ================= VIDEO GRID ================= */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px 20px;
    margin-bottom: 40px;
}

.video-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.video-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    background: var(--gradient);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Оверлей с иконкой play при ховере */
.video-thumb::after {
    content: '\f04b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s;
    background: rgba(0, 0, 0, 0.18);
    z-index: 1;
}
.video-card:hover .video-thumb::after { opacity: 1; }

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(6, 11, 25, 0.8);
    color: #fff;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 3;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
}

.video-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    z-index: 2;
}
.video-progress span {
    display: block;
    height: 100%;
    background: var(--gradient);
}

.video-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    min-height: 40px;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.channel-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.video-meta-info {
    min-width: 0;
    flex: 1;
}
.channel-name-sm {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.video-stats {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ================= АДАПТИВ ================= */
@media (max-width: 1024px) {
    .sidebar { width: 200px; }
    .main-content { padding: 16px 20px 24px; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 12px 12px 20px; }
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px 12px;
    }
}
/* Кнопка Загрузить ещё */
.load-more-wrap {
    text-align: center;
    margin: 20px 0 40px;
}
.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}
.load-more-btn:hover {
    background: var(--bg-hover);
    border-color: var(--amethyst);
    color: var(--amethyst);
}